Close standard change automatically after Post Implementation Review task is closed

TEdwards
Kilo Sage

 

I need to write a Wait for Condition script for our Standard Change Workflow so that I can set the value for the change to close automatically after the post implementation review task is closed. Our current workflow is attached. We use a subflow for the change tasks, so I assume I would need to write the script to wait for that subflow to complete, but I am not quite sure how to go about it. Can anyone assist?

5 REPLIES 5

Chuck Tomasi
Tera Patron

Is the PIR task generated in the subflow? It appears that you have other things to check (like the state in that if block). Are you sure you always want to close the change request after that subflow is done? If so, just put an Set Values activity on the workflow and close it (assuming this workflow is running on the change_request table)

Yes, the PIR task is generated in the subflow (which I have attached). And we do want to close the change request after the subflow is done because at that point there is no further work to do and we are having a problem getting people to manually close the change. If I just put a Set Values activity on the workflow immediately following the Set Values activity that moves the change to Review, what would be the triggering action? It seems like there should be something between the two Set Values, which is why I was assuming a Wait for Condition to trigger the Move to Closed Set Value.

Andrew Saxton -
Tera Expert

One solution would be to change a value on the change request via the subflow once it is finished, which would then trigger a wait for condition on the change request.

Thanks!

-Andrew

jim pisello
Giga Expert

Another option would be to write a scripted Wait For Condition activity in your main workflow that queries the Change Task table for all records related to the current change. If it finds any that are unclosed (e.g. still active), don't allow the workflow to advance (return false, I believe). If all change tasks have been closed, then advance to another workflow activity that closes the change.

Note that if you do take this route you'll want to be sure that the SNC - Run parent workflows business rule is active (it runs on the base Task table so it should be).