cancel
Showing results for 
Search instead for 
Did you mean: 

Distinguish process instances in 'My instances'-Tab

b_schnarr
Champ in-the-making
Champ in-the-making
Hello community,

lets say I start mutiple instances of the same process definition. Then I can see all those instances in the "My instances"-Tab. The problem is, that all those instances have the same name (except the id in brackets. Here is a sample: https://www.dropbox.com/s/toh5a40re8tvac9/process_names.PNG). That could be confusing because the user probably must go through all processes to find the right one.

Is there a way to extend the process instance name with another attribute? Maybe a value from a form field or a date attribute? Then, the user could distinguish his instances much better. Which code should be altered?

Thank  you very much and best regards
Ben
7 REPLIES 7

martin_grofcik
Confirmed Champ
Confirmed Champ
Hi Ben.

May be you can try to use expressions in process name. (I am not sure whether it is possible).
In another case you can modify activiti-explorer to use variable from the process to display in the list.

Regards
Martin

b_schnarr
Champ in-the-making
Champ in-the-making
Hi Martin, thanks for your quick answer. Expressions only work in Service- and User-Task names. When a user task has the name "response", you could also name the user task "response of ${initiator}". That works fine. But that does not work for process instance name. When I name the process "document approval for ${initiator}", is will be displayed exactly this way without filling the variable.

Could you give me a hint where I can find the necessary code in the Explorer?

Thank you and best regards
Ben

jbarrez
Star Contributor
Star Contributor
There is indeed no support for distinguishing those (indeed no support for expression in that case) . Typically you would use a different businessKey, but those are also not shown visually.

b_schnarr
Champ in-the-making
Champ in-the-making
Thanks for your answer. Maybe, I can add some custom code to the Activiti Explorer in a way that a unique attribute will be shown additionally (e.g. current time)? Could you give me a hint where I can find the related code in the Activiti Explorer? When I understand it right, it is just a problem how the process instances were shown in the Explorer App. Maybe, I could add the current time behind the process instance name?

Is it on the roadmap to add support for expression? That would be very helpful, especially in productive environments.

Thanks and best regards

jbarrez
Star Contributor
Star Contributor
The class is org.activiti.explorer.ui.process.ProcessInstancePage (parent of MyProcessInstancesPage),

currently only name is set:

    processInstanceTable.addGeneratedColumn("icon", new ThemeImageColumnGenerator(Images.PROCESS_22));
    processInstanceTable.setColumnWidth("icon", 22);
   
    processInstanceTable.addContainerProperty("name", String.class, null);
    processInstanceTable.setColumnHeaderMode(Table.COLUMN_HEADER_MODE_HIDDEN);
   


Support for process instance name expression is tricky: the name is persisted before any variables are added … and as such there is little to evaluate from. But it's doable with a bit of refactoring.

b_schnarr
Champ in-the-making
Champ in-the-making
Thanks for your answer. Where should I post a feature request?

jbarrez
Star Contributor
Star Contributor
All issues go into our jira: http://jira.codehaus.org/browse/ACT