How to obtain the activities of a process in the order of their flow?

I am currently using the camunda API to traverse a bpmn model, and I need to get the name of all the elements contained in the model but in their flow order.
Is there any way to get this information using JAVA language?

Hi @JHON_ALEXANDER_ROA_R,

This should be possible using Model API.

Read a Model | docs.camunda.org

Below is a helper method example to find the following flow nodes of a task or a gateway

public Collection<FlowNode> getFlowingFlowNodes(FlowNode node) {
  Collection<FlowNode> followingFlowNodes = new ArrayList<FlowNode>();
  for (SequenceFlow sequenceFlow : node.getOutgoing()) {
    followingFlowNodes.add(sequenceFlow.getTarget());
  }
  return followingFlowNodes;
}
1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.