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.

One way to Create A Conditional Loop In AEM WorkFlow | AEM Community Blog Seeding

Avatar

Administrator

BlogImage.jpg

One way to Create A Conditional Loop In AEM WorkFlow by Heena Shirke

Abstract

1. Create a workflow variable - Example: loopcount


The value of the workflow variable is maintained throughout the workflow instance


2. Increment the variable using Set Variable Step - Example: loopcount=loopcount+1


Changes to variable values affect only the instance of the process in which the change occurs. For example, when a workflow is initiated and variable data changes, the changes affect only that instance of the workflow. The changes do not affect other instances of the workflow that were initiated previously or are initiated subsequently.


3. Add rule a definition in Goto Step to define the exit criteria - Example: loopcount<10


The Goto Step allows you to specify the next step in the workflow model to execute, dependent on the result of a routing expression.

You can use variables to define the routing expression using the expression editor. In this example, the Goto step specifies the Tester Process Step(i.e. Step before Or Split) as the next step if the value for the loocount variable is less than 10 thus creating a loop. If the loopcount increases to 11 the workflow will exit the loop and go to normal flow.

Read Full Blog

One way to Create A Conditional Loop In AEM WorkFlow

Q&A

Please use this thread to ask the related questions.



Kautuk Sahni
0 Replies