cancel
Showing results for 
Search instead for 
Did you mean: 

add access to jobname?

ronald_van_kuij
Champ on-the-rise
Champ on-the-rise
For a management ui, I'd like to have access to job name. The free format text can be very interesting to show in job overviews.

How I currently do this is:

ProcessInstance pi = (ProcessInstance) rus.createProcessInstanceQuery().processInstanceId(job.getProcessInstanceId()).singleResult();
ExecutionEntity e = (ExecutionEntity) rus.createExecutionQuery().executionId(job.getExecutionId()).singleResult();
ProcessDefinitionEntity pd = (ProcessDefinitionEntity) rs.createProcessDefinitionQuery().processDefinitionId(e.getProcessDefinitionId()).singleResult();
      
Node node = XMLUtils.inputStreamToNode(rs.getResourceAsStream(pd.getDeploymentId(), pd.getResourceName()));
String name = XMLUtils.getString(node, "//*[@id=\""+e.getActivityId()+"\"]/@name");

Which is rather inefficient if done for to many jobs.

Does anybody have a better idea?
1 REPLY 1

trademak
Star Contributor
Star Contributor
Hi Ronald,

I absolutely agree that it's rather inefficient.
It should be quite easy to add an activityName property to the ExecutionEntity class.
Would that solve your issue?

Best regards,