Close Activities When Conditional Start Begins
Application Type
Traditional Web
Service Studio Version
11.11.15 (Build 48647)

Hello everyone,

I am trying to create a workflow that will handle the opportunity approvals in my app. The flow should not end unless the opportunity is deleted. So the steps of the approvals go like InProgress - Requested - SMApproved - GMApproved - Approved or InProgress - Requested - Rejected. But when is it rejected it can send a request for approval again. Also whenever any opportunity data is changed the approval state needs to change to InProgress to get a new approval. 

I think I implemented most of it. Here is where I got stuck: When the process is in some waiting state (ex: waiting for Sales Manager approval) and it is changed to InProgress. Conditional Start begins but the previous activity is stuck. So whenever both flows are in the same activity there are two same activities running. I wanted to close old activities by using Activity_Close or Activity_Skip but it runs the automatic activity hence my opportunity gets approved without an actual approval.  


How can I close old activities when my conditional start begins?

Flow.JPG

Solution

Hi Ceyda,

That is expected. When you close (or skip) an activity the process moves forward.

From your example it seems you check to see if the sales manager approves it (there is an out sayin approve) but there is nothing for the General Manager.

Either way how are you checking if the General Manager (or the Sales Manager) is actually approving the request vs rejecting it versus in progress?

The condition start, starts a parallel execution meaning you have 2 branches of your flow running. 

Perhaps having a check before the approve to verify the true states of the process would work.

However and risking going out on a limb here, consider exploring alternative ways of solving this problem, for example, would this work for you?

Cheers

Hello Rui,

Thank you soo much for your time and effort. After almost 5 hours of trying I think I finally got it by following your suggestions and putting If statements after the activities. I also tried to implement your alternative way but couldn't do it right I guess. 

Though it still needs testing for all cases. It worked for basic tests that I did. Thank you so much again I've been stuck on this for days


Awesome Ceyda,

Although not related, check out this example on the forge, you might find it interesting.

Cheers

I'm checking it out. Thank youu so much

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.