2

I am new to Activiti and am trying to integrate it with a web-application. I was going through the APIs and the DB to figure out if there was a way to get a list of possible flows from a gateway or a task (say which has been coupled with a boundary event of some sort)? In other words, what all paths are possible from a given task along with the conditions that one needs to satisfy in order to take that possible path?

I tried searching for this question on the forum/google but could not find the right topic. In case it has already been answered can you please point me to the source.

Thanks in advance

Himanshu

  • Using camunda this should be possible with the bpmn model api: https://github.com/camunda/camunda-bpmn-model. I just cannot tell whether you are working with activiti or camunda based on your text/tags. – Jan Galinski Sep 28 '14 at 19:21
  • @JanGalinski: I am working with Activiti. Have edited the tags now. Can you advise me on how to do it in Activiti? Through some digging on the internet, I found some references to pvm. But I am not too familiar with that or how to use it here (could not find any good online sources either) – Himanshu Dewan Sep 29 '14 at 19:38
  • Sorry, I switched to camunda when they forked activiti and the bpmn model api is camunda specific. – Jan Galinski Sep 29 '14 at 20:19
  • @janGalinski: No worries. Here is hoping someone else comes forward :) Could you point me to some good sources for reading about PVM and how they are important to a BPMN engine like Activiti, Camunda? – Himanshu Dewan Sep 30 '14 at 05:15

1 Answers1

3

I am not sure if I understood your question correctly. But I have used the following snippet and it works for me

       UserTask taskNode = null;
        if(node instanceof UserTask)
        {
            taskNode = (UserTask)node;
        }
        if(taskNode != null)
        {

                List<SequenceFlow> sequenceFlows = taskNode.getOutgoingFlows();
                for(SequenceFlow sequenceFlow : sequenceFlows)
                {
                    System.out.println(sequenceFlow.getName()+" "+sequenceFlow.getConditionExpression());
                }
        }
user2017810
  • 235
  • 1
  • 2
  • 17