cancel
Showing results for 
Search instead for 
Did you mean: 

Is there a goto statement kind of provision in Activiti?

vigneswaran
Champ on-the-rise
Champ on-the-rise

Hello Team,

Please refer to the process definition given below. Am receiving a value from user.

If the value > 10, service task for approved state is invoked.
If the value < 5, service task for rejected state is invoked.

If the value is between 5 and 10, it lands to a user task and user should decide and move the state of the process to Approval / Rejection based on his own discretion.

If this is available in enterprise version please let me know. We would like to try it out.

<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:activiti="http://activiti.org/bpmn" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlnsSmiley Surprisedmgdc="http://www.omg.org/spec/DD/20100524/DC" xmlnsSmiley Surprisedmgdi="http://www.omg.org/spec/DD/20100524/DI" typeLanguage="http://www.w3.org/2001/XMLSchema" expressionLanguage="http://www.w3.org/1999/XPath" targetNamespace="http://www.activiti.org/processdef">
<process id="test" name="test" isExecutable="true">
<startEvent id="sid-07D7C090-EAFB-438C-8546-6856CF8304E3"></startEvent>
<userTask id="sid-951EC96B-9B62-40AB-BDC7-5A4AF26006C7" name="Receive Data">
<extensionElements>
<activiti:formProperty id="myData" name="Enter Data" type="string" required="true"></activiti:formProperty>
</extensionElements>
</userTask>
<sequenceFlow id="sid-FFBC76AE-8BC4-4B5A-A3DE-EDAC55F96F21" sourceRef="sid-07D7C090-EAFB-438C-8546-6856CF8304E3" targetRef="sid-951EC96B-9B62-40AB-BDC7-5A4AF26006C7"></sequenceFlow>
<exclusiveGateway id="sid-09FF868F-2C99-4DBE-8CDD-889004C1BEF3"></exclusiveGateway>
<sequenceFlow id="sid-8CC3E840-340B-4C2F-A3C6-2335D8252263" sourceRef="sid-951EC96B-9B62-40AB-BDC7-5A4AF26006C7" targetRef="sid-09FF868F-2C99-4DBE-8CDD-889004C1BEF3"></sequenceFlow>
<sequenceFlow id="sid-4482175A-7EA6-45CC-B408-1538F0645C76" sourceRef="sid-09FF868F-2C99-4DBE-8CDD-889004C1BEF3" targetRef="sid-AAE3C15A-59B6-407A-8056-B023A314EC79">
<conditionExpression xsi:type="tFormalExpression"><![CDATA[${myData > 10}]]></conditionExpression>
</sequenceFlow>
<sequenceFlow id="sid-DDEBC2C4-6FA1-4735-A057-2518AFCBA74F" sourceRef="sid-09FF868F-2C99-4DBE-8CDD-889004C1BEF3" targetRef="sid-400C3B70-2EF6-4D02-9969-23843FDAA469">
<conditionExpression xsi:type="tFormalExpression"><![CDATA[${myData < 5}]]></conditionExpression>
</sequenceFlow>
<userTask id="sid-83CF4D09-6A19-4BF6-AE86-E864C22F025B" name="Manual Decision"></userTask>
<sequenceFlow id="sid-039F618B-5AF0-4EF3-B767-645D71F5B62A" sourceRef="sid-09FF868F-2C99-4DBE-8CDD-889004C1BEF3" targetRef="sid-83CF4D09-6A19-4BF6-AE86-E864C22F025B"></sequenceFlow>
<serviceTask id="sid-AAE3C15A-59B6-407A-8056-B023A314EC79" name="Approved"></serviceTask>
<serviceTask id="sid-400C3B70-2EF6-4D02-9969-23843FDAA469" name="Rejected"></serviceTask>
<endEvent id="sid-5F3607EC-686B-48F8-B0EC-0F90B8438BE9"></endEvent>
<sequenceFlow id="sid-B3D59E93-FDBE-4A0C-887E-81FD92D5037B" sourceRef="sid-83CF4D09-6A19-4BF6-AE86-E864C22F025B" targetRef="sid-5F3607EC-686B-48F8-B0EC-0F90B8438BE9"></sequenceFlow>
<sequenceFlow id="sid-AB0526DA-A9E2-457E-973E-25A0FF553870" sourceRef="sid-AAE3C15A-59B6-407A-8056-B023A314EC79" targetRef="sid-5F3607EC-686B-48F8-B0EC-0F90B8438BE9"></sequenceFlow>
<sequenceFlow id="sid-935E059C-F283-42C8-876A-74161CA259AB" sourceRef="sid-400C3B70-2EF6-4D02-9969-23843FDAA469" targetRef="sid-5F3607EC-686B-48F8-B0EC-0F90B8438BE9"></sequenceFlow>
</process>
<bpmndi:BPMNDiagram id="BPMNDiagram_test">
<bpmndi:BPMNPlane bpmnElement="test" id="BPMNPlane_test">
<bpmndi:BPMNShape bpmnElement="sid-07D7C090-EAFB-438C-8546-6856CF8304E3" id="BPMNShape_sid-07D7C090-EAFB-438C-8546-6856CF8304E3">
<omgdc:Bounds height="30.0" width="30.0" x="457.5" y="5.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="sid-951EC96B-9B62-40AB-BDC7-5A4AF26006C7" id="BPMNShape_sid-951EC96B-9B62-40AB-BDC7-5A4AF26006C7">
<omgdc:Bounds height="41.0" width="126.0" x="409.5" y="75.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="sid-09FF868F-2C99-4DBE-8CDD-889004C1BEF3" id="BPMNShape_sid-09FF868F-2C99-4DBE-8CDD-889004C1BEF3">
<omgdc:Bounds height="40.0" width="40.0" x="452.5" y="150.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="sid-83CF4D09-6A19-4BF6-AE86-E864C22F025B" id="BPMNShape_sid-83CF4D09-6A19-4BF6-AE86-E864C22F025B">
<omgdc:Bounds height="40.0" width="99.0" x="423.0" y="240.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="sid-AAE3C15A-59B6-407A-8056-B023A314EC79" id="BPMNShape_sid-AAE3C15A-59B6-407A-8056-B023A314EC79">
<omgdc:Bounds height="40.0" width="97.0" x="240.0" y="150.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="sid-400C3B70-2EF6-4D02-9969-23843FDAA469" id="BPMNShape_sid-400C3B70-2EF6-4D02-9969-23843FDAA469">
<omgdc:Bounds height="40.0" width="99.0" x="615.0" y="150.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="sid-5F3607EC-686B-48F8-B0EC-0F90B8438BE9" id="BPMNShape_sid-5F3607EC-686B-48F8-B0EC-0F90B8438BE9">
<omgdc:Bounds height="28.0" width="28.0" x="458.5" y="345.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge bpmnElement="sid-039F618B-5AF0-4EF3-B767-645D71F5B62A" id="BPMNEdge_sid-039F618B-5AF0-4EF3-B767-645D71F5B62A">
<omgdi:waypoint x="472.89325842696627" y="189.6067415730337"></omgdi:waypoint>
<omgdi:waypoint x="472.6117318435754" y="240.0"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="sid-DDEBC2C4-6FA1-4735-A057-2518AFCBA74F" id="BPMNEdge_sid-DDEBC2C4-6FA1-4735-A057-2518AFCBA74F">
<omgdi:waypoint x="492.0497382198953" y="170.4502617801047"></omgdi:waypoint>
<omgdi:waypoint x="615.0" y="170.12924281984334"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="sid-AB0526DA-A9E2-457E-973E-25A0FF553870" id="BPMNEdge_sid-AB0526DA-A9E2-457E-973E-25A0FF553870">
<omgdi:waypoint x="288.5" y="190.0"></omgdi:waypoint>
<omgdi:waypoint x="288.5" y="359.0"></omgdi:waypoint>
<omgdi:waypoint x="458.5" y="359.0"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="sid-935E059C-F283-42C8-876A-74161CA259AB" id="BPMNEdge_sid-935E059C-F283-42C8-876A-74161CA259AB">
<omgdi:waypoint x="664.5" y="190.0"></omgdi:waypoint>
<omgdi:waypoint x="664.5" y="359.0"></omgdi:waypoint>
<omgdi:waypoint x="486.5" y="359.0"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="sid-4482175A-7EA6-45CC-B408-1538F0645C76" id="BPMNEdge_sid-4482175A-7EA6-45CC-B408-1538F0645C76">
<omgdi:waypoint x="452.94565217391306" y="170.44565217391303"></omgdi:waypoint>
<omgdi:waypoint x="337.0" y="170.13143631436316"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="sid-8CC3E840-340B-4C2F-A3C6-2335D8252263" id="BPMNEdge_sid-8CC3E840-340B-4C2F-A3C6-2335D8252263">
<omgdi:waypoint x="472.63666666666666" y="116.0"></omgdi:waypoint>
<omgdi:waypoint x="472.86577181208054" y="150.36577181208054"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="sid-FFBC76AE-8BC4-4B5A-A3DE-EDAC55F96F21" id="BPMNEdge_sid-FFBC76AE-8BC4-4B5A-A3DE-EDAC55F96F21">
<omgdi:waypoint x="472.5" y="35.0"></omgdi:waypoint>
<omgdi:waypoint x="472.5" y="75.0"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="sid-B3D59E93-FDBE-4A0C-887E-81FD92D5037B" id="BPMNEdge_sid-B3D59E93-FDBE-4A0C-887E-81FD92D5037B">
<omgdi:waypoint x="472.5" y="280.0"></omgdi:waypoint>
<omgdi:waypoint x="472.5" y="345.0"></omgdi:waypoint>
</bpmndi:BPMNEdge>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
</definitions>

Thanks & Regards

Vigneswaran

1 REPLY 1

mdtabrezmca
Star Contributor
Star Contributor

For your senario you can try business rule and decision tables have a look at this post if it is useful.

https://community.alfresco.com/community/bpm/blog/2017/08/23/dmn-decision-tables-101