<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<body link="#355491" alink="#4262a1" vlink="#355491" style="background: #e2e2e2; margin: 0; padding: 20px;">
<div>
        <table cellpadding="0" bgcolor="#FFFFFF" border="0" cellspacing="0" style="border: 1px solid #dadada; margin-bottom: 30px; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                <tbody>
                        <tr>
                                <td>
                                        <table border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" style="border: solid 2px #ccc; background: #dadada; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                                                <tbody>
                                                        <tr>
                                                                <td bgcolor="#000000" valign="middle" height="58px" style="border-bottom: 1px solid #ccc; padding: 20px; -moz-border-radius-topleft: 3px; -moz-border-radius-topright: 3px; -webkit-border-top-right-radius: 5px; -webkit-border-top-left-radius: 5px;">
                                                                        <h1 style="color: #333333; font: bold 22px Arial, Helvetica, sans-serif; margin: 0; display: block !important;">
                                                                        <!-- To have a header image/logo replace the name below with your img tag -->
                                                                        <!-- Email clients will render the images when the message is read so any image -->
                                                                        <!-- must be made available on a public server, so that all recipients can load the image. -->
                                                                        <a href="https://community.jboss.org/index.jspa" style="text-decoration: none; color: #E1E1E1">JBoss Community</a></h1>
                                                                </td>
                                                        </tr>
                                                        <tr>
                                                                <td bgcolor="#FFFFFF" style="font: normal 12px Arial, Helvetica, sans-serif; color:#333333; padding: 20px; -moz-border-radius-bottomleft: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 5px; -webkit-border-bottom-left-radius: 5px;"><h3 style="margin: 10px 0 5px; font-size: 17px; font-weight: normal;">
Boolean process variable - XOR check
</h3>
<span style="margin-bottom: 10px;">
created by <a href="https://community.jboss.org/people/wishmaster7">wishmaster7</a> in <i>jBPM</i> - <a href="https://community.jboss.org/message/794848#794848">View the full discussion</a>
</span>
<hr style="margin: 20px 0; border: none; background-color: #dadada; height: 1px;">
<div class="jive-rendered-content"><p>Hi all,</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>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 ?</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>Here is the stack trace of the error :</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="padding-left: 30px;"><span style="font-family: courier new,courier; font-size: 8pt;">SEVERE: "Servlet.service()" pour la servlet Resteasy a généré une exception</span></p><p style="padding-left: 30px;"><span style="font-family: courier new,courier; font-size: 8pt;">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</span></p><p style="padding-left: 30px;"><span style="font-family: courier new,courier; font-size: 8pt;">    at org.jboss.resteasy.core.SynchronousDispatcher.unwrapException(SynchronousDispatcher.java:345)</span></p><p style="padding-left: 30px;"><span style="font-family: courier new,courier; font-size: 8pt;">    at org.jboss.resteasy.core.SynchronousDispatcher.handleApplicationException(SynchronousDispatcher.java:321)</span></p><p style="padding-left: 30px;"><span style="font-family: courier new,courier; font-size: 8pt;">    at org.jboss.resteasy.core.SynchronousDispatcher.handleException(SynchronousDispatcher.java:214)</span></p><p style="padding-left: 30px;"><span style="font-family: courier new,courier; font-size: 8pt;">    at org.jboss.resteasy.core.SynchronousDispatcher.handleInvokerException(SynchronousDispatcher.java:190)</span></p><p style="padding-left: 30px;"><span style="font-family: courier new,courier; font-size: 8pt;">    at org.jboss.resteasy.core.SynchronousDispatcher.getResponse(SynchronousDispatcher.java:534)</span></p><p style="padding-left: 30px;"><span style="font-family: courier new,courier; font-size: 8pt;">    at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:496)</span></p><p style="padding-left: 30px;"><span style="font-family: courier new,courier; font-size: 8pt;">    at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:119)</span></p><p style="padding-left: 30px;"><span style="font-family: courier new,courier; font-size: 8pt;">    at org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.service(ServletContainerDispatcher.java:208)</span></p><p style="padding-left: 30px;"><span style="font-family: courier new,courier; font-size: 8pt;">    at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:55)</span></p><p style="padding-left: 30px;"><span style="font-family: courier new,courier; font-size: 8pt;">    at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:50)</span></p><p style="padding-left: 30px;"><span style="font-family: courier new,courier; font-size: 8pt;">    at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)</span></p><p style="padding-left: 30px;"><span style="font-family: courier new,courier; font-size: 8pt;">    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)</span></p><p style="padding-left: 30px;"><span style="font-family: courier new,courier; font-size: 8pt;">    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)</span></p><p style="padding-left: 30px;"><span style="font-family: courier new,courier; font-size: 8pt;">    at org.jboss.bpm.console.server.util.GWTJsonFilter.doFilter(GWTJsonFilter.java:59)</span></p><p style="padding-left: 30px;"><span style="font-family: courier new,courier; font-size: 8pt;">    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)</span></p><p style="padding-left: 30px;"><span style="font-family: courier new,courier; font-size: 8pt;">    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)</span></p><p style="padding-left: 30px;"><span style="font-family: courier new,courier; font-size: 8pt;">    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)</span></p><p style="padding-left: 30px;"><span style="font-family: courier new,courier; font-size: 8pt;">    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)</span></p><p style="padding-left: 30px;"><span style="font-family: courier new,courier; font-size: 8pt;">    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:581)</span></p><p style="padding-left: 30px;"><span style="font-family: courier new,courier; font-size: 8pt;">    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)</span></p><p style="padding-left: 30px;"><span style="font-family: courier new,courier; font-size: 8pt;">    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)</span></p><p style="padding-left: 30px;"><span style="font-family: courier new,courier; font-size: 8pt;">    at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:936)</span></p><p style="padding-left: 30px;"><span style="font-family: courier new,courier; font-size: 8pt;">    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)</span></p><p style="padding-left: 30px;"><span style="font-family: courier new,courier; font-size: 8pt;">    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)</span></p><p style="padding-left: 30px;"><span style="font-family: courier new,courier; font-size: 8pt;">    at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1004)</span></p><p style="padding-left: 30px;"><span style="font-family: courier new,courier; font-size: 8pt;">    at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)</span></p><p style="padding-left: 30px;"><span style="font-family: courier new,courier; font-size: 8pt;">    at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:312)</span></p><p style="padding-left: 30px;"><span style="font-family: courier new,courier; font-size: 8pt;">    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)</span></p><p style="padding-left: 30px;"><span style="font-family: courier new,courier; font-size: 8pt;">    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)</span></p><p style="padding-left: 30px;"><span style="font-family: courier new,courier; font-size: 8pt;">    at java.lang.Thread.run(Thread.java:722)</span></p><p style="padding-left: 30px;"><span style="font-family: courier new,courier; font-size: 8pt;">Caused by: org.jbpm.workflow.instance.WorkflowRuntimeException: [project.myProcess:12 - Gateway:3] -- Exception when trying to evaluate constraint ko in split Gateway</span></p><p style="padding-left: 30px;"><span style="font-family: courier new,courier; font-size: 8pt;">    at org.jbpm.workflow.instance.impl.NodeInstanceImpl.trigger(NodeInstanceImpl.java:130)</span></p><p style="padding-left: 30px;"><span style="font-family: courier new,courier; font-size: 8pt;">    at org.jbpm.workflow.instance.impl.NodeInstanceImpl.triggerNodeInstance(NodeInstanceImpl.java:205)</span></p><p style="padding-left: 30px;"><span style="font-family: courier new,courier; font-size: 8pt;">    at org.jbpm.workflow.instance.impl.NodeInstanceImpl.triggerCompleted(NodeInstanceImpl.java:164)</span></p><p style="padding-left: 30px;"><span style="font-family: courier new,courier; font-size: 8pt;">    at org.jbpm.workflow.instance.node.ActionNodeInstance.triggerCompleted(ActionNodeInstance.java:55)</span></p><p style="padding-left: 30px;"><span style="font-family: courier new,courier; font-size: 8pt;">    at org.jbpm.workflow.instance.node.ActionNodeInstance.internalTrigger(ActionNodeInstance.java:51)</span></p><p style="padding-left: 30px;"><span style="font-family: courier new,courier; font-size: 8pt;">    at org.jbpm.workflow.instance.impl.NodeInstanceImpl.trigger(NodeInstanceImpl.java:124)</span></p><p style="padding-left: 30px;"><span style="font-family: courier new,courier; font-size: 8pt;">    at org.jbpm.workflow.instance.impl.NodeInstanceImpl.triggerNodeInstance(NodeInstanceImpl.java:205)</span></p><p style="padding-left: 30px;"><span style="font-family: courier new,courier; font-size: 8pt;">    at org.jbpm.workflow.instance.impl.NodeInstanceImpl.triggerCompleted(NodeInstanceImpl.java:164)</span></p><p style="padding-left: 30px;"><span style="font-family: courier new,courier; font-size: 8pt;">    at org.jbpm.workflow.instance.node.JoinInstance.triggerCompleted(JoinInstance.java:152)</span></p><p style="padding-left: 30px;"><span style="font-family: courier new,courier; font-size: 8pt;">    at org.jbpm.workflow.instance.node.JoinInstance.internalTrigger(JoinInstance.java:52)</span></p><p style="padding-left: 30px;"><span style="font-family: courier new,courier; font-size: 8pt;">    at org.jbpm.workflow.instance.impl.NodeInstanceImpl.trigger(NodeInstanceImpl.java:124)</span></p><p style="padding-left: 30px;"><span style="font-family: courier new,courier; font-size: 8pt;">    at org.jbpm.workflow.instance.impl.NodeInstanceImpl.triggerNodeInstance(NodeInstanceImpl.java:205)</span></p><p style="padding-left: 30px;"><span style="font-family: courier new,courier; font-size: 8pt;">    at org.jbpm.workflow.instance.impl.NodeInstanceImpl.triggerCompleted(NodeInstanceImpl.java:164)</span></p><p style="padding-left: 30px;"><span style="font-family: courier new,courier; font-size: 8pt;">    at org.jbpm.workflow.instance.node.StartNodeInstance.triggerCompleted(StartNodeInstance.java:49)</span></p><p style="padding-left: 30px;"><span style="font-family: courier new,courier; font-size: 8pt;">    at org.jbpm.workflow.instance.node.StartNodeInstance.internalTrigger(StartNodeInstance.java:41)</span></p><p style="padding-left: 30px;"><span style="font-family: courier new,courier; font-size: 8pt;">    at org.jbpm.workflow.instance.impl.NodeInstanceImpl.trigger(NodeInstanceImpl.java:124)</span></p><p style="padding-left: 30px;"><span style="font-family: courier new,courier; font-size: 8pt;">    at org.jbpm.ruleflow.instance.RuleFlowProcessInstance.internalStart(RuleFlowProcessInstance.java:35)</span></p><p style="padding-left: 30px;"><span style="font-family: courier new,courier; font-size: 8pt;">    at org.jbpm.process.instance.impl.ProcessInstanceImpl.start(ProcessInstanceImpl.java:188)</span></p><p style="padding-left: 30px;"><span style="font-family: courier new,courier; font-size: 8pt;">    at org.jbpm.workflow.instance.impl.WorkflowProcessInstanceImpl.start(WorkflowProcessInstanceImpl.java:303)</span></p><p style="padding-left: 30px;"><span style="font-family: courier new,courier; font-size: 8pt;">    at org.jbpm.process.instance.ProcessRuntimeImpl.startProcessInstance(ProcessRuntimeImpl.java:168)</span></p><p style="padding-left: 30px;"><span style="font-family: courier new,courier; font-size: 8pt;">    at org.jbpm.process.instance.ProcessRuntimeImpl.startProcess(ProcessRuntimeImpl.java:138)</span></p><p style="padding-left: 30px;"><span style="font-family: courier new,courier; font-size: 8pt;">    at org.drools.common.AbstractWorkingMemory.startProcess(AbstractWorkingMemory.java:1082)</span></p><p style="padding-left: 30px;"><span style="font-family: courier new,courier; font-size: 8pt;">    at org.drools.impl.StatefulKnowledgeSessionImpl.startProcess(StatefulKnowledgeSessionImpl.java:320)</span></p><p style="padding-left: 30px;"><span style="font-family: courier new,courier; font-size: 8pt;">    at org.drools.command.runtime.process.StartProcessCommand.execute(StartProcessCommand.java:120)</span></p><p style="padding-left: 30px;"><span style="font-family: courier new,courier; font-size: 8pt;">    at org.drools.command.runtime.process.StartProcessCommand.execute(StartProcessCommand.java:39)</span></p><p style="padding-left: 30px;"><span style="font-family: courier new,courier; font-size: 8pt;">    at org.drools.command.impl.DefaultCommandService.execute(DefaultCommandService.java:36)</span></p><p style="padding-left: 30px;"><span style="font-family: courier new,courier; font-size: 8pt;">    at org.drools.persistence.SingleSessionCommandService.execute(SingleSessionCommandService.java:367)</span></p><p style="padding-left: 30px;"><span style="font-family: courier new,courier; font-size: 8pt;">    at org.drools.command.impl.CommandBasedStatefulKnowledgeSession.startProcess(CommandBasedStatefulKnowledgeSession.java:223)</span></p><p style="padding-left: 30px;"><span style="font-family: courier new,courier; font-size: 8pt;">    at org.jbpm.integration.console.CommandDelegate.startProcess(CommandDelegate.java:120)</span></p><p style="padding-left: 30px;"><span style="font-family: courier new,courier; font-size: 8pt;">    at org.jbpm.integration.console.ProcessManagement.newInstance(ProcessManagement.java:88)</span></p><p style="padding-left: 30px;"><span style="font-family: courier new,courier; font-size: 8pt;">    at org.jboss.bpm.console.server.FormProcessingFacade.startProcessWithUI(FormProcessingFacade.java:197)</span></p><p style="padding-left: 30px;"><span style="font-family: courier new,courier; font-size: 8pt;">    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)</span></p><p style="padding-left: 30px;"><span style="font-family: courier new,courier; font-size: 8pt;">    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)</span></p><p style="padding-left: 30px;"><span style="font-family: courier new,courier; font-size: 8pt;">    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)</span></p><p style="padding-left: 30px;"><span style="font-family: courier new,courier; font-size: 8pt;">    at java.lang.reflect.Method.invoke(Method.java:601)</span></p><p style="padding-left: 30px;"><span style="font-family: courier new,courier; font-size: 8pt;">    at org.jboss.resteasy.core.MethodInjectorImpl.invoke(MethodInjectorImpl.java:140)</span></p><p style="padding-left: 30px;"><span style="font-family: courier new,courier; font-size: 8pt;">    at org.jboss.resteasy.core.ResourceMethod.invokeOnTarget(ResourceMethod.java:255)</span></p><p style="padding-left: 30px;"><span style="font-family: courier new,courier; font-size: 8pt;">    at org.jboss.resteasy.core.ResourceMethod.invoke(ResourceMethod.java:220)</span></p><p style="padding-left: 30px;"><span style="font-family: courier new,courier; font-size: 8pt;">    at org.jboss.resteasy.core.ResourceMethod.invoke(ResourceMethod.java:209)</span></p><p style="padding-left: 30px;"><span style="font-family: courier new,courier; font-size: 8pt;">    at org.jboss.resteasy.core.SynchronousDispatcher.getResponse(SynchronousDispatcher.java:519)</span></p><p style="padding-left: 30px;"><span style="font-family: courier new,courier; font-size: 8pt;">    ... 25 more</span></p><p style="padding-left: 30px;"><span style="font-family: courier new,courier; font-size: 8pt;">Caused by: java.lang.RuntimeException: Exception when trying to evaluate constraint ko in split Gateway</span></p><p style="padding-left: 30px;"><span style="font-family: courier new,courier; font-size: 8pt;">    at org.jbpm.workflow.instance.node.SplitInstance.internalTrigger(SplitInstance.java:79)</span></p><p style="padding-left: 30px;"><span style="font-family: courier new,courier; font-size: 8pt;">    at org.jbpm.workflow.instance.impl.NodeInstanceImpl.trigger(NodeInstanceImpl.java:124)</span></p><p style="padding-left: 30px;"><span style="font-family: courier new,courier; font-size: 8pt;">    ... 64 more</span></p><p style="padding-left: 30px;"><span style="font-family: courier new,courier; font-size: 8pt;">Caused by: java.lang.RuntimeException: unable to execute ReturnValueEvaluator</span></p><p style="padding-left: 30px;"><span style="font-family: courier new,courier; font-size: 8pt;">    at org.jbpm.process.instance.impl.ReturnValueConstraintEvaluator.evaluate(ReturnValueConstraintEvaluator.java:130)</span></p><p style="padding-left: 30px;"><span style="font-family: courier new,courier; font-size: 8pt;">    at org.jbpm.workflow.instance.node.SplitInstance.internalTrigger(SplitInstance.java:72)</span></p><p style="padding-left: 30px;"><span style="font-family: courier new,courier; font-size: 8pt;">    ... 65 more</span></p><p style="padding-left: 30px;"><span style="font-family: courier new,courier; font-size: 8pt;">Caused by: java.lang.NullPointerException</span></p><p style="padding-left: 30px;"><span style="font-family: courier new,courier; font-size: 8pt;">    at defaultPackage.Process_defaultPackage_MyProcess_0b7d725f8c6444ebb06b8060ebd85e51.returnValueEvaluator2(Process_defaultPackage_MyProcess_0b7d725f8c6444ebb06b8060ebd85e51.java:20)</span></p><p style="padding-left: 30px;"><span style="font-family: courier new,courier; font-size: 8pt;">    at defaultPackage.Process_defaultPackage_MyProcess_0b7d725f8c6444ebb06b8060ebd85e51ReturnValueEvaluator2Invoker.evaluate(Process_defaultPackage_MyProcess_0b7d725f8c6444ebb06b8060ebd85e51ReturnValueEvaluator2Invoker.java:15)</span></p><p style="padding-left: 30px;"><span style="font-family: courier new,courier; font-size: 8pt;">    at org.jbpm.process.instance.impl.ReturnValueConstraintEvaluator.evaluate(ReturnValueConstraintEvaluator.java:128)</span></p><p style="padding-left: 30px;"><span style="font-family: courier new,courier; font-size: 8pt;">    ... 66 more</span></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>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.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>The BPMN file of the process is as attachment.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>Maybe if it helps... I run jBPM 5.4 on Tomcat 7.0. Process writter with Eclipse (Helios) plugin.</p></div>
<div style="background-color: #f4f4f4; padding: 10px; margin-top: 20px;">
<p style="margin: 0;">Reply to this message by <a href="https://community.jboss.org/message/794848#794848">going to Community</a></p>
        <p style="margin: 0;">Start a new discussion in jBPM at <a href="https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034">Community</a></p>
</div></td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</div>
</body>
</html>