Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

Issue with AEM OR Split Step

abhishekk404823
Level 1
Level 1

I am trying to use the OR Split Step in AEM 6.4 workflow.

Before the OR Split Step I have a Process step that is setting a property "isApprover" in WF data the via sample code :

WorkflowData data = workItem.getWorkflow().getWorkflowData();

data.getMetaDataMap().put("isApprover", true);

Now in the OR Step I have two branches with the following config:

Branch 1 - ECMA Code:

function check(){

    var status = workflowData.getMetaDataMap().get("isApprover").toString();

    log.info("Approver check ECMA Script status is: " + (status=="true"));

    if(status=="true"){

  return true;

    }

    else{

        return false;

    }

}

Branch 2 : Marked as Default

Now the issue is that the workflow always goes into the branch marked as "default" and never goes into the branch 1 even when the check() function is returning true.

Please help in resolving this issue.

1 Reply
Gaurav-Behl
Community Advisor
Community Advisor

try with .indexOf()

if(status.indexOf("true")==0){... }