cancel
Showing results for 
Search instead for 
Did you mean: 

Easy way to visualize a process instance history?

gguimezanes
Champ in-the-making
Champ in-the-making
Hello,
I would like to draw the diagram of a process instance with the history highlighted. My ideal would be to highlight past activities and flows in one color, and current activities in another colors, but just being able to highlight the whole path "from start event to current state" would already be great.
I imagine that I should use
ProcessDiagramGenerator.generateDiagram(processDefinitionEntity, "png", highLightedActivities, highLightedFlows)

-> for the historical activities, I use
historyService.createHistoricActivityInstanceQuery().processInstanceId(processInstanceId).finished().list();
-> for the current activities , I use :
runtimeService.getActiveActivityIds(processInstanceId);
-> but I have no idea on how to find the flows that I should get highlighted (I have several flows that end up to the same task so it is not absolutely obvious from the highlighted tasks which path led to them…)

Any idea?
16 REPLIES 16

martin_grofcik
Confirmed Champ
Confirmed Champ
Is your problem solved?

debarcar
Champ in-the-making
Champ in-the-making
Yes.  I get the activities and sort them by start time, and analyze them according to the processDefinition, then get the  operation log I want.

Thanks and Best Regards!

pallettaro
Champ in-the-making
Champ in-the-making
Hello,
i can't highlight correct flows when the process contains exclusive gateway: since I have only highlighted tasks, I can't infer which flow is correct.
Could Activiti add in HistoryService a method to return those SequenceFlows?

jbarrez
Star Contributor
Star Contributor
How do you mean? if you got the tasks, and you got the process model you do know where the exclusive gateway went, right?

tommmied
Champ in-the-making
Champ in-the-making
What if one of the outgoing transitions on an exclusive gateway is going to a previous task that was already executed and another going to a brand new task. The flow went to the new task.  How do i determine that the sequence went to the new task and not the previous task?  http://imgur.com/imUt4CX In this diagram the sequence flow went from a->b->c  however the second gateway also shows the transition going back to A since it was in the history as well.  There seems to be no way to determine which transition was executed in the history tables.

Can you give me an example code to do this please? I tried iam's answer for hours but still not work.

jbarrez
Star Contributor
Star Contributor
To know the order, you'd need the timestamps in the ACT_HI_ACTINST table