Himanshu Dewan
Himanshu Dewan

Reputation: 117

Get a list of Possible flows from an execution like say a user task or a gateway in Activiti?

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

Upvotes: 2

Views: 1077

Answers (1)

user2017810
user2017810

Reputation: 245

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());
                }
        }

Upvotes: 3

Related Questions