Question
Achieve process processing in business specific way.
We are creating one automation solution with below processes, where process 1 is the Mainflow whereas 'process 2' should execute every 5 minutes. The business expectation : When process 2 starts every 5 minutes, all the activities in process 2 should run completely and then resume the process 1 activity where it left earlier. How to accomplish this request using Pega Robotic Studio? We are using Timer tick to start 'process 2' but the execution happens back and forth between process 1 (Mainflow)and process 2 for each step inside the activity.
Process 1:
Activity 1 (Consider all Activities as separate Automation.OS with various steps accomplished)
Activity 2
Activity 3
Activity 4
Activity 5
... Activity n
Process 2 :
Activity 2
Activity 3
Activity 4
First off; I am going to use the term "Activity" to mean the Activity component used with the Interaction Framework.
I would suggest that you break process 1 into separate Activities for each step. You could then use a timer to start an Activity for process 2. Since Activities are queued, process 1 step N would need to complete before process 2 would start. Since you've broken process one into small pieces, the delay in starting process 2 would be minimal. There'd be no way to instantly stop process 1 in a way that lets you resume from where you left off otherwise; particularly during a wait for something (not that you'd want to leave in the middle of something happening).
Whenever you start process 1, you would call StartActivity on all of the various Activities you have created for each step of the process. When your timer fires, you would call StartActivityNow for process 2, which would move it to the top of the queue and leave the remaining parts of process 1 intact in the queue. You would need to think about the state of the application you are automating to ensure it is put back if required for process 1 to be able to continue (if both processes are using the same app).