cancel
Showing results for 
Search instead for 
Did you mean: 

Which api can be used to get sequence flow name?

annoycn
Champ in-the-making
Champ in-the-making
I wanna get sequence flow name attached to the task in my code, for example:

<userTask id="usertask1" name="User Task" activiti:assignee="johnny"></userTask>
<sequenceFlow id="flow4" name="approve" sourceRef="usertask1" targetRef="usertask2"></sequenceFlow>
<sequenceFlow id="flow6" name="reject" sourceRef="usertask1" targetRef="usertask3"></sequenceFlow>

i need a method like this searchSequenceFlowList(String taskid), when i call this method using 'usertask1' as the param,
i can get a List contains flow4 and flow6, and importantly, i need the sequence flow's name.

Anyone can tell me if there is a method like that in the Activiti Engine?

Thanks.
3 REPLIES 3

ronald_van_kuij
Champ on-the-rise
Champ on-the-rise
it might help to search the forum since this has been discussed. But…. this is not good bpmn, since BOTH sequenceflows will be taken in this case, all of the time. You need conditions and and an exclusive gateway afaik… but as mentioned, this has been discussed earlier

annoycn
Champ in-the-making
Champ in-the-making
it might help to search the forum since this has been discussed. But…. this is not good bpmn, since BOTH sequenceflows will be taken in this case, all of the time. You need conditions and and an exclusive gateway afaik… but as mentioned, this has been discussed earlier
Thank you for your reply.

I do not know whether this is best practice to design the model like below

<userTask id="usertask1" name="User Task" activiti:assignee="johnny"></userTask>
<sequenceFlow id="flow4" name="approve" sourceRef="usertask1" targetRef="usertask2">
      <conditionExpression xsi:type="tFormalExpression"><![CDATA[${approve}]]></conditionExpression>
</sequenceFlow>
<sequenceFlow id="flow6" name="reject" sourceRef="usertask1" targetRef="usertask3">
      <conditionExpression xsi:type="tFormalExpression"><![CDATA[${!approve}]]></conditionExpression>
</sequenceFlow>

As you can see that, I just add the condition to the sequence flow and do not use the exclusive gateway(in this way just one of the sequence flow will be executed) because of the reason that
I want to add the dynamic buttons to the approve page, like approve button and reject button, that's  why i need to know how to get the sequence flow list attached to the task.

If i design the model like this

<userTask id="usertask1" name="User Task" activiti:assignee="johnny"></userTask>
<exclusiveGateway id="exclusivegateway1" name="Exclusive Gateway"></exclusiveGateway>
<sequenceFlow id="flow8" name="" sourceRef="usertask1" targetRef="exclusivegateway1"></sequenceFlow>
<sequenceFlow id="flow4" name="approve" sourceRef="exclusivegateway1" targetRef="usertask2">
      <conditionExpression xsi:type="tFormalExpression"><![CDATA[${approve}]]></conditionExpression>
</sequenceFlow>
<sequenceFlow id="flow6" name="reject" sourceRef="exclusivegateway1" targetRef="usertask3">
      <conditionExpression xsi:type="tFormalExpression"><![CDATA[${!approve}]]></conditionExpression>
</sequenceFlow>

I cannot get the 'approve' and 'reject' sequence flows from 'usertask1'.

btw: I did not find the related subject on the api of sequence flow name, could you please give me more hint about that? Thanks

ronald_van_kuij
Champ on-the-rise
Champ on-the-rise