2 Replies Latest reply on Jan 31, 2013 1:19 PM by mojavestorm

    Boolean process variable - XOR check

    wishmaster7 Newbie

      Hi all,

       

      I have a simple example with a boolean variable defined in my process, and in a diverging XOR I try to check this variable in order to decide which path my process must follow. This seems simple, but I get an exception, like if the process could not find the variable. Could someone help me ?

       

      Here is the stack trace of the error :

       

      SEVERE: "Servlet.service()" pour la servlet Resteasy a généré une exception

      org.jboss.resteasy.spi.UnhandledException: org.jbpm.workflow.instance.WorkflowRuntimeException: [project.myProcess:12 - Gateway:3] -- Exception when trying to evaluate constraint ko in split Gateway

          at org.jboss.resteasy.core.SynchronousDispatcher.unwrapException(SynchronousDispatcher.java:345)

          at org.jboss.resteasy.core.SynchronousDispatcher.handleApplicationException(SynchronousDispatcher.java:321)

          at org.jboss.resteasy.core.SynchronousDispatcher.handleException(SynchronousDispatcher.java:214)

          at org.jboss.resteasy.core.SynchronousDispatcher.handleInvokerException(SynchronousDispatcher.java:190)

          at org.jboss.resteasy.core.SynchronousDispatcher.getResponse(SynchronousDispatcher.java:534)

          at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:496)

          at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:119)

          at org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.service(ServletContainerDispatcher.java:208)

          at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:55)

          at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:50)

          at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)

          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)

          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)

          at org.jboss.bpm.console.server.util.GWTJsonFilter.doFilter(GWTJsonFilter.java:59)

          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)

          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)

          at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)

          at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)

          at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:581)

          at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)

          at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)

          at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:936)

          at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)

          at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)

          at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1004)

          at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)

          at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:312)

          at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)

          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)

          at java.lang.Thread.run(Thread.java:722)

      Caused by: org.jbpm.workflow.instance.WorkflowRuntimeException: [project.myProcess:12 - Gateway:3] -- Exception when trying to evaluate constraint ko in split Gateway

          at org.jbpm.workflow.instance.impl.NodeInstanceImpl.trigger(NodeInstanceImpl.java:130)

          at org.jbpm.workflow.instance.impl.NodeInstanceImpl.triggerNodeInstance(NodeInstanceImpl.java:205)

          at org.jbpm.workflow.instance.impl.NodeInstanceImpl.triggerCompleted(NodeInstanceImpl.java:164)

          at org.jbpm.workflow.instance.node.ActionNodeInstance.triggerCompleted(ActionNodeInstance.java:55)

          at org.jbpm.workflow.instance.node.ActionNodeInstance.internalTrigger(ActionNodeInstance.java:51)

          at org.jbpm.workflow.instance.impl.NodeInstanceImpl.trigger(NodeInstanceImpl.java:124)

          at org.jbpm.workflow.instance.impl.NodeInstanceImpl.triggerNodeInstance(NodeInstanceImpl.java:205)

          at org.jbpm.workflow.instance.impl.NodeInstanceImpl.triggerCompleted(NodeInstanceImpl.java:164)

          at org.jbpm.workflow.instance.node.JoinInstance.triggerCompleted(JoinInstance.java:152)

          at org.jbpm.workflow.instance.node.JoinInstance.internalTrigger(JoinInstance.java:52)

          at org.jbpm.workflow.instance.impl.NodeInstanceImpl.trigger(NodeInstanceImpl.java:124)

          at org.jbpm.workflow.instance.impl.NodeInstanceImpl.triggerNodeInstance(NodeInstanceImpl.java:205)

          at org.jbpm.workflow.instance.impl.NodeInstanceImpl.triggerCompleted(NodeInstanceImpl.java:164)

          at org.jbpm.workflow.instance.node.StartNodeInstance.triggerCompleted(StartNodeInstance.java:49)

          at org.jbpm.workflow.instance.node.StartNodeInstance.internalTrigger(StartNodeInstance.java:41)

          at org.jbpm.workflow.instance.impl.NodeInstanceImpl.trigger(NodeInstanceImpl.java:124)

          at org.jbpm.ruleflow.instance.RuleFlowProcessInstance.internalStart(RuleFlowProcessInstance.java:35)

          at org.jbpm.process.instance.impl.ProcessInstanceImpl.start(ProcessInstanceImpl.java:188)

          at org.jbpm.workflow.instance.impl.WorkflowProcessInstanceImpl.start(WorkflowProcessInstanceImpl.java:303)

          at org.jbpm.process.instance.ProcessRuntimeImpl.startProcessInstance(ProcessRuntimeImpl.java:168)

          at org.jbpm.process.instance.ProcessRuntimeImpl.startProcess(ProcessRuntimeImpl.java:138)

          at org.drools.common.AbstractWorkingMemory.startProcess(AbstractWorkingMemory.java:1082)

          at org.drools.impl.StatefulKnowledgeSessionImpl.startProcess(StatefulKnowledgeSessionImpl.java:320)

          at org.drools.command.runtime.process.StartProcessCommand.execute(StartProcessCommand.java:120)

          at org.drools.command.runtime.process.StartProcessCommand.execute(StartProcessCommand.java:39)

          at org.drools.command.impl.DefaultCommandService.execute(DefaultCommandService.java:36)

          at org.drools.persistence.SingleSessionCommandService.execute(SingleSessionCommandService.java:367)

          at org.drools.command.impl.CommandBasedStatefulKnowledgeSession.startProcess(CommandBasedStatefulKnowledgeSession.java:223)

          at org.jbpm.integration.console.CommandDelegate.startProcess(CommandDelegate.java:120)

          at org.jbpm.integration.console.ProcessManagement.newInstance(ProcessManagement.java:88)

          at org.jboss.bpm.console.server.FormProcessingFacade.startProcessWithUI(FormProcessingFacade.java:197)

          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

          at java.lang.reflect.Method.invoke(Method.java:601)

          at org.jboss.resteasy.core.MethodInjectorImpl.invoke(MethodInjectorImpl.java:140)

          at org.jboss.resteasy.core.ResourceMethod.invokeOnTarget(ResourceMethod.java:255)

          at org.jboss.resteasy.core.ResourceMethod.invoke(ResourceMethod.java:220)

          at org.jboss.resteasy.core.ResourceMethod.invoke(ResourceMethod.java:209)

          at org.jboss.resteasy.core.SynchronousDispatcher.getResponse(SynchronousDispatcher.java:519)

          ... 25 more

      Caused by: java.lang.RuntimeException: Exception when trying to evaluate constraint ko in split Gateway

          at org.jbpm.workflow.instance.node.SplitInstance.internalTrigger(SplitInstance.java:79)

          at org.jbpm.workflow.instance.impl.NodeInstanceImpl.trigger(NodeInstanceImpl.java:124)

          ... 64 more

      Caused by: java.lang.RuntimeException: unable to execute ReturnValueEvaluator

          at org.jbpm.process.instance.impl.ReturnValueConstraintEvaluator.evaluate(ReturnValueConstraintEvaluator.java:130)

          at org.jbpm.workflow.instance.node.SplitInstance.internalTrigger(SplitInstance.java:72)

          ... 65 more

      Caused by: java.lang.NullPointerException

          at defaultPackage.Process_defaultPackage_MyProcess_0b7d725f8c6444ebb06b8060ebd85e51.returnValueEvaluator2(Process_defaultPackage_MyProcess_0b7d725f8c6444ebb06b8060ebd85e51.java:20)

          at defaultPackage.Process_defaultPackage_MyProcess_0b7d725f8c6444ebb06b8060ebd85e51ReturnValueEvaluator2Invoker.evaluate(Process_defaultPackage_MyProcess_0b7d725f8c6444ebb06b8060ebd85e51ReturnValueEvaluator2Invoker.java:15)

          at org.jbpm.process.instance.impl.ReturnValueConstraintEvaluator.evaluate(ReturnValueConstraintEvaluator.java:128)

          ... 66 more

       

       

      The variable name is "toto", defined in the process; the XOR gateway has "return toto=true;" for one direction, "return toto=false;" for the other direction.

       

      The BPMN file of the process is as attachment.

       

      Maybe if it helps... I run jBPM 5.4 on Tomcat 7.0. Process written with Eclipse (Helios) plugin.