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

Wait for first workflow to finish before starting second

Avatar

Avatar
Give Back
Level 1
troubleshooter3
Level 1

Like

1 like

Total Posts

18 posts

Correct Reply

0 solutions
Top badges earned
Give Back
Boost 1
View profile

Avatar
Give Back
Level 1
troubleshooter3
Level 1

Like

1 like

Total Posts

18 posts

Correct Reply

0 solutions
Top badges earned
Give Back
Boost 1
View profile
troubleshooter3
Level 1

24-08-2020

This is very straight forward situation where my first workflow sets up some values and second workflow uses those values to do something. My problem is 1st workflow takes time to set up those values and second workflow is unable to get the values 1st workflow sets up. How can I make sure to wait till 1st Workflow is completed before invoking second. Below is my code, It is doing the trick but I am not sure if thats the right way.

 

while (wfSession.getWorkflows(new String[] { "RUNNING" }).length != 0) {
LOG.info("Waiting to Finish");

}

 

In above solution I am getting count of workflow associated with current session with status Running. once its zero I exit the loop. My concern is what if workflow keeps in running state due to an error or any other thing.

 

 

View Entire Topic

Avatar

Avatar
Establish
MVP
Nupur_Jain
MVP

Likes

165 likes

Total Posts

186 posts

Correct Reply

76 solutions
Top badges earned
Establish
Ignite 1
Give Back 5
Give Back 3
Give Back 25
View profile

Avatar
Establish
MVP
Nupur_Jain
MVP

Likes

165 likes

Total Posts

186 posts

Correct Reply

76 solutions
Top badges earned
Establish
Ignite 1
Give Back 5
Give Back 3
Give Back 25
View profile
Nupur_Jain
MVP

24-08-2020

HI @troubleshooter3 

 

you have two different workflows, why not start second workflow model when first workflow model finishes. for this, there is "Container Step" component which you can drop as first workflow's last step and configure which workflow you want to start next.

 

Screenshot from 2020-08-24 15-42-02.png

Screenshot from 2020-08-24 15-43-34.png

 

Refer https://docs.adobe.com/content/help/en/experience-manager-64/developing/extending-aem/extending-work... to understand container step.

 

Hope it helps!

Thanks!

Nupur