taskService.complete ends the workflow

When I complete a task (taskService.complete(taskId)) , with wrong variables(variables decide the next task in the workflow. this ends the processInstance…

When I set correct variables, the workflow moves to the next task correctly…

I am expecting to error when complete the task with wrong variables as it can’t decide the next task in the workflow. Instead it ends the workflow…

Please advice…

Hi,

I need a bit more details about what you are trying to do and how your process definition (BPMN XML) is implemented. Flowable doesn’t end the process instance when “wrong” variables are passed to it.

Best regards,

Tijs

I have two user tasks usertask1 and usertask2, there are more tasks in the sequence…
These two tasks are connected with the sequenceFlow with an expression as below…

 <sequenceFlow id="toUserTask1" name="Reject To UserTask1" sourceRef="usertask1" targetRef="usertask2">
  <conditionExpression xsi:type="tFormalExpression"><![CDATA[${approve == 'true' }]]></conditionExpression>
</sequenceFlow>

When I complete the userTask1 with approve=false… processInstance ends…

I was expecting taskService.completeTask errors out as the outcome can’t be determined with supplied information… Instead it completes and logs entire processintance data to history tables, the act_hi_procinst.end_act_id_ is having the “userTask1”…

Let me know if you need more info

Hi,

Having a condition on the only one outgoing sequence flow from user task 1 to user task 2 is not good. If there’s only one sequence flow it should not have any condition. If you would use an exclusive gateway and have multiple outgoing sequence flows, conditions are the way to choose the next step in the process.

Best regards,

Tijs

Say if we have two or three outgoing sequence(each having a condition) from user task1 , and when completing the user task1 if the required variables are not supplied the processinstance is ending instead of throwing error…

We can catch this exception outside of process engine, but want to know how to avoid the situation of ending the processinstance before it reaches the endpoint…

Can you share the BPMN XML so we can reproduce the issue? Let us know all steps you are performing in detail. I’m expecting something different is happening, but really have to understand all the details.

Best regards,

Tijs