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
BedrockMission!

Learn More

View all

Sign in to view all badges

Issue with AEM OR Split Step

Avatar

Avatar
Level 1
abhishekk404823
Level 1

Likes

0 likes

Total Posts

2 posts

Correct Reply

0 solutions
View profile

Avatar
Level 1
abhishekk404823
Level 1

Likes

0 likes

Total Posts

2 posts

Correct Reply

0 solutions
View profile
abhishekk404823
Level 1

13-02-2019

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.

Replies

Avatar

Avatar
Give back 300
MVP
Gaurav-Behl
MVP

Likes

243 likes

Total Posts

1,145 posts

Correct Reply

281 solutions
Top badges earned
Give back 300
Give Back 50
Give Back 5
Give Back 3
Give Back 25
View profile

Avatar
Give back 300
MVP
Gaurav-Behl
MVP

Likes

243 likes

Total Posts

1,145 posts

Correct Reply

281 solutions
Top badges earned
Give back 300
Give Back 50
Give Back 5
Give Back 3
Give Back 25
View profile
Gaurav-Behl
MVP

14-02-2019

try with .indexOf()

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