2 Replies Latest reply on Jun 27, 2014 4:13 AM by Jocelyn Duc

    Exception when trying to evaluate constraint relationship in split

    Jocelyn Duc Novice

      Hi guys,

       

      Have a look at this:

      branches.PNG

      From the user task Identity, I output the object variable: identity_relationship. The getObject() method return the string value as given in the form ("true" or "false"). In the first split, I test this object value like this:

       

      // On the first branch
      return KieFunctions.equalsTo(identity_relationship.getObject(), "true");
      // On the second branch
      return KieFunctions.equalsTo(identity_relationship.getObject(), "false");
      

      This works well.

       

      On the second split, I do exactly the same, with the identity_relationship given by the Identity task, but I get the following error:

       

      15:39:43,466 WARN  [org.drools.persistence.SingleSessionCommandService] (http-localhost-127.0.0.1-8080-6) Could not commit session: org.jbpm.workflow.instance.WorkflowRuntimeException: [avs:367 - :9] -- Exception when trying to evaluate constraint relationship in split 
        at org.jbpm.workflow.instance.node.SplitInstance.internalTrigger(SplitInstance.java:67) [jbpm-flow-6.1.0-SNAPSHOT.jar:6.1.0-SNAPSHOT]
        at org.jbpm.workflow.instance.impl.NodeInstanceImpl.trigger(NodeInstanceImpl.java:155) [jbpm-flow-6.1.0-SNAPSHOT.jar:6.1.0-SNAPSHOT]
        at org.jbpm.workflow.instance.impl.NodeInstanceImpl.triggerNodeInstance(NodeInstanceImpl.java:337) [jbpm-flow-6.1.0-SNAPSHOT.jar:6.1.0-SNAPSHOT]
        at org.jbpm.workflow.instance.impl.NodeInstanceImpl.triggerCompleted(NodeInstanceImpl.java:296) [jbpm-flow-6.1.0-SNAPSHOT.jar:6.1.0-SNAPSHOT]
        at org.jbpm.workflow.instance.impl.ExtendedNodeInstanceImpl.triggerCompleted(ExtendedNodeInstanceImpl.java:44) [jbpm-flow-6.1.0-SNAPSHOT.jar:6.1.0-SNAPSHOT]
        at org.jbpm.workflow.instance.node.StateBasedNodeInstance.triggerCompleted(StateBasedNodeInstance.java:286) [jbpm-flow-6.1.0-SNAPSHOT.jar:6.1.0-SNAPSHOT]
        at org.jbpm.workflow.instance.node.StateBasedNodeInstance.triggerCompleted(StateBasedNodeInstance.java:265) [jbpm-flow-6.1.0-SNAPSHOT.jar:6.1.0-SNAPSHOT]
        at org.jbpm.workflow.instance.node.WorkItemNodeInstance.triggerCompleted(WorkItemNodeInstance.java:306) [jbpm-flow-6.1.0-SNAPSHOT.jar:6.1.0-SNAPSHOT]
        at org.jbpm.workflow.instance.node.HumanTaskNodeInstance.triggerCompleted(HumanTaskNodeInstance.java:93) [jbpm-flow-6.1.0-SNAPSHOT.jar:6.1.0-SNAPSHOT]
        at org.jbpm.workflow.instance.node.WorkItemNodeInstance.workItemCompleted(WorkItemNodeInstance.java:368) [jbpm-flow-6.1.0-SNAPSHOT.jar:6.1.0-SNAPSHOT]
        at org.jbpm.workflow.instance.node.WorkItemNodeInstance.signalEvent(WorkItemNodeInstance.java:344) [jbpm-flow-6.1.0-SNAPSHOT.jar:6.1.0-SNAPSHOT]
        at org.jbpm.workflow.instance.impl.WorkflowProcessInstanceImpl.signalEvent(WorkflowProcessInstanceImpl.java:403) [jbpm-flow-6.1.0-SNAPSHOT.jar:6.1.0-SNAPSHOT]
        at org.drools.persistence.jpa.processinstance.JPAWorkItemManager.completeWorkItem(JPAWorkItemManager.java:134) [drools-persistence-jpa-6.1.0-SNAPSHOT.jar:6.1.0-SNAPSHOT]
        at org.drools.core.command.runtime.process.CompleteWorkItemCommand.execute(CompleteWorkItemCommand.java:74) [drools-core-6.1.0-SNAPSHOT.jar:6.1.0-SNAPSHOT]
        at org.drools.core.command.runtime.process.CompleteWorkItemCommand.execute(CompleteWorkItemCommand.java:35) [drools-core-6.1.0-SNAPSHOT.jar:6.1.0-SNAPSHOT]
        at org.drools.core.command.impl.DefaultCommandService.execute(DefaultCommandService.java:36) [drools-core-6.1.0-SNAPSHOT.jar:6.1.0-SNAPSHOT]
        at org.drools.core.command.impl.AbstractInterceptor.executeNext(AbstractInterceptor.java:41) [drools-core-6.1.0-SNAPSHOT.jar:6.1.0-SNAPSHOT]
        at org.drools.persistence.SingleSessionCommandService$TransactionInterceptor.execute(SingleSessionCommandService.java:533) [drools-persistence-jpa-6.1.0-SNAPSHOT.jar:6.1.0-SNAPSHOT]
        at org.drools.core.command.impl.AbstractInterceptor.executeNext(AbstractInterceptor.java:41) [drools-core-6.1.0-SNAPSHOT.jar:6.1.0-SNAPSHOT]
        at org.drools.persistence.jpa.OptimisticLockRetryInterceptor.execute(OptimisticLockRetryInterceptor.java:73) [drools-persistence-jpa-6.1.0-SNAPSHOT.jar:6.1.0-SNAPSHOT]
        at org.drools.core.command.impl.AbstractInterceptor.executeNext(AbstractInterceptor.java:41) [drools-core-6.1.0-SNAPSHOT.jar:6.1.0-SNAPSHOT]
        at org.drools.persistence.jta.TransactionLockInterceptor.execute(TransactionLockInterceptor.java:60) [drools-persistence-jpa-6.1.0-SNAPSHOT.jar:6.1.0-SNAPSHOT]
        at org.drools.persistence.SingleSessionCommandService.execute(SingleSessionCommandService.java:377) [drools-persistence-jpa-6.1.0-SNAPSHOT.jar:6.1.0-SNAPSHOT]
        at org.drools.core.command.impl.CommandBasedStatefulKnowledgeSession$1.completeWorkItem(CommandBasedStatefulKnowledgeSession.java:145) [drools-core-6.1.0-SNAPSHOT.jar:6.1.0-SNAPSHOT]
        at org.jbpm.services.task.wih.ExternalTaskEventListener.processTaskState(ExternalTaskEventListener.java:75) [jbpm-human-task-workitems-6.1.0-SNAPSHOT.jar:6.1.0-SNAPSHOT]
        at org.jbpm.services.task.wih.ExternalTaskEventListener.afterTaskCompletedEvent(ExternalTaskEventListener.java:119) [jbpm-human-task-workitems-6.1.0-SNAPSHOT.jar:6.1.0-SNAPSHOT]
        at org.jbpm.services.task.events.TaskEventSupport.fireAfterTaskCompleted(TaskEventSupport.java:189) [jbpm-human-task-core-6.1.0-SNAPSHOT.jar:6.1.0-SNAPSHOT]
        at org.jbpm.services.task.internals.lifecycle.MVELLifeCycleManager.taskOperation(MVELLifeCycleManager.java:340) [jbpm-human-task-core-6.1.0-SNAPSHOT.jar:6.1.0-SNAPSHOT]
        at org.jbpm.services.task.identity.UserGroupLifeCycleManagerDecorator.taskOperation(UserGroupLifeCycleManagerDecorator.java:46) [jbpm-human-task-core-6.1.0-SNAPSHOT.jar:6.1.0-SNAPSHOT]
        at org.jbpm.services.task.impl.TaskInstanceServiceImpl.complete(TaskInstanceServiceImpl.java:142) [jbpm-human-task-core-6.1.0-SNAPSHOT.jar:6.1.0-SNAPSHOT]
        at org.jbpm.services.task.commands.CompleteTaskCommand.execute(CompleteTaskCommand.java:70) [jbpm-human-task-core-6.1.0-SNAPSHOT.jar:6.1.0-SNAPSHOT]
        at org.jbpm.services.task.commands.CompleteTaskCommand.execute(CompleteTaskCommand.java:37) [jbpm-human-task-core-6.1.0-SNAPSHOT.jar:6.1.0-SNAPSHOT]
        at org.jbpm.services.task.commands.CompositeCommand.execute(CompositeCommand.java:38) [jbpm-human-task-core-6.1.0-SNAPSHOT.jar:6.1.0-SNAPSHOT]
        at org.jbpm.services.task.commands.TaskCommandExecutorImpl$SelfExecutionCommandService.execute(TaskCommandExecutorImpl.java:65) [jbpm-human-task-core-6.1.0-SNAPSHOT.jar:6.1.0-SNAPSHOT]
        at org.drools.core.command.impl.AbstractInterceptor.executeNext(AbstractInterceptor.java:41) [drools-core-6.1.0-SNAPSHOT.jar:6.1.0-SNAPSHOT]
        at org.jbpm.services.task.persistence.TaskTransactionInterceptor.execute(TaskTransactionInterceptor.java:54) [jbpm-human-task-jpa-6.1.0-SNAPSHOT.jar:6.1.0-SNAPSHOT]
        at org.jbpm.services.task.commands.TaskCommandExecutorImpl.execute(TaskCommandExecutorImpl.java:40) [jbpm-human-task-core-6.1.0-SNAPSHOT.jar:6.1.0-SNAPSHOT]
        at org.jbpm.services.task.impl.command.CommandBasedTaskService.complete(CommandBasedTaskService.java:144) [jbpm-human-task-core-6.1.0-SNAPSHOT.jar:6.1.0-SNAPSHOT]
        at org.jbpm.console.ng.ht.backend.server.TaskServiceEntryPointImpl.complete(TaskServiceEntryPointImpl.java:309) [jbpm-console-ng-human-tasks-backend-6.1.0-SNAPSHOT.jar:6.1.0-SNAPSHOT]
        at org.jbpm.console.ng.ht.backend.server.TaskServiceEntryPointImpl$Proxy$_$$_WeldClientProxy.complete(TaskServiceEntryPointImpl$Proxy$_$$_WeldClientProxy.java) [jbpm-console-ng-human-tasks-backend-6.1.0-SNAPSHOT.jar:6.1.0-SNAPSHOT]
        at org.jbpm.console.ng.ht.backend.server.FormModelerProcessStarterEntryPointImpl.completeTaskFromContext(FormModelerProcessStarterEntryPointImpl.java:63) [jbpm-console-ng-human-tasks-backend-6.1.0-SNAPSHOT.jar:6.1.0-SNAPSHOT]
        at org.jbpm.console.ng.ht.backend.server.FormModelerProcessStarterEntryPointImpl$Proxy$_$$_WeldClientProxy.completeTaskFromContext(FormModelerProcessStarterEntryPointImpl$Proxy$_$$_WeldClientProxy.java) [jbpm-console-ng-human-tasks-backend-6.1.0-SNAPSHOT.jar:6.1.0-SNAPSHOT]
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.7.0_25]
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) [rt.jar:1.7.0_25]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.7.0_25]
        at java.lang.reflect.Method.invoke(Method.java:606) [rt.jar:1.7.0_25]
        at org.jboss.errai.bus.server.io.AbstractRPCMethodCallback.invokeMethodFromMessage(AbstractRPCMethodCallback.java:48) [errai-bus-2.4.4.Final.jar:2.4.4.Final]
        at org.jboss.errai.bus.server.io.VoidRPCEndpointCallback.callback(VoidRPCEndpointCallback.java:20) [errai-bus-2.4.4.Final.jar:2.4.4.Final]
        at org.jboss.errai.bus.server.io.RemoteServiceCallback.callback(RemoteServiceCallback.java:54) [errai-bus-2.4.4.Final.jar:2.4.4.Final]
        at org.jboss.errai.cdi.server.CDIExtensionPoints$3.callback(CDIExtensionPoints.java:499) [errai-weld-integration-2.4.4.Final.jar:2.4.4.Final]
        at org.jboss.errai.bus.server.DeliveryPlan.deliver(DeliveryPlan.java:47) [errai-bus-2.4.4.Final.jar:2.4.4.Final]
        at org.jboss.errai.bus.server.ServerMessageBusImpl.sendGlobal(ServerMessageBusImpl.java:284) [errai-bus-2.4.4.Final.jar:2.4.4.Final]
        at org.jboss.errai.bus.server.SimpleDispatcher.dispatchGlobal(SimpleDispatcher.java:46) [errai-bus-2.4.4.Final.jar:2.4.4.Final]
        at org.jboss.errai.bus.server.service.ErraiServiceImpl.store(ErraiServiceImpl.java:97) [errai-bus-2.4.4.Final.jar:2.4.4.Final]
        at org.jboss.errai.bus.server.service.ErraiServiceImpl.store(ErraiServiceImpl.java:114) [errai-bus-2.4.4.Final.jar:2.4.4.Final]
        at org.jboss.errai.bus.server.servlet.DefaultBlockingServlet.doPost(DefaultBlockingServlet.java:140) [errai-bus-2.4.4.Final.jar:2.4.4.Final]
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:754) [jboss-servlet-api_3.0_spec-1.0.0.Final.jar:1.0.0.Final]
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:847) [jboss-servlet-api_3.0_spec-1.0.0.Final.jar:1.0.0.Final]
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:329) [jbossweb-7.0.13.Final.jar:]
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.13.Final.jar:]
        at org.jboss.weld.servlet.ConversationPropagationFilter.doFilter(ConversationPropagationFilter.java:62) [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280) [jbossweb-7.0.13.Final.jar:]
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.13.Final.jar:]
        at org.jboss.solder.servlet.exception.CatchExceptionFilter.doFilter(CatchExceptionFilter.java:65) [solder-impl-3.2.1.Final.jar:3.2.1.Final]
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280) [jbossweb-7.0.13.Final.jar:]
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.13.Final.jar:]
        at org.jboss.solder.servlet.event.ServletEventBridgeFilter.doFilter(ServletEventBridgeFilter.java:74) [solder-impl-3.2.1.Final.jar:3.2.1.Final]
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280) [jbossweb-7.0.13.Final.jar:]
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.13.Final.jar:]
        at org.jbpm.designer.web.filter.impl.PluggableFilter.doFilter(PluggableFilter.java:70) [jbpm-designer-backend-6.1.0-SNAPSHOT.jar:6.1.0-SNAPSHOT]
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280) [jbossweb-7.0.13.Final.jar:]
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.13.Final.jar:]
        at org.uberfire.security.server.UberFireSecurityFilter.doFilter(UberFireSecurityFilter.java:283) [uberfire-security-server-0.4.0-SNAPSHOT.jar:0.4.0-SNAPSHOT]
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280) [jbossweb-7.0.13.Final.jar:]
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.13.Final.jar:]
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275) [jbossweb-7.0.13.Final.jar:]
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161) [jbossweb-7.0.13.Final.jar:]
        at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:489) [jbossweb-7.0.13.Final.jar:]
        at org.jboss.as.jpa.interceptor.WebNonTxEmCloserValve.invoke(WebNonTxEmCloserValve.java:50) [jboss-as-jpa-7.1.1.Final.jar:7.1.1.Final]
        at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:153) [jboss-as-web-7.1.1.Final.jar:7.1.1.Final]
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:155) [jbossweb-7.0.13.Final.jar:]
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) [jbossweb-7.0.13.Final.jar:]
        at org.apache.catalina.authenticator.SingleSignOn.invoke(SingleSignOn.java:416) [jbossweb-7.0.13.Final.jar:]
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) [jbossweb-7.0.13.Final.jar:]
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:368) [jbossweb-7.0.13.Final.jar:]
        at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877) [jbossweb-7.0.13.Final.jar:]
        at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:671) [jbossweb-7.0.13.Final.jar:]
        at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:930) [jbossweb-7.0.13.Final.jar:]
        at java.lang.Thread.run(Thread.java:724) [rt.jar:1.7.0_25]
      Caused by: java.lang.RuntimeException: Exception when trying to evaluate constraint relationship in split 
        at org.jbpm.workflow.instance.node.SplitInstance.executeStrategy(SplitInstance.java:93) [jbpm-flow-6.1.0-SNAPSHOT.jar:6.1.0-SNAPSHOT]
        at org.jbpm.workflow.instance.node.SplitInstance.internalTrigger(SplitInstance.java:63) [jbpm-flow-6.1.0-SNAPSHOT.jar:6.1.0-SNAPSHOT]
        ... 88 more
      Caused by: java.lang.RuntimeException: unable to execute ReturnValueEvaluator: 
        at org.jbpm.process.instance.impl.ReturnValueConstraintEvaluator.evaluate(ReturnValueConstraintEvaluator.java:131) [jbpm-flow-6.1.0-SNAPSHOT.jar:6.1.0-SNAPSHOT]
        at org.jbpm.workflow.instance.node.SplitInstance.executeStrategy(SplitInstance.java:86) [jbpm-flow-6.1.0-SNAPSHOT.jar:6.1.0-SNAPSHOT]
        ... 89 more
      Caused by: java.lang.NullPointerException
        at org.jbpm.Process_org$u46$jbpm$u46$AVS96990.returnValueEvaluator8(Process_org$u46$jbpm$u46$AVS96990.java:57)
        at org.jbpm.Process_org$u46$jbpm$u46$AVS96990ReturnValueEvaluator8Invoker.evaluate(Process_org$u46$jbpm$u46$AVS96990ReturnValueEvaluator8Invoker.java:15)
        at org.jbpm.process.instance.impl.ReturnValueConstraintEvaluator.evaluate(ReturnValueConstraintEvaluator.java:129) [jbpm-flow-6.1.0-SNAPSHOT.jar:6.1.0-SNAPSHOT]
        ... 90 more
      

       

      Can you explain me why? The variable is known on the first split, but not in the second?