6.4.x: How to correctly use path selection with an OR Split? | Community
Skip to main content
jayv25585659
New Participant
April 23, 2019
Solved

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

  • April 23, 2019
  • 2 replies
  • 2613 views

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;

}

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

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by smacdonald2008

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 page

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

2 replies

jayv25585659
New Participant
April 23, 2019

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

New Participant
October 3, 2024

Just checking if you were able to address the issue? If so, can you share the details?

smacdonald2008
smacdonald2008Accepted solution
New Participant
April 23, 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 page

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