Search code examples
javascriptworkflowaemecma

Failing to understand "OR split" in AEM workflow


I have a workflow.

In the first step it sets a variable called language.

WorkflowData data = workItem.getWorkflow().getWorkflowData();
data.getMetaDataMap().put("language", "English");
workflowSession.updateWorkflowData(workItem.getWorkflow(), data);

Next is "OR SPLIT", it has 2 branches with ECMA script First branch is checked with default and has following

function check(){
   var action = workflowData.getMetaDataMap().get("language");
   return (action == "en_US");
}

Second branch has only,

function check(){
   return true;
}

When the flow runs through first branch, it works fine. If it goes through second branch I face following error.

com.adobe.granite.workflow.WorkflowException: No route found to continue from step node1 in model /etc/workflow/models/example/jcr:content/model. Probably a configuration error.
    at com.adobe.granite.workflow.core.WorkflowSessionImpl.getRoutes(WorkflowSessionImpl.java:734)
    at com.adobe.granite.workflow.core.job.HandlerBase.complete(HandlerBase.java:497)
    at com.adobe.granite.workflow.core.job.JobHandler.process(JobHandler.java:336)
    at org.apache.sling.event.impl.jobs.JobConsumerManager$JobConsumerWrapper.process(JobConsumerManager.java:512)
    at org.apache.sling.event.impl.jobs.queues.JobRunner.run(JobRunner.java:205)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)

enter image description here


Solution

  • have you tried adding a no operation step to the second branch?