Wednesday 23 October 2019

Ruleset Branching and Ruleset Merging in Pega

Ruleset Branching and Ruleset Merging in Pega


Hi Friends, In this post we will see about the topic Ruleset Branching and Merging.

Ruleset Branching enables developer to work in isolated ruleset without impacting development of other developers who is working in different project.

How it works?

Consider Team A works in enhancement_1 and Team B works in enhancement 2. Both teams are going to work on same application.

Conflicts will come when both team need a same rule to work. So to avoid these problems, Team A will create their own brance ruleset. Team B will create their own brance ruleset. 

Once development has been completed by teams they has to merge their rules which is in their branch ruleset to application ruleset. While Merging rule which have conflicts has to manually compare and fix by both team by their coordination. 

Steps in Ruleset Branching and Merging:

  • Create a development application that is built on the main application.
  • Add the access group for this application to the operator records for the team members.
  • Create the development branches.
  • Create the branch rulesets for the branches listed in the application rule.
  • Perform rule development using the branch rulesets.
  • Use the Merge Branches wizard to merge your branches.
Create New Application involve below steps:
  1. Create each application rule for both Teams(Team A and Team B).
  2. Map Newly created application to the base application(HRApps).

Create a New Application:

Login as administrator, Access group mapped to HRApps Application . We have to create separate application for Team A and Team B



New Application for Team A:


Base Application Mapped to HRApps, and its latest version . Save the rule once modified.


New Application for Team B:


Base Application Mapped to HRApps, and its latest version . Save the rule once modified.


Mapping Branch Ruleset in Application Rule:

Now we can add branch for each seperate application. Created a Branch Named TeamABranch  and save it.


Mapped Branch Named TeamBBranch in Team B application rule and Save rule.


Map Operator Access Group to respective Applications:

Consider Operator_1 going to work on Team A and  Operator_2 going to work on Team B.

We have to map Operator_1 to Team A access group and Operaor_2 to Team B access group.

Creating Access Group for Team A:

Created a new access group named HRApps_TeamA:Administrator and mapped Team A application in it.

Creating Access Group for Team B:

Created a new access group named HRApps_TeamA:Administrator and mapped Team A application in it.


Mapping Access Group to Operator ID:

Mapped Operator 1 to Team A access group, So If I logged in with Operator 1 application for Team A that we created will open.

Mapped Operator 2 to Team B access group, So If I logged in with Operator 2 application for Team B that we created will open.

Adding Branch Ruleset to application:

Click Create branch ruleset to create a new branch ruleset.


Branch Ruleset Creation:

Mapped Team A branch Id to Team A ruleset and we have to provide which ruleset we have to merge after work completion in Ruleset to Branch.


New Branch ruleset created for Team A. Save application rule and we have to similarly login in to Operator_B and we have to create separate Branch Ruleset for Team B 


Saving Rule to TeamABranch Ruleset:

Saved as rule pyGetPerimeter into TeamABranch Ruleset and did  modification in exisiting Rule.


Created a new decision table in TeamABranch. 

Saving Rule to TeamBBranch Ruleset:

Save as the same rule pyGetPerimeter in to TeamBBranch ruleset and make modification in table, so same rule we did saved to both branch . Conflict will arise while merging both rulesets.


Merging Branch Ruleset:

Merging Branch Ruleset will merge the branch ruleset into the base ruleset. Click Merge Branches in Application rule to merge branch ruleset to base ruleset.

Merge Branch Ruleset Wizard:

Wizard will display warning, conflicts in rule merging. Incase conflict came developer have to manually compare the difference then we have to develop in such a way that it should work for both team.


Click Warning or conflict to view the detail about rule merging warning


Merge result shows overview of the merging flow.



Thank you guys for reading this post.  If you have any doubts please ask in comment.

To view detailed explanation about Pega Branching and Merging visit below Pega help.