0 Replies Latest reply on Mar 21, 2017 11:20 AM by Bruce KR

    JBPM 6  Custom work item  in Subprocess and per process strategy fails to get handler

    Bruce KR Newbie

      Hi,

          We  just migrated from JBPM 5.0 to JBPM 6 and struck at an issue described below. Any help towards solving this will be appreciated.

      Environment: JBPM 6 , used as  embedded  JBPM, DB  persistence , spring for run time manager and engine creations, per process instance strategy followed for run time

       

      We have a custom work item  created for a domain specific logic execution.  When the work item is executed  inside a re-usable subprocess it fails  to  find the  custom workitem handler which was registered with the session used to start the  parent process. 

      It works if we change the strategy to Singleton as its he same session or  both parent  process and subprocess.

      Is there any limitaion to use Singleton use as the strategy for executing custom workitem in subprocesses or am I missing something.

       

      The first image shows the parent process with 'test Subprocess' as the reusable subproess and the secong one shows the  subprocess

       

       

       

       

       

      Stack trace:

       

      org.jbpm.workflow.instance.WorkflowRuntimeException: [com.mypackage.testsubprocess:2 - TestSubProcessServiceTask:4] -- Could not find work item handler for AsyncTask

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        at org.drools.core.impl.StatefulKnowledgeSessionImpl.startProcessInstance(StatefulKnowledgeSessionImpl.java:1911)

        at org.drools.core.command.runtime.process.StartProcessInstanceCommand.execute(StartProcessInstanceCommand.java:52)

        at org.drools.core.command.runtime.process.StartProcessInstanceCommand.execute(StartProcessInstanceCommand.java:29)

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

        at org.drools.core.command.impl.AbstractInterceptor.executeNext(AbstractInterceptor.java:41)

        at org.drools.persistence.SingleSessionCommandService$TransactionInterceptor.execute(SingleSessionCommandService.java:548)

        at org.drools.core.command.impl.AbstractInterceptor.executeNext(AbstractInterceptor.java:41)

        at org.drools.persistence.jpa.OptimisticLockRetryInterceptor.execute(OptimisticLockRetryInterceptor.java:73)

        at org.drools.core.command.impl.AbstractInterceptor.executeNext(AbstractInterceptor.java:41)

        at org.drools.persistence.jta.TransactionLockInterceptor.execute(TransactionLockInterceptor.java:67)

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

        at org.drools.core.command.impl.CommandBasedStatefulKnowledgeSession.startProcessInstance(CommandBasedStatefulKnowledgeSession.java:256)

        at org.jbpm.workflow.instance.node.SubProcessNodeInstance.internalTrigger(SubProcessNodeInstance.java:188)

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        at org.drools.core.impl.StatefulKnowledgeSessionImpl.startProcess(StatefulKnowledgeSessionImpl.java:1901)

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

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

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

        at org.drools.core.command.impl.AbstractInterceptor.executeNext(AbstractInterceptor.java:41)

        at org.drools.persistence.SingleSessionCommandService$TransactionInterceptor.execute(SingleSessionCommandService.java:548)

        at org.drools.core.command.impl.AbstractInterceptor.executeNext(AbstractInterceptor.java:41)

        at org.drools.persistence.jpa.OptimisticLockRetryInterceptor.execute(OptimisticLockRetryInterceptor.java:73)

        at org.drools.core.command.impl.AbstractInterceptor.executeNext(AbstractInterceptor.java:41)

        at org.drools.persistence.jta.TransactionLockInterceptor.execute(TransactionLockInterceptor.java:67)

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

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

        at com.mypackage.StartJbpmProcessTask.execute(StartJbpmProcessTask.java:101)

        at com.mypackage.quartz.jobs.SyncTaskExecuterJob.execute(SyncTaskExecuterJob.java:56)

        at org.quartz.core.JobRunShell.run(JobRunShell.java:202)

        at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:573)

      Caused by: org.drools.core.WorkItemHandlerNotFoundException: Could not find work item handler for AsyncTask

        at org.drools.persistence.jpa.processinstance.JPAWorkItemManager.throwWorkItemNotFoundException(JPAWorkItemManager.java:62)

        at org.drools.persistence.jpa.processinstance.JPAWorkItemManager.internalExecuteWorkItem(JPAWorkItemManager.java:57)

        at org.jbpm.workflow.instance.node.WorkItemNodeInstance.internalTrigger(WorkItemNodeInstance.java:133)

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

        ... 61 more