Uploaded image for project: 'Magnolia Workflow Module'
  1. Magnolia Workflow Module
  2. MGNLWORKFLOW-335

Workflow "Publish" broken due to ScheduleTaskWorkItemHandler

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Not an issue
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
    • Environment:
      LFRZ

      Description

      5.4.? introduced the following bug compared to 5.3:

      When using the "Publication" workflow (publication/Publication.bpmn2) since upgrading to Magnolia 5.4, the attempt to launch the workflow fails with an Exception.

      The problem seems to be with the new class ScheduleTaskWorkItemHandler which in line 42 retrieves a task ID, and in line 43 attempts to load a HumanTask using this id.
      The problem is that in the case of the Publication workflow there is no human task (it's just a timer for delayed publication) and therefore the ID is null, and line 43 fails due to NPE.

      info.magnolia.module.workflow.api.WorkflowException: Error starting workflow.
              at info.magnolia.module.workflow.jbpm.JbpmWorkflowManager.launch(JbpmWorkflowManager.java:81)
              at info.magnolia.module.workflow.commands.LaunchWorkflowCommand.execute(LaunchWorkflowCommand.java:72)
              at info.magnolia.commands.MgnlCommand.executeSynchronized(MgnlCommand.java:80)
              at info.magnolia.commands.MgnlCommand.execute(MgnlCommand.java:69)
              at info.magnolia.commands.chain.ChainBase.execute(ChainBase.java:101)
              at info.magnolia.commands.DelegateCommand.execute(DelegateCommand.java:66)
              at info.magnolia.commands.CommandsManager.executeCommand(CommandsManager.java:256)
              at info.magnolia.commands.CommandsManager.executeCommand(CommandsManager.java:244)
              at info.magnolia.ui.framework.action.AbstractCommandAction.executeOnItem(AbstractCommandAction.java:202)
              at info.magnolia.ui.framework.action.AbstractMultiItemAction.execute(AbstractMultiItemAction.java:107)
              at info.magnolia.ui.api.action.AbstractActionExecutor.execute(AbstractActionExecutor.java:62)
              at info.magnolia.ui.dialog.BaseDialogPresenter.executeAction(BaseDialogPresenter.java:211)
              at info.magnolia.ui.dialog.BaseDialogPresenter.onActionFired(BaseDialogPresenter.java:201)
              at info.magnolia.ui.dialog.actionarea.renderer.DefaultEditorActionRenderer$DefaultActionView$1.buttonClick(DefaultEditorActionRenderer.java:75)
              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
              at java.lang.reflect.Method.invoke(Method.java:498)
              at com.vaadin.event.ListenerMethod.receiveEvent(ListenerMethod.java:508)
              at com.vaadin.event.EventRouter.fireEvent(EventRouter.java:198)
              at com.vaadin.event.EventRouter.fireEvent(EventRouter.java:161)
              at com.vaadin.server.AbstractClientConnector.fireEvent(AbstractClientConnector.java:977)
              at com.vaadin.ui.Button.fireClick(Button.java:393)
              at com.vaadin.ui.Button$1.click(Button.java:61)
              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
              at java.lang.reflect.Method.invoke(Method.java:498)
      ...
      
      Caused by: org.jbpm.workflow.instance.WorkflowRuntimeException: [info.magnolia.workflow.Publication:1,467,902,295,756 - Schedule Publication:6] -- Impossible to get the objec
      t with uuid : null
              at org.jbpm.workflow.instance.node.WorkItemNodeInstance.internalTrigger(WorkItemNodeInstance.java:144)
              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.triggerConnection(NodeInstanceImpl.java:379)
              at org.jbpm.workflow.instance.node.SplitInstance.executeStrategy(SplitInstance.java:117)
              at org.jbpm.workflow.instance.node.SplitInstance.internalTrigger(SplitInstance.java:63)
              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.SimpleSessionCommandService$TransactionInterceptor.execute(SimpleSessionCommandService.java:334)
              at org.drools.core.command.impl.AbstractInterceptor.executeNext(AbstractInterceptor.java:41)
              at org.drools.persistence.jcr.JcrPersistInterceptor.execute(JcrPersistInterceptor.java:42)
              at org.drools.core.command.impl.AbstractInterceptor.executeNext(AbstractInterceptor.java:41)
              at org.jbpm.persistence.JcrPersistProcessInterceptor.execute(JcrPersistProcessInterceptor.java:55)
              at org.drools.persistence.SimpleSessionCommandService.execute(SimpleSessionCommandService.java:251)
              at org.drools.core.command.impl.CommandBasedStatefulKnowledgeSession.startProcess(CommandBasedStatefulKnowledgeSession.java:242)
              at info.magnolia.module.workflow.jbpm.JbpmWorkflowManager.launch(JbpmWorkflowManager.java:74)
              ... 142 more
      
      Caused by: org.apache.jackrabbit.ocm.exception.RepositoryException: Impossible to get the object with uuid : null
              at org.apache.jackrabbit.ocm.manager.impl.ObjectContentManagerImpl.getObjectByUuid(ObjectContentManagerImpl.java:281)
              at info.magnolia.task.persistence.TasksStoreImpl$3.exec(TasksStoreImpl.java:170)
              at info.magnolia.task.persistence.TasksStoreImpl$3.exec(TasksStoreImpl.java:163)
              at info.magnolia.context.MgnlContext.doInSystemContext(MgnlContext.java:392)
              at info.magnolia.context.MgnlContext.doInSystemContext(MgnlContext.java:377)
              at info.magnolia.task.persistence.TasksStoreImpl.getTaskById(TasksStoreImpl.java:163)
              at info.magnolia.task.DefaultTasksManager.getTaskById(DefaultTasksManager.java:155)
              at info.magnolia.module.workflow.jbpm.workitem.handler.ScheduleTaskWorkItemHandler.executeWorkItem(ScheduleTaskWorkItemHandler.java:43)
              at info.magnolia.module.workflow.jbpm.persistence.WorkItemHandlerSystemContextWrapper$1.exec(WorkItemHandlerSystemContextWrapper.java:37)
              at info.magnolia.module.workflow.jbpm.persistence.WorkItemHandlerSystemContextWrapper$1.exec(WorkItemHandlerSystemContextWrapper.java:33)
              at info.magnolia.context.MgnlContext.doInSystemContext(MgnlContext.java:392)
              at info.magnolia.context.MgnlContext.doInSystemContext(MgnlContext.java:377)
              at info.magnolia.module.workflow.jbpm.persistence.WorkItemHandlerSystemContextWrapper.executeWorkItem(WorkItemHandlerSystemContextWrapper.java:33)
              at org.drools.persistence.jcr.processinstance.JcrWorkItemManager.internalExecuteWorkItem(JcrWorkItemManager.java:76)
              at org.jbpm.workflow.instance.node.WorkItemNodeInstance.internalTrigger(WorkItemNodeInstance.java:133)
              ... 172 more
      Caused by: javax.jcr.RepositoryException: invalid identifier: null
              at org.apache.jackrabbit.core.SessionImpl.getNodeByIdentifier(SessionImpl.java:1100)
              at info.magnolia.jcr.wrapper.DelegateSessionWrapper.getNodeByIdentifier(DelegateSessionWrapper.java:182)
              at info.magnolia.jcr.wrapper.DelegateSessionWrapper.getNodeByIdentifier(DelegateSessionWrapper.java:182)
              at info.magnolia.jcr.decoration.ContentDecoratorSessionWrapper.getNodeByIdentifier(ContentDecoratorSessionWrapper.java:129)
              at info.magnolia.jcr.wrapper.DelegateSessionWrapper.getNodeByIdentifier(DelegateSessionWrapper.java:182)
              at info.magnolia.jcr.wrapper.NodeWrappingDelegateSessionWrapper.getNodeByIdentifier(NodeWrappingDelegateSessionWrapper.java:58)
              at info.magnolia.jcr.wrapper.DelegateSessionWrapper.getNodeByIdentifier(DelegateSessionWrapper.java:182)
              at info.magnolia.jcr.decoration.ContentDecoratorSessionWrapper.getNodeByIdentifier(ContentDecoratorSessionWrapper.java:129)
              at info.magnolia.jcr.wrapper.DelegateSessionWrapper.getNodeByIdentifier(DelegateSessionWrapper.java:182)
              at info.magnolia.jcr.decoration.ContentDecoratorSessionWrapper.getNodeByIdentifier(ContentDecoratorSessionWrapper.java:129)
              at org.apache.jackrabbit.ocm.manager.impl.ObjectContentManagerImpl.getObjectByUuid(ObjectContentManagerImpl.java:275)
              ... 186 more
      Caused by: java.lang.IllegalArgumentException: NodeId.valueOf(null)
              at org.apache.jackrabbit.core.id.NodeId.valueOf(NodeId.java:54)
              at org.apache.jackrabbit.core.SessionImpl.getNodeByIdentifier(SessionImpl.java:1098)
              ... 196 more
      

      Related problem:
      Note also that the error feedback in this case is insufficient. There is only an ugly warning box, with untranslated i18n label, that disappears before you can read it. There is no entry in pulse, and no way to know what happened without going to the server logs.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                runger Richard Unger
              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Date of First Response: