I have a simple approval BPMN workflow process. I want to assign the outcome (data output?) from a user task ("Approve") to a process variable that is then used in the exclusive gateway following that user task. The user task outcome is set within Java in a data/variables map when completing the task. Whatever I tried and searched, I could not get it to work. I keep getting the error "XOR split could not find at least one valid outgoing connection for split Approved?". Can someone please help?
I've tried specifying an with and a and much more.
My BPMN source:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL"
xmlns:ns2="http://www.omg.org/spec/DD/20100524/DI"
xmlns:ns3="http://www.omg.org/spec/DD/20100524/DC"
xmlns:ns4="http://www.omg.org/spec/BPMN/20100524/DI"
targetNamespace="http://www.omg.org/bpmn20">
<itemDefinition id="_approval" isCollection="false" structureRef="java.lang.Boolean"/>
<process id="modelio-approval"
name="Process"
isClosed="false"
processType="None">
<property id="approval" name="approval" itemSubjectRef="_approval"/>
<startEvent id="StartId"
name="Start"
isInterrupting="true"
parallelMultiple="false">
<outgoing>FromStartToApprove</outgoing>
</startEvent>
<sequenceFlow id="FromStartToApprove"
name="FromStartToApprove"
sourceRef="StartId"
targetRef="ApproveId"/>
<userTask id="ApproveId"
name="Approve"
isForCompensation="false"
startQuantity="1"
completionQuantity="1">
<incoming>FromStartToApprove</incoming>
<outgoing>ToApprovedGateway</outgoing>
<ioSpecification>
<dataOutput id="approvalOutRef" itemSubjectRef="_approval" name="approvalOut"/>
<outputSet id="OutputSet_1">
<dataOutputRefs>approvalOutRef</dataOutputRefs>
</outputSet>
</ioSpecification>
<dataOutputAssociation id="doAssIdApproval">
<sourceRef>approvalOutRef</sourceRef>
<targetRef>approval</targetRef>
</dataOutputAssociation>
</userTask>
<sequenceFlow id="ToApprovedGateway"
name="ToApprovedGateway"
sourceRef="ApproveId"
targetRef="ApprovedGateway"/>
<exclusiveGateway id="ApprovedGateway"
name="Approved?"
gatewayDirection="Diverging">
<incoming>ToApprovedGateway</incoming>
<outgoing>ToFinish</outgoing>
<outgoing>ToDisapproved</outgoing>
</exclusiveGateway>
<sequenceFlow id="ToFinish"
name="ToFinish"
sourceRef="ApprovedGateway"
targetRef="FinishId">
<conditionExpression>approval == true</conditionExpression>
</sequenceFlow>
<sequenceFlow id="ToDisapproved"
name="disapproved"
sourceRef="ApprovedGateway"
targetRef="DisapprovedId">
<conditionExpression>approval == false</conditionExpression>
</sequenceFlow>
<userTask id="FinishId"
name="Finish"
isForCompensation="false"
startQuantity="1"
completionQuantity="1">
<incoming>ToFinish</incoming>
<outgoing>ToEnd</outgoing>
</userTask>
<sequenceFlow sourceRef="FinishId"
targetRef="EndId"
name="ToEnd"
id="ToEnd"/>
<endEvent id="EndId" name="End">
<incoming>ToEnd</incoming>
</endEvent>
<endEvent id="DisapprovedId" name="Disapproved">
<incoming>ToDisapproved</incoming>
</endEvent>
</process>
</definitions>
In the Java code, I try to set the task "approval" data on the "Approval" user task like this:
Map<String, Object> data = new HashMap(1);
data.put("approvalOut", true);
taskService.complete(taskId, userId, data);
But always the error message is:
Error: [modelio-approval:25 - Approved?:6] -- XOR split could not find at least one valid outgoing connection for split Approved?
I expect the flow to go to the "Finish" task (sequenceFlow "ToFinish"), but get the error "XOR split could not find at least one valid outgoing connection for split Approved?".
Should I perhaps use data input instead of output? What does taskService.complete(taskId, userId, data);
actually set? Unfortunately there is no Javadoc.