-
1. Re: (NOTE: In JBPM 3.2)Decison nodes - tricky - help req
ygiriyap Apr 5, 2007 11:24 PM (in response to ygiriyap)Not able to get the decision node work based on the static values either.
In the following case ... always the first transition is taken !!!<decision name="DN_P1CompareP2"> <transition name="TN_P1LesserP2" to="TN_P1LesserP2"> <condition><![CDATA[#{2 < 1}]]></condition> </transition> <transition name="TN_P1GreaterP2" to="TN_P1GreaterP2"> <condition><![CDATA[#{2 > 1}]]></condition> </transition> <transition name="TN_P1EqualsP2" to="TN_P1CompareP2Else"> </transition> </decision>
Any pointers pls.
Thanks,
--Yash -
2. Re: (NOTE: In JBPM 3.2)Decison nodes - trivial issues - help
ygiriyap Apr 6, 2007 4:10 AM (in response to ygiriyap)Could someone help me out here.Have spent quite sometime on this.!!!
This seems to be a minor issue.
Any pointers??
Thanks for your time.
--Yash -
3. Re: (NOTE: In JBPM 3.2)Decison nodes - trivial issues - help
koen.aers Apr 6, 2007 4:48 AM (in response to ygiriyap)Yash,
Did you try something like this?<condition expression="#{P1 > P2}"/>
I am not sure about this, would have to check the source code, but I think the EL evaluation is not used on the text contents of the condition element. I think it is using beanshell instead in that case.
Cheers,
Koen -
4. Re: (NOTE: In JBPM 3.2)Decison nodes - trivial issues - help
ygiriyap Apr 6, 2007 9:23 AM (in response to ygiriyap)This works for me.
<decision name="DN_P1CompareP2" expression='#{ ( P1 > P2 ) ? "TN_P1GreaterP2" : "TN_P1CompareP2Else" }'> <transition name="TN_P1GreaterP2" to="TN_P1GreaterP2"></transition> <transition name="TN_P1CompareP2Else" to="TN_P1CompareP2Else"> </decision>
But,my requirement is a decision node with 3 conditions.So I cant do this way.
I want to mention the condition as the part of transition.
Pls provide some pointers.
Thanks for the reply,Koen.
--Yash -
5. Re: (NOTE: In JBPM 3.2)Decison nodes - trivial issues - help
brittm Apr 6, 2007 12:08 PM (in response to ygiriyap)The third transition will never be taken because it has no condition to verify--that's just how the system works (if there are no conditions that evaluate to true, the default (first) transition will be taken).
Try removing the CDATA tags and using a character representation for '>' and '<'. What are those, > and < I think.
-Britt -
6. Re: (NOTE: In JBPM 3.2)Decison nodes - trivial issues - help
koen.aers Apr 6, 2007 1:31 PM (in response to ygiriyap)Yash,
You can also use the 'expression' attribute on the embedded condition within a transition element. I think that should work.
Regards,
Koen -
7. Re: (NOTE: In JBPM 3.2)Decison nodes - trivial issues - help
ygiriyap Apr 10, 2007 5:01 AM (in response to ygiriyap)Thanks for your time guys.
Let me make my query clear ...
Have a decision node like below ...<decision name="DN_P1CompareP2"> <transition name="TN_P1GreaterP2" to="TN_P1GreaterP2"> <condition>P1 > P2</condition> </transition> <transition name="TN_P1LesserP2" to="TN_P1LesserP2"> <condition>P1 < P2</condition> </transition> </decision>
I will provide values as P1=11 and P2=12
So P1 < P2.Hence 2nd transition should be taken.
But it always takes the first transition.
Pls let me know ...
How to write the condition tags for this simple use case??
Many thanks for your time.
--Yash -
8. Re: (NOTE: In JBPM 3.2)Decison nodes - trivial issues - help
ygiriyap Apr 10, 2007 5:04 AM (in response to ygiriyap)Meanwhile I have tried to use expression,CDATA and other options.
Nothing has worked for me !!!
This should be a trivial matter I suppose.I am not able to make where I am going wrong.
Thank you.
--Yash -
9. Re: (NOTE: In JBPM 3.2)Decison nodes - trivial issues - help
estaub Apr 10, 2007 7:57 AM (in response to ygiriyap)(You probably showed the encoding, and it got translated in posting, but...) Did you use < (ampersand l t semicolon) for less than and > (ampersand g t semicolon) for greater than?
Otherwise, it's not valid XML.
I really wonder whether taking the first transition when none match is the best default in most cases. I think most authors would probably prefer to explicitly describe the transition to be taken for all cases. If none of them are met, it's an exception!
-Ed Staub
FORUM MASTERS: It looks like you lose spelled-out character entities when you go through "Preview" in the forum. If you don't preview, they're left verbatim, but they're converted to single characters when the editing form is filled in. -
10. Re: (NOTE: In JBPM 3.2)Decison nodes - trivial issues - help
ygiriyap Apr 10, 2007 11:07 AM (in response to ygiriyap)Hi estaub,
Tried that as well.!! No better.
I tried the following code. Didnt work.<decision name="DN_P1CompareP2"> <transition name="TN_P1GreaterP2" to="TN_P1GreaterP2"> <condition expression="#{P1 > P2}"></condition> </transition> <transition name="TN_P1LesserP2" to="TN_P1LesserP2"> <condition expression="#{P1 < P2}"></condition> </transition> </decision>
Has it worked for you?Could you pls let me know how exactly to write these lines.1. <condition>P1 > P2</condition> 2. <condition>P1 < P2</condition> 3. <condition>P1 == P2</condition>
Many thanks for your time and help,
--Yash -
11. Re: (NOTE: In JBPM 3.2)Decison nodes - trivial issues - help
marka4 Apr 10, 2007 4:57 PM (in response to ygiriyap)You may be aware of this already, but another thought here if your conditions don't seem to be doing anything... Look here: http://jira.jboss.com/jira/browse/JBPM-854
org.jbpm.graph.node.Decision is broken in 3.2. We had processes that were totally ignoring all conditions after we upgraded to 3.2. 3.2 was trying to load conditions from the old JBPM_DECISIONCONDITION table (they're not there anymore) instead of the new DECISION_ column in table JBPM_TRANSITIONS. Compiling the new Decision.java from the 3.2.1 source fixed it. -
12. Re: (NOTE: In JBPM 3.2)Decison nodes - trivial issues - help
ygiriyap Apr 11, 2007 3:09 AM (in response to ygiriyap)Hey MarkA4 ... Thanks.
Coooolll !! Took the Decision.java class from 3.2.1 version and it works now.
Many thanks to those you took time to reply and help.
--Yash