cancel
Showing results for 
Search instead for 
Did you mean: 

Decision Handling Java class for Exclusive Gateway

sushantmahajan
Champ in-the-making
Champ in-the-making
Hi All,

What can be the bpmn xml equivalent for the jbpm xml  snippet below??

<decision g="182,1101,80,40" name="is-retry-required">
      <handler
         class="com.test.DecisionEvaluator" />
      <transition g="-26,-22" name="yes" to="Validate_Document_Module" />
      <transition g="-21,-22" name="no" to="Export_Module" />
   </decision>



I have tried doing it in activiti with something like

<serviceTask id='retryDecision' name='retryDecision'
         activiti:expression="#{DecisionEvaluator.retryEvaluation()}"
         activiti:resultVariable="retryRequired" />
      <sequenceFlow id="flow4" sourceRef="retryDecision"
         targetRef="is-retry-required" />
      <exclusiveGateway id="is-retry-required" name="is-retry-required"></exclusiveGateway>
      <sequenceFlow targetRef="Retry"
         sourceRef="is-retry-required">
         <conditionExpression xsi:type="tFormalExpression">${retryRequired=='yes'}
         </conditionExpression>
      </sequenceFlow>
      <sequenceFlow targetRef="End" sourceRef="is-retry-required">
         <conditionExpression xsi:type="tFormalExpression">${retryRequired=='no'}
         </conditionExpression>
      </sequenceFlow>

where "DecisionEvaluator" is class with a method "retryEvaluation" that returns either a "Yes" or "No" string.

Though the above code solves my purpose, but is too cumbersome and also there is an additional overhead of adding a few more steps in the workflow, which i am hesitant about.
1 REPLY 1

trademak
Star Contributor
Star Contributor
Hi Sushant,

Good point, but your solution is indeed the correct way to handle this use case in BPMN. In the future we could add a custom gateway that does it in a similar way like in jBPM, but it will not be standard BPMN in that case.

Best regards,