4 Replies Latest reply on Oct 9, 2011 8:51 AM by v.g

    How to implement conditional flows

    v.g

      Hi all

       

      I am learning jBPM and I am using the BPMN2 editor tentative release taken from:

      http://download.eclipse.org/bpmn2-modeler/site

       

      I am trying to implement a conditional flow, so I added a Xor gateway and two outogoing sequence flows from upper and lower corners.

      I set the gateway as diverging, but I couldn't find a way to set the constraints.

      I checked the documentation and I understood that the constraints had to be added as conditions in the outgoing flows. But neither there I could find a way to set any condition.

      I thought that this part still was not implemented, so I edited manually the bpm file adding the child to bpmn2:sequenceFlow :

       

       <conditionExpression id="flow2_condition" body="eval(! $msgs.isRequestMsgEmpty() );"/>
      

       

      But I got the error message

       

      FeatureNotFoundException: Feature 'conditionExpression' not found.
      

       

      Is there something I am doing wrong or is it something still to be implemented ?

      In the second case where I can find some bpmn2 sample files ?

       

      Thanks

       

      Vincenzo

        • 1. Re: How to implement conditional flows
          tsurdilovic

          Hi Vincenzo, the new BPMN2 Editor for Eclipse is still in it's early stages and I would recommend to use the existing Rule-Flow editor which get's installed if you are using the jBPM installer and/or the jBPM Web Designer which also gets installer for you by the jBPM installer. The Eclipse Rule-Flow editor is currently the most stable followed by the web designer, but both feature-wise and stability-wise are currently better.

           

          Hope this helps.

          • 2. Re: How to implement conditional flows
            v.g

            Actually Tihomir I wanted to prepare for the future. I hope flows defined in BPMN2 will replace rule-flows, so I was thinking about integration projects where you edit  rules java code and processes in the same IDE.

             

            For the moment I thought that editing manually the files would have allowed to compensate for what still is not implemented.

            But actually I didn't understand whethe I got the error message because the xml is wrong or because I have the wrong jars in the classpath or other reasons.

            • 3. Re: How to implement conditional flows
              tsurdilovic

              You can find a number of examples here: https://github.com/droolsjbpm/jbpm/tree/master/jbpm-bpmn2/src/test/resources.

              Take a look at BPMN2-ExclusiveSplit.bpmn2 to see an example of a conditionalExpression in sequenceFlow.

               

              Hope this helps.

              • 4. Re: How to implement conditional flows
                v.g

                Thanks Tihomir those process samples are a good starting point.

                I solved the error when I found out that the tag "conditionExpression" is correct, but the condition in in the text of the node, not in an attribute named body.