Using Drools for jBPM decision
turpin_vincent Mar 11, 2009 5:17 PMHi,
I'm starting to use Seam and i've got some problems using Drools in order to manage decisions in my process and nobody is able to help me on Seam forum.
Configuration Jboss 5.0.0 GA Seam 2.1.1 GA Ant 1.7 Jboss Tool Eclipse 3.4
When i use Drools to manage assignment, it works fine, but now i would like to use it for decison managment and i got this error:
Exception during request processing:
Caused by javax.el.ELException with message: "org.jbpm.JbpmException: decision 'decision69' selected non existing transition 'null'"
I give you a part of my code but if something else is needed tell me.
Process:
<task-node name="PlaceOrder"> <task name="placeOrderTask"> <assignment class="org.jboss.seam.drools.DroolsAssignmentHandler"> <workingMemoryName>securityRulesWorkingMemory</workingMemoryName> <assertObjects> <element>#{orderStock}</element> </assertObjects> </assignment> </task> <transition name="cancel" to="error" /> <transition to="decision69" name="todecision"></transition> </task-node> <decision name="decision69"> <handler class="org.jboss.seam.drools.DroolsDecisionHandler"> <workingMemoryName>accountApprovalWorkingMemory</workingMemoryName> <assertObjects> <element>#{actor}</element> <element>#{orderStock}</element> </assertObjects> </handler> <transition to="Deliver" name="toDeliver"> <action class="org.jboss.seam.drools.DroolsActionHandler"> <workingMemoryName>accountApprovalWorkingMemory</workingMemoryName> <assertObjects> <element>#{actor}</element> <element>#{orderStock}</element> </assertObjects> </action > </transition> <transition to="end" name="toend"></transition> </decision> <task-node name="Deliver"> <task name="getFromStock"> <assignment actor-id="#{actor.id}" /> </task> <transition name="next" to="end" /> <transition name="cancel" to="error" /> </task-node>
Component.xml:
<persistence:managed-persistence-context name="entityManager" auto-create="true" entity-manager-factory="#{testEntityManagerFactory}"/> <persistence:entity-manager-factory name="testEntityManagerFactory" persistence-unit-name="test"/> <drools:rule-base name="securityRules"> <drools:rule-files><value>/security.drl</value></drools:rule-files> </drools:rule-base> <drools:managed-working-memory name="securityRulesWorkingMemory" auto-create="true" rule-base="#{securityRules}"/> <security:rule-based-permission-resolver security-rules="#{securityRules}"/> <drools:rule-base name="accountApprovalRules"> <drools:rule-files> <value>/accountApproval.drl</value> </drools:rule-files> </drools:rule-base> <drools:managed-working-memory name="accountApprovalWorkingMemory" auto-create="true" rule-base="#{accountApprovalRules}"/>
AccountAproval.drl:
package AccountApproval; import org.jboss.seam.bpm.Actor; import org.domain.test.session.OrderStock; import org.jboss.seam.drools.Decision; global Decision decision rule "Approve Order For Loyal Customer" when OrderStock ( processQuantity >= 0 ) then System.out.println("plooooooooooop"); decision.setOutcome("toDeliver"); end
So i would like to know if someone can tell me why it happends.
thank's in advance
And i'm sorry for my english witch isn't as fine sa i would like (I'm a french student)