Question
Accenture
NL
Last activity: 12 Jul 2024 10:43 EDT
Delete empty branches from the Application
In our application, after the branches are merged through the Pipeline, the rules in the branches are cleared but the branch is not deleted. We are left now with 1000+ empty branches. When i searched for the solution, I saw a post with the below answer, but the answer is not so clear. Not sure if this was working in Pega lower version, I cant find this method in Branch API. We use Pega 23.
To delete empty branches automatically, you can use the Pega API. You can create an activity that calls the `Branch` API and uses the `deleteBranch` method to delete empty branches. In the `deleteBranch` method, you can specify the branch name and the `deleteEmpty` parameter as `true` to delete empty branches.
Here is an example of how to use the `deleteBranch` method in an activity:
``` Call Branch.deleteBranch with parameters: .BranchName = "BranchName" .deleteEmpty = true ```
You can then schedule this activity to run at a specific time interval to automatically delete empty branches.