cancel
Showing results for 
Search instead for 
Did you mean: 

Multiple Flow Conditions

spille
Champ in-the-making
Champ in-the-making
Hi,

I'm having some trouble with the flow condition of a sequence flow.
I'm using the follwing EL Expressions: ${library == 'BIB' or library == 'BOB'}
Unfortunately this expression does not work.

It works fine if I only ask for one thing like ${library == 'BIB'}

Has anyone had this problem before? Or can anyone tell me what i'm doing wrong?

thanks in advance,

Greetings,

Spille
6 REPLIES 6

one87
Champ in-the-making
Champ in-the-making
Have you tried || instead of or?

spille
Champ in-the-making
Champ in-the-making
Yes, tried that… I tried a few possibilities like:
"${library == 'BIB'} or ${library == 'BOB'}"

${library == 'BIB'} or ${library == 'BOB'}

${library == 'BIB'} || ${library == 'BOB'}

${library == 'BIB' || library == 'BOB'}

martin_grofcik
Confirmed Champ
Confirmed Champ
Hi,
I tested it with the exclusive gateway and following expression:


    <sequenceFlow id="flow3" sourceRef="exclusiveGw" targetRef="theTask2">
      <conditionExpression xsi:type="tFormalExpression">${input == '2' or input == '5'}</conditionExpression>
    </sequenceFlow>   

Test passed.

Regards
Martin

spille
Champ in-the-making
Champ in-the-making
Thanks Martin! Now it works here as well Smiley Tongue

cheers,

Spille

spille
Champ in-the-making
Champ in-the-making
Oké,

Sometimes it works, sometimes it doesn't work. But I found the problem.

I define a "default flow" and a "conditional flow".
I use the activiti modeller. It seems to be deploying  a different bpmn.xml with the same model.
Sometimes the "default flow" is put after the "conditional flow" –> then it works
Sometimes the "default flow" is put in front of the "conditional flow" –> then it does not works (because it passes through the default flow without checking the conditional flow)

Any thoughts on this? I can now fix this by editing the XML-file, but it would be nice if i knew how to do this is the modeller.

cheers,

Spille

martin_grofcik
Confirmed Champ
Confirmed Champ
Hi Spille.

I have changed jUnit test org.activiti.engine.test.bpmn.gateway.ExclusiveGatewayTest#testDefaultSequenceFlow little bit according your description.

    <exclusiveGateway id="exclusiveGw" name="Exclusive Gateway" default="flow3" />
    <sequenceFlow id="flow3" sourceRef="exclusiveGw" targetRef="theTask2"/>
    <sequenceFlow id="flow2" sourceRef="exclusiveGw" targetRef="theTask1">
      <conditionExpression xsi:type="tFormalExpression">${input == 1}</conditionExpression>
    </sequenceFlow>
    <sequenceFlow id="flow4" sourceRef="exclusiveGw" targetRef="theTask3">
      <conditionExpression xsi:type="tFormalExpression">${input == 3}</conditionExpression>
    </sequenceFlow>
It has passed.

Regards
Martin