CamundaEngineApi - Highlight transitions

Hi, we are migrating activiti 5.21 to camunda 7.6 (https://blog.camunda.org/post/2016/10/migrate-from-activiti-to-camunda).

We need to recover all completed activities and their transitions from history:

{
“historyElements”: [“SequenceFlow_0qo3sjt”, “SequenceFlow_16igpil”, “StartEvent_0sllthn”, “Task_0v0c3yl”, “BoundaryEvent_11ens6w”, “Task_03kcf68”]
}

In the documentation, we found how we can get all completed activities.

List history = historyService.createHistoricActivityInstanceQuery().processInstanceId(processInstanceId).list();

List activityIds = history.parallelStream().map(HistoricActivityInstance::getActivityId) .collect(Collectors.toList());

For the transitions between activities in Activiti, we get it manually using something like this class (https://github.com/Activiti/Activiti/blob/master/modules/activiti-diagram-rest/src/main/java/org/activiti/rest/diagram/services/ProcessInstanceHighlightsResource.java) - getHighlightedFlows(…).

There is something in camunda-api for recovery transitions of completed activities?

Hi @William_Assoni,

I am not familiar with Activiti features, could you explain in detail what is feature doing? You would like to get a rendered picture of historic process instance and path that was take by specific token?

Cheers,
Askar

Hi,

I need to return all elements-id that were executed in my flow:

//camunda-engine-7.6.0 @Autowired private HistoryService historyService;

/**

  • This method will return [“StartEvent_0sllthn”, “Task_0v0c3yl”, “BoundaryEvent_11ens6w”, “Task_03kcf68”]

  • HistoricActivityInstance-> camunda-engine-7.6.0
    */
    public List getExecutedElements(String processInstanceId) {
    List history = historyService.createHistoricActivityInstanceQuery().processInstanceId(processInstanceId).list();

    return history.parallelStream()
    .map(HistoricActivityInstance::getActivityId)
    .collect(Collectors.toList());
    }

    When I send to bpmn.io I will have this return:

But I need these transictions(sequenceFlow) between completed activities [“SequenceFlow_0qo3sjt”, “SequenceFlow_16igpil”]

Today I have this:

I expected this:

Is there a way to get these transictions from Camunda API or I need to get manually (getIncomingTransitions/getOutgoingTransitions) ?

Hi aakhmerov,
I would like to get a rendered picture of historic process instance and path that was take by specific token.How can I do that? and I want to view this for completed process instances as well.

Regards
Bikash

Hi William,

Did you find the solution?