Expand my Community achievements bar.

SOLVED

6.4.x: How to correctly use path selection with an OR Split?

Avatar

Level 8

AEM site setup:

4 sites have been setup in /content.

  • /content/site1/en
  • /content/site2/en
  • /content/site3/en
  • /content/site4/en

---------------------------------

So I was reading this guide/example (Creating Workflow Models ) on how to setup path selection on an OR Split.

Using this example, I create  4-branch OR Split and each branch having its own script (see below for code).

My problem is that the path selection is not working properly.

tests I've done:

  • I request for publication a page in /content/site3/en and the notification email that I received says "Step: Email site2 admin"
  • I request for publication a page in /content/site2/en and the notification email says it's from site3
  • I request for publication a page in /content/site1/en and the notification email says it's from site3.

Any ideas what I could be doing wrong? Thanks

------------

Workflow screenshot showing the Or Split + the participant steps for each branch: https://i.imgur.com/10SUSCX.png

-------------

branch1 script

function check() {

    if (workflowData.getPayloadType() == "JCR_PATH") {

         var path = workflowData.getPayload().toString();

         var node = jcrSession.getItem(path);

         

         if (node.getPath().indexOf("/content/site1/en") != -1) {

            return true;

         } 

     }

     return false;

}

-------------

branch2 script

function check() {

    if (workflowData.getPayloadType() == "JCR_PATH") {

         var path = workflowData.getPayload().toString();

         var node = jcrSession.getItem(path);

         

         if (node.getPath().indexOf("/content/site2/en") != -1) {

            return true;

         } 

     }

     return false;

}

-------------

branch3 script

function check() {

    if (workflowData.getPayloadType() == "JCR_PATH") {

         var path = workflowData.getPayload().toString();

         var node = jcrSession.getItem(path);

         

         if (node.getPath().indexOf("/content/site3/en") != -1) {

            return true;

         } 

     }

     return false;

}

-------------

branch4 script

function check() {

    if (workflowData.getPayloadType() == "JCR_PATH") {

         var path = workflowData.getPayload().toString();

         var node = jcrSession.getItem(path);

         

         if (node.getPath().indexOf("/content/site4/en") != -1) {

            return true;

         } 

     }

     return false;

}

-------------

1 Accepted Solution

Avatar

Correct answer by
Level 10

We have an article that shows you how to work with OR SPLITS and get them working. See --

Adobe Experience Manager Help | Invoking an Adobe Experience Manager Custom 6.4 Workflow from a web ...

This clearly shows use of using an OR Split within AEM Workflows.

View solution in original post

2 Replies

Avatar

Correct answer by
Level 10

We have an article that shows you how to work with OR SPLITS and get them working. See --

Adobe Experience Manager Help | Invoking an Adobe Experience Manager Custom 6.4 Workflow from a web ...

This clearly shows use of using an OR Split within AEM Workflows.

Avatar

Level 8

Looking at the link, it seems what I want can't be done without custom code?