0 Replies Latest reply on Sep 17, 2012 8:43 AM by giang.phan

    CQ5 Workflow Form and Process Step Race Condition

    giang.phan

      I have a workflow with a form step and a process step immediately proceeding it, or specifically its a translation workflow to get content translated. The form step adds JCR nodes to the workflow controlled resources (accounting, contact, and billing data). The process step then takes the workflow controlled resource and the form data saved to the resource and makes a package and sends it off to translation.

       

      The problem is there seems to be a race condition from the time the form submits, whether the JCR nodes will be saved first, or whether the process step will try to access them first.

      This causes the following exception in the process step:

       

       

      17.09.2012 15:20:02.570 *ERROR* [JobHandler: /etc/workflow/instances/2012-09-17/model_3762519111201666:/etc/workflow/packages/translat ion-job-1347895174790] com.day.cq.workflow.impl.job.JobHandler Process execution resulted in an error: javax.jcr.PathNotFoundException: /etc/workflow/packages/translation-job-1347895174790/jcr:content/sdl-briefing-data com.day.cq.workflow.WorkflowException: javax.jcr.PathNotFoundException: /etc/workflow/packages/translation-job-1347895174790/jcr:content/sdl-briefing-data

                at com.nike.cms.cq.workflow.SDLExportProcess.execute(SDLExportProcess.java:116)

                at com.day.cq.workflow.impl.job.HandlerBase.executeProcess(HandlerBase.java:184)

                at com.day.cq.workflow.impl.job.JobHandler.process(JobHandler.java:112)

                at org.apache.sling.event.jobs.JobUtil$1.run(JobUtil.java:272)

                at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)

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

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

      Caused by: javax.jcr.PathNotFoundException: /etc/workflow/packages/translation-job-1347895174790/jcr:content/sdl-briefing-data

                at org.apache.jackrabbit.core.ItemManager.getNode(ItemManager.java:565)

                at org.apache.jackrabbit.core.session.SessionItemOperation$6.perform(SessionItemOperation.ja va:129)

                at org.apache.jackrabbit.core.session.SessionItemOperation$6.perform(SessionItemOperation.ja va:125)

                at org.apache.jackrabbit.core.session.SessionItemOperation.perform(SessionItemOperation.java :187)

                at org.apache.jackrabbit.core.session.SessionState.perform(SessionState.java:200)

                at org.apache.jackrabbit.core.SessionImpl.perform(SessionImpl.java:355)

                at org.apache.jackrabbit.core.SessionImpl.getNode(SessionImpl.java:1054)

                at sun.reflect.GeneratedMethodAccessor46.invoke(Unknown Source)

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

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

                at org.apache.sling.jcr.base.SessionProxyHandler$SessionProxyInvocationHandler.invoke(Sessio nProxyHandler.java:109)

                at $Proxy0.getNode(Unknown Source)

                at com.nike.cms.cq.workflow.SDLExportProcess.assembleNodesForTranslation(SDLExportProcess.ja va:150)

                at com.nike.cms.cq.workflow.SDLExportProcess.execute(SDLExportProcess.java:103)

                ... 6 more

       

      This causes the workflow to be unable to proceed to the next step after exporting which is a waiting step. Is this a known problem with CQ5.4 workflows or is there anything you guys can suggest to do to fix this?