Managing decision service branches

Use copy and delete functionality to manage the branches in a decision service. Work in Decision Center in either the Business console or REST API.

When you delete a branch in a decision service, you also delete its dependent branches. The following example shows a main branch and four branches that stem from the main branch:

main
  - branch 1 
   - branch 2
    - branch 3  
     - branch 4 (latest branch)
 

If you delete branch 1, you also delete branches 2, 3 and 4. The main branch remains unaffected, but its subbranches are deleted. Similarly, if you delete branch 3, you also delete branch 4, but the main branch and branches 1 and 2 remain in the decision service.

Because branches are created from existing branches, you can add several branches to a decision service over time. If you delete a branch that is no longer used, you also delete its dependent branches, which can include the latest branch. In the example, if you delete branch 2, you also delete branch 4, which is the latest branch.

Keeping the latest branch

To keep the latest branch, make a copy of it in the decision service. Then, you can delete its parent branch without losing its contents.

In the example, before you delete branch 1, copy branch 4, and make main the parent branch of the new branch:

main 
  - branch 4 copy 
  - branch 1
   - branch 2
    - branch 3
     - branch 4 (latest branch)
 

The new branch is independent from branch 1. Now, you can delete branch 1 and its dependent branches without losing the contents of branch 4, which are in the new branch. You can continue working in the decision service by using the new branch (branch 4 copy).

Important:
  • When you copy a release branch, you copy all of its artifacts. However, if the branch has activities, they are not copied into the new release. To copy the changes in the activities, close the activities, merge their changes into the release, and then copy the release.
  • Always test a new branch before deleting its source branch. If there is a problem with the new branch, you can go back to the source branch if necessary. When you are certain that the new branch works correctly, you can confidently delete the source branch.

Using the Business console

You can copy only release branches in the Business console. To copy a release and delete older releases in the Business console:

  1. Open your decision service in the Business console.
  2. In the Releases tab, click the down arrow next to the name of the release that you want to copy.
  3. Click Copy in the action menu.
  4. Select Initial Release as the parent release for the new branch. You can also enter a name for the copy.
  5. Click Copy to complete the action. A release branch is created under the initial release in the decision service.
    Tip: Before deleting the copied branch, check that the new branch works correctly.
  6. Click the down arrow next to the name of the release that you want to delete.
  7. Click Delete in the action menu. A dialog box opens to confirm the action.
  8. Click Yes to delete the release. The console deletes the old release and its dependent branches.

Now, you can use the new release to continue working in the decision service.

Using the REST API

You can copy both regular and release branches in the Decision Center REST API. To copy a branch in the REST API:

  1. Open the REST API.
  2. Complete the fields in the endpoint /v1/branches/{branchId}/copy.
  3. Click the Try it out button. Depending on the type of branch, the REST API creates a regular branch under the main branch or a release branch under the initial release in the decision service.
    Tip: Before deleting the copied branch, check that the new branch works correctly.
  4. To delete a branch, complete the fields in the endpoint /v1/branches/{branchId}/delete.
  5. Click the Try it out button. The REST API deletes the branch and its dependent branches.

Now, you can work in the new branch in the decision service.