[jboss-user] [jBPM] - Re: why to use drools rules and not Java code?

HUI LIU do-not-reply at jboss.com
Tue Jan 18 05:35:49 EST 2011

HUI LIU [http://community.jboss.org/people/brianlh] created the discussion

"Re: why to use drools rules and not Java code?"

To view the discussion, visit: http://community.jboss.org/message/581512#581512

In fact, in the source code of krisv-jbpm, I find the test code about Java constraint and MVEL(rule) constraint in jbpm-flow-build/src/test/java/org/jbpm/integrationtests/processSplitTest.java, in this file, there is no difference between MVEL constraint and java constraint, see 
public void testSplitWithMVELContextConstraint() and 
public void testSplitWithJavaContextConstraint()
the two kinds of constraints are the same:
in the first function:
<constraint toNodeId="6" toType="DROOLS_DEFAULT" priority="1" type="code" dialect="*mvel*" >return context.getVariable("name") != null &amp;&amp; ((String) context.getVariable("name")).length() > 0;</constraint>
in the second function:
<constraint toNodeId="6" toType="DROOLS_DEFAULT" priority="1" type="code" dialect="*java*" >return context.getVariable("name") != null &amp;&amp; ((String) context.getVariable("name")).length() > 0;</constraint>

I don't know why?

By the way, in this test case file, there is also the comparison between context and kcontext, I don't know their difference and in the testcase file, their only difference is their name. Can you explain it?


Reply to this message by going to Community

Start a new discussion in jBPM at Community

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20110118/9bb4fadd/attachment-0001.html 

More information about the jboss-user mailing list