I have a requirement from our Change Management team to block a specific Manager Approval task from being completed in Classic Workflow if there is no Risk Survey filled out on the change. There are 2 caveats to this criteria..
I've managed 2 out of 3 of the TRUE conditions so far.
For the survey:
For the PAM Auto Complete
But how can I check the NEW status? I've tried testing the status field but it only evaluates to true when I test for the current status. What I want is something like: New Status = Info Required
A more open ended condition that would be more flexible would be New Status.task_complete = 0
But if I can't query the value selected, how can I pull this off?
You might have to put your status condition into a post_validate trigger? If you pass 'status' as an argument to your validation function you will have both the old and the new values available in the argument vector, you can look up 'task_complete' with an 'expand' call, and you can fail the update by returning an error code if task_complete has the wrong value.
Hope that helps!
You're talking about in a spel code trigger with a .MOD file, right? The problem with that is 2 fold. 1) I'm not well versed in Spell. 2) That usually triggers universally on all status changes on all tasks. I need this transition to function only on a specific task in a few specific workflows. It's a targetted use case which would make the transition rules a viable solution except for this one pesky issue.
Pesky is the word ☺. I wonder if you could split the Manager Approval into two serial tasks - the first checking whether the Risk Survey has been done and auto-completing in a 'Pending' behaviour if it has, and the second being the actual Approval? PAM will have to complete both tasks as 'not required' if that is the case, and the Manager Approval task simply won't go Pending if the Risk Survey isn't done. You could add a notification to the Risk Survey task if it goes Pending and there is no survey, and have the Pending behaviour set the task status to something like 'Awaiting Risk Survey'. Someone or something will have to complete that task, of course. Since you're using PAM already, perhaps you could trigger a little PAM process from a 'Risk Updated' Activity Notification, to check for an 'awaiting risk survey' task and complete it.
Hope that helps, anyway! I look forward to hearing how you decide to attack it.
Too much overheard and potential user complaints to split the tasks into 2 to try and accomplish this goal. After review of the process where this is feature is required the Info Required option is rarely if ever used. So we made a decision that going forward it won't be allowed to be use. So I removed the behavior from those tasks that will use the transition condition and the only available choices for selection are now statuses that complete the task, none of which they are allowed to select without the Risk Survey. It doesn't help me for future use cases but it'll suffice for now.
I can't trigger on the Risk Updated activity because its set by default to Medium and may stay that way depending on how the Risk Survey is filled out.
However, what I have done is added a trigger to a MOD file that checks for the insertion of a new Risky Survey like this...
MODIFY risk_svy POST_CI zcheck_risk(id,chg_id) 2000 FILTER (EVENT("INSERT"));
And that runs some spel code which grabs the key info from the change, logs it and then inserts an event into the Change ticket. The event launches an Execute PAM Macro. The Macro runs a PAM process that is designed to read the survey, gather the Risk Ranges, Questions, Answers, Workflow Tasks and Properties and then takes certain actions based on the answers per requirements that I was given. Seems to be working pretty well in Dev so far.