Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.

Issue with AEM OR Split Step

Avatar

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

Avatar

Level 10

try with .indexOf()

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