Hey @manhld,
Why are you using cancel events for this instead of error?
The Cancel events work together with Compensation. This is meant to work cross transactions. I have not tried your example, but I believe that the problem you are seeing is there because you try to do this within the same transaction.
Can you perhaps share the BPMN XML so we can try it out?
Cheers,
Filip
1 Like
Thanks for your reply @filiphr ,
As the figure shows, in the sub-process I want to catch two separate events, one for the update request event, one for the approval event corresponding to each gateway. I want to catch these events to navigate using the corresponding boundary events. Seems a bit difficult for a newbie like me to approach. You can edit on my bpmn file.
<?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:flowable="http://flowable.org/bpmn" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:omgdc="http://www.omg.org/spec/DD/20100524/DC" xmlns:omgdi="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.flowable.org/processdef">
<process id="examples-key" name="examples" isExecutable="true">
<documentation>manhld</documentation>
<userTask id="create_abnormal" name="Fill in the information" flowable:candidateUsers="${users}" flowable:formFieldValidation="true"></userTask>
<startEvent id="start" name="Start" flowable:formFieldValidation="true"></startEvent>
<endEvent id="end_rejected" name="Rejected"></endEvent>
<endEvent id="end" name="End"></endEvent>
<transaction id="sid-01A5B491-3696-41AE-B31D-5A1B4FD46A85" name="subProcess">
<startEvent id="sid-2E8C0919-7186-4DFC-BB63-25FBADFBDCC6" name="Start subprocess" flowable:formFieldValidation="true"></startEvent>
<userTask id="sid-92E9CEE6-585C-49E8-8B1A-F3F97ABD5D91" name="Check information" flowable:candidateUsers="${users}" flowable:formFieldValidation="true">
</userTask>
<exclusiveGateway id="sid-6E808086-3BA8-4A72-9915-66024AED7F7F" name="Update?"></exclusiveGateway>
<exclusiveGateway id="sid-21CD9C94-CD12-4A32-BA43-7D86D1136CF4" name="Approve?"></exclusiveGateway>
<endEvent id="sid-ADF00E55-67C6-4B60-A3BE-B81EB9E656A6" name="End subprocess"></endEvent>
<endEvent id="sid-142AE469-6E03-4441-9933-6FAAA952D0BA" name="Reject">
<cancelEventDefinition></cancelEventDefinition>
</endEvent>
<endEvent id="sid-9F5FF34A-3205-46C5-B90B-D6F490956A61" name="Request update">
<errorEventDefinition></errorEventDefinition>
</endEvent>
<sequenceFlow id="sid-AFAA3100-D4B2-4F1A-B20C-4482EB2A0AFA" sourceRef="sid-2E8C0919-7186-4DFC-BB63-25FBADFBDCC6" targetRef="sid-92E9CEE6-585C-49E8-8B1A-F3F97ABD5D91"></sequenceFlow>
<sequenceFlow id="sid-F02E060F-6A94-4CD6-B1DE-CDB65509BBDE" sourceRef="sid-92E9CEE6-585C-49E8-8B1A-F3F97ABD5D91" targetRef="sid-6E808086-3BA8-4A72-9915-66024AED7F7F"></sequenceFlow>
<sequenceFlow id="sid-F5DD5D6F-6818-4975-9C9C-6E2AD3DE142F" name="No" sourceRef="sid-6E808086-3BA8-4A72-9915-66024AED7F7F" targetRef="sid-21CD9C94-CD12-4A32-BA43-7D86D1136CF4">
<conditionExpression xsi:type="tFormalExpression"><![CDATA[${!isRequestUpdated}]]></conditionExpression>
</sequenceFlow>
<sequenceFlow id="sid-58385E24-F684-40ED-8726-01D36B1714F9" name="Yes" sourceRef="sid-6E808086-3BA8-4A72-9915-66024AED7F7F" targetRef="sid-9F5FF34A-3205-46C5-B90B-D6F490956A61">
<conditionExpression xsi:type="tFormalExpression"><![CDATA[${isRequestUpdated}]]></conditionExpression>
</sequenceFlow>
<sequenceFlow id="sid-252E7F6A-54D6-4988-9369-1183AB1636D9" name="Yes" sourceRef="sid-21CD9C94-CD12-4A32-BA43-7D86D1136CF4" targetRef="sid-ADF00E55-67C6-4B60-A3BE-B81EB9E656A6">
<conditionExpression xsi:type="tFormalExpression"><![CDATA[${isApproved}]]></conditionExpression>
</sequenceFlow>
<sequenceFlow id="sid-87C771F6-F07A-4AB3-A3A3-02D2A7144914" name="No" sourceRef="sid-21CD9C94-CD12-4A32-BA43-7D86D1136CF4" targetRef="sid-142AE469-6E03-4441-9933-6FAAA952D0BA">
<conditionExpression xsi:type="tFormalExpression"><![CDATA[${!isApproved}]]></conditionExpression>
</sequenceFlow>
</transaction >
<boundaryEvent id="request_update_boundary" attachedToRef="sid-01A5B491-3696-41AE-B31D-5A1B4FD46A85">
<errorEventDefinition></errorEventDefinition>
</boundaryEvent>
<sequenceFlow id="sid-B2643F24-FD20-4388-9BE9-967DD8B6A7B9" name="Request update" sourceRef="request_update_boundary" targetRef="create_abnormal"></sequenceFlow>
<boundaryEvent id="reject_boundary" attachedToRef="sid-01A5B491-3696-41AE-B31D-5A1B4FD46A85" cancelActivity="true">
<cancelEventDefinition></cancelEventDefinition>
</boundaryEvent>
<sequenceFlow id="sid-E4981A67-FDD4-48DE-9ED4-F8DBF642A37E" sourceRef="reject_boundary" targetRef="end_rejected"></sequenceFlow>
<sequenceFlow id="sid-49E03E44-9417-481F-8FEF-C2E3BC309D49" sourceRef="sid-01A5B491-3696-41AE-B31D-5A1B4FD46A85" targetRef="end"></sequenceFlow>
<sequenceFlow id="s2" sourceRef="create_abnormal" targetRef="sid-01A5B491-3696-41AE-B31D-5A1B4FD46A85"></sequenceFlow>
<sequenceFlow id="s1" sourceRef="start" targetRef="sid-01A5B522-3696-41AE-B31D-5A1B4FD46A85"></sequenceFlow>
</process>
</definitions>