Posted: 19 Jun 2016 15:07 EDT Last activity: 20 Jun 2016 17:38 EDT
Validate rules at the time of checking in
I am trying to stop users from checking in flows in "draft" mode. I know Pega by default shows the warning of the same rule being not executed in production, but still does not stop users from checking in the same rule in lower environments. What's the best way to validate at the time of checking in a flow in Draft Mode?
I am thinking of override the general Validate rule that gets called at the time of check in, but not very sure as to where in clipboard i should look for the current flow's mode being in "Draft" mode ON.
Thanks for the quick reply. Yes I tried that approach, problem is RH_1 or even a page called pySaveAsResults (of the same class Rule-) are in the scope of the rule thread (in my case the name of the clipboard thread is of the same name as the rule name), whereas on checking in a Rule, Pega runs the Validate validation rule on the STANDARD thread in clipboard , where it is not able to locate the Page or the property and hence the validation does not trigger.
Thanks Samanth and Murali for the help. Actually I was wrong with the thread thing. What Pega does is, at the time of checking in a rule it creates a pyWorkPage of class Work-ProjectManament-CheckIn. In it there is an embedded page of type rule-obj- called pyRulePage. This page holds the pyDraftModeON property, once I was able to redirect my validate rule to this one, I was able to achieve the desired output.
On Pega Exchange there is a utility called Pega Change Manager that allows you to monitor for non-compliant rules and send alerts or block check in of violations. I think it's worth a look as it does the same thing you are trying to do here.