-
1. Re: JBPM variable
swiderski.maciej Sep 16, 2014 12:25 PM (in response to kojot)1 of 1 people found this helpfuldepending if you use eclpise molder or web designer:
- eclipse - double click on gateway to specify conditions on out going sequence flows
- web designer - select outgoing sequence flow and then specify condition via properties panel on right hand side
HTH
-
2. Re: JBPM variable
kojot Sep 17, 2014 4:53 AM (in response to swiderski.maciej)I use web designer.
In condition expression, just type in if(variable1 == variable2)? -
3. Re: JBPM variable
salaboy21 Sep 17, 2014 7:32 AM (in response to kojot)In the web designer if I don't remember wrong you need to select Java expression and then add something like:
return (variable1 == variable2);
of course that it depends on the type of the variables.. if variable1 and variable2 are ints that will work.
Regards
-
4. Re: JBPM variable
kojot Sep 18, 2014 6:29 AM (in response to salaboy21)I have 2 integer variable, "count2" and "stop".
in the first outgoing sequence flow i have return(count2 == stop)in the second outgoing sequence flow i have return(count2 != stop)
and not working.
My problem is, that the process always passes through "in the second outgoing sequence flow", despite that count2=5 and stop=5
-
5. Re: JBPM variable
salaboy21 Sep 18, 2014 6:12 AM (in response to kojot)can you paste the error so we can see what is going on?
If you don't elaborate more and share that is going on it is too difficult to help you.
-
6. Re: JBPM variable
kojot Sep 18, 2014 7:11 AM (in response to salaboy21)My problem is, that the process always passes through "in the second outgoing sequence flow", despite that count2=5 and stop=5
-
7. Re: JBPM variable
salaboy21 Sep 18, 2014 10:16 AM (in response to kojot)And if you take a look at the generated xml does it looks like this line?
-
-
9. Re: JBPM variable
salaboy21 Sep 19, 2014 4:42 AM (in response to kojot)Hi Patryk
Don't expect jBPM do something different than java in this case.
If you create an unit test with this:
Integer integer1 = new Integer(5);
Integer integer2 = new Integer(5);
Assert.assertTrue(integer1 == integer2);
It will fail for sure.. because the two Integers are objects..
That's why I've asked if you have "int"s and not Integers
If you change your return statements to use the equals method it should work:
Assert.assertTrue(integer1.equals(integer2));
-
10. Re: JBPM variable
kojot Sep 19, 2014 5:40 AM (in response to salaboy21)I used "return count2.equals(stop);" and work good.
Thank you very much, Mauricio! -
11. Re: JBPM variable
salaboy21 Sep 19, 2014 5:40 AM (in response to kojot)Yes, please don't forget that jBPM is pure java.. so follow the same rules than java for handling and comparing variables.
Regards