Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

like image 343
Dileepa Avatar asked Oct 23 '25 16:10

Dileepa


1 Answers

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

like image 151
marwell Avatar answered Oct 25 '25 04:10

marwell



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!