7 Replies Latest reply on Jul 21, 2009 1:56 AM by Ronald van Kuijk

    SEAM 2.1.1 DROOLS 5

    Philippe Aubertin Newbie

      Hi,
      I am trying to work with drools 5 BRMS (RC1) and SEAM 2.1.1.
      I want use JBPM with rules from the BRMS.
      Here is my process:


           <task-node name="PlaceOrder">
                <task name="placeOrderTask">
                     <assignment class="org.jboss.seam.drools.DroolsAssignmentHandler">
                          <workingMemoryName>insuranceconfigWorkingMemory</workingMemoryName>
                          <assertObjects>
                               <element>#{orderStock}</element>
                          </assertObjects>
                     </assignment>
                </task>
                <transition name="next" to="Deliver" />
                <transition name="cancel" to="error" />
           </task-node>



      Here is my components.xml:


      <drools:rule-agent name="insuranceRules"
           url="http://localhost:8080/drools-guvnor/org.drools.guvnor.Guvnor/package/Permissions/LATEST"
           poll="30" />
      <drools:managed-working-memory name="insuranceconfigWorkingMemory"
           auto-create="true" rule-base="#{insuranceRules}" />
      


      Here is my rule declared in the BRMS (Guvnor):


      rule 'Approve Order For Loyal Customer'
      dialect 'mvel'
        when
              OrderStock ( processQuantity > 0 )
        then
           assignable.setActorId( "reviewers" );
      
      end




      I am not able to make it work, I guess I have some libraries problems.
      I tried to change drools libraries from SEAM with drools libraries from DROOLS 5 but I keep getting this error:


      Caused by: java.lang.NoSuchMethodError: org.drools.WorkingMemory.fireAllRules()V
           at org.jboss.seam.drools.DroolsAssignmentHandler.assign(DroolsAssignmentHandler.java:28)
           at org.jboss.seam.bpm.SeamUserCodeInterceptor$2.process(SeamUserCodeInterceptor.java:102)
           at org.jboss.seam.bpm.SeamUserCodeInterceptor$ContextualCall.run(SeamUserCodeInterceptor.java:33)
           at org.jboss.seam.bpm.SeamUserCodeInterceptor.executeAssignment(SeamUserCodeInterceptor.java:96)
           at org.jbpm.taskmgmt.exe.TaskMgmtInstance.performAssignmentDelegation(TaskMgmtInstance.java:226)
           at org.jbpm.taskmgmt.exe.TaskMgmtInstance.performAssignment(TaskMgmtInstance.java:201)
           at org.jbpm.taskmgmt.exe.TaskInstance.assign(TaskInstance.java:204)
           at org.jbpm.taskmgmt.exe.TaskMgmtInstance.createTaskInstance(TaskMgmtInstance.java:154)
           at org.jbpm.graph.node.TaskNode.execute(TaskNode.java:168)
           at org.jbpm.graph.def.Node.enter(Node.java:319)
           at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
           at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
           at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
           at java.lang.reflect.Method.invoke(Unknown Source)
           at org.hibernate.proxy.pojo.javassist.JavassistLazyInitializer.invoke(JavassistLazyInitializer.java:173)
           at org.jbpm.graph.def.Node_$$_javassist_77.enter(Node_$$_javassist_77.java)
           at org.jbpm.graph.def.Transition.take(Transition.java:151)
           at org.jbpm.graph.def.Node.leave(Node.java:394)
           at org.jbpm.graph.node.StartState.leave(StartState.java:70)
           at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
           at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
           at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
           at java.lang.reflect.Method.invoke(Unknown Source)
           at org.hibernate.proxy.pojo.javassist.JavassistLazyInitializer.invoke(JavassistLazyInitializer.java:173)
           at org.jbpm.graph.def.Node_$$_javassist_77.leave(Node_$$_javassist_77.java)
           at org.jbpm.graph.exe.Token.signal(Token.java:195)
           at org.jbpm.graph.exe.Token.signal(Token.java:140)
           at org.jbpm.graph.exe.ProcessInstance.signal(ProcessInstance.java:271)
           at org.jboss.seam.bpm.BusinessProcess.afterCreateProcess(BusinessProcess.java:161)
           at org.jboss.seam.bpm.BusinessProcess.createProcess(BusinessProcess.java:135)
           at org.jboss.seam.bpm.BusinessProcess.createProcess(BusinessProcess.java:123)
           at org.jboss.seam.bpm.BusinessProcessInterceptor.afterInvocation(BusinessProcessInterceptor.java:108)
           at org.jboss.seam.bpm.BusinessProcessInterceptor.aroundInvoke(BusinessProcessInterceptor.java:51)
           at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
           at org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:44)
           at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
           at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:107)
           at org.jboss.seam.intercept.JavaBeanInterceptor.interceptInvocation(JavaBeanInterceptor.java:166)
           at org.jboss.seam.intercept.JavaBeanInterceptor.invoke(JavaBeanInterceptor.java:102)
           at org.domain.booking.entity.OrderStock_$$_javassist_3.startProcess(OrderStock_$$_javassist_3.java)
           at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
           at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
           at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
           at java.lang.reflect.Method.invoke(Unknown Source)
           at org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:329)
           at org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:342)
           at org.jboss.el.parser.AstPropertySuffix.invoke(AstPropertySuffix.java:58)
           at org.jboss.el.parser.AstValue.invoke(AstValue.java:96)
           at org.jboss.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:276)
           at com.sun.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:68)
           at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:88)



      Does anyone knows how to solve this problem?
      Or witch libraries should I use to make it work?


      Ps: When i try to invoke rule from a java class like this, it works:


           
           @In(create=true) WorkingMemory insuranceconfigWorkingMemory;
           public void test(){
                insuranceconfigWorkingMemory.fireAllRules();
      
           }




      Best regards,
      aubertinp