How can we manage the order of rules getting saved while copying rules from Higher RSV to lower RSV?

Hi all,

This is a query regarding a difficulty I am facing in moving rules in bulk from one RSV to another.


I have built a Rule Movement tool that will allow user to select the Ruleset & Rulesetversion (Ruleset can be specified as ALL) & then list all the rules based on the selection. I also provide filter options to allow developers to select rules updated by them or belonging to a specific user story, date updated etc

Once the developer makes his/her selection (by ticking checkboxes) then clicking on Copy rules button will loop over the selected results & call Rule-SaveToNewVersion.


When we move rules from higher RSV (say 01-01-99) to lower RSV (say 01-01-51), sometimes the activity rule may get copied before a property rule that it is referencing. If the property rule is created newly in v99 then activity doesnt get copied to lower version due to the dependency.

Is there a workaround by which

1. We can ignore the validations done by Pega in order to not throw these dependency errors?

2. Is there an easy way we can sequence the rule copy so that all the child rules are saved first & then the parent rules?

How does Pega handle this scenario while importing rules / in Copy Ruleset option in Refactor Rulesets landing page?

Any help would be greatly appreciated.



***Moderator Edit-Vidyaranjan: Updated SR details***

Group Tags


Keep up to date on this post and subscribe to comments

November 22, 2019 - 3:10am

Nice to see that someone tweaking the Pega functionality :)

Did you trace it? You could see where exactly it fails and on what validation steps.

Plus, you could trace Copy Ruleset wizard to see how it is doing that and why it doesn't throw an error

November 22, 2019 - 5:20am

Thanks :) !! 

The failure happens in the RULE-OBJ-ACTIVITY.Validate activity in step 19 with below Java code:

  1. try {
  2. pega.checkJavaGeneration();
  3. } catch (Throwable t) {
  4. tools.getPrimaryPage().addMessage("pyJavaGenerationFailed\t" + t.getMessage());
  5. }

I did try tracing the Rule Refactor wizard as well but it executes a lot of complicated java steps & it is extremely difficult to follow the logic as a whole. So was wondering if anybody has done this before then I wont have to reinvent the wheel :) :)