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

Avatar

Avatar

jayv25585659

Avatar

jayv25585659

jayv25585659

22-04-2019

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;

}

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

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar

smacdonald2008

Total Posts

12.7K

Likes

1.4K

Correct Answer

2.3K

Avatar

smacdonald2008

Total Posts

12.7K

Likes

1.4K

Correct Answer

2.3K
smacdonald2008

22-04-2019

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.

Answers (1)

Answers (1)

Avatar

Avatar

jayv25585659

Avatar

jayv25585659

jayv25585659

23-04-2019

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