Chapter 8. Multiple branches in Business Central
Multiple branches support in Business Central provides the ability to create a new branch based on an existing one, including all of its assets. All new, imported, and sample projects open in the default master branch. You can create as many branches as you need and can work on multiple branches interchangeably without impacting the original project on the master branch.
Red Hat Decision Manager 7.8 includes support for persisting branches, which means that Business Central remembers the last branch used and will open in that branch when you log back in.
8.1. Creating branches
You can create new branches in Business Central and name them whatever you like. Initially, you will only have the default master branch. When you create a new branch for a project, you are making a copy of the selected branch. You can make changes to the project on the new branch without impacting the original master branch version.
- In Business Central, go to Menu → Design → Projects.
- Click the project to create the new branch, for example the Mortgages sample project.
Click master → Add Branch.
Figure 8.1. Create the new branch menu
testBranch1in the Name field and select master from the Add Branch window. Where
testBranch1is any name that you want to name the new branch.
- Select the branch that will be the base for the new branch from the Add Branch window. This can be any existing branch.
Figure 8.2. Add the new branch window
After adding the new branch, you will be redirected to it, and it will contain all of the assets that you had in your project in the master branch.
8.2. Selecting branches
You can switch between branches to make modifications to project assets and test the revised functionality.
Click the current branch name and select the desired project branch from the drop-down list.
Figure 8.3. Select a branch menu
After selecting the branch, you are redirected to that branch containing the project and all of the assets that you had defined.
8.3. Deleting branches
You can delete any branch except for the master branch. Business Central does not allow you to delete the master branch to avoid corrupting your environment. You must be in any branch other than master for the following procedure to work.
Click in the upper-right corner of the screen and select Delete Branch.
Figure 8.4. Delete a branch
- In the Delete Branch window, enter the name of the branch you want to delete.
- Click Delete Branch. The branch is deleted and the project branch switches to the master branch.
8.4. Building and deploying projects
After your project is developed, you can build the project from the specified branch in Business Central and deploy it to the configured KIE Server.
- In Business Central, go to Menu → Design → Projects and click the project name.
In the upper-right corner, click Deploy to build the project and deploy it to KIE Server.Note
You can also select the Build & Install option to build the project and publish the KJAR file to the configured Maven repository without deploying to a KIE Server. In a development environment, you can click Deploy to deploy the built KJAR file to a KIE Server without stopping any running instances (if applicable), or click Redeploy to deploy the built KJAR file and replace all instances. The next time you deploy or redeploy the built KJAR, the previous deployment unit (KIE container) is automatically updated in the same target KIE Server. In a production environment, the Redeploy option is disabled and you can click Deploy only to deploy the built KJAR file to a new deployment unit (KIE container) on a KIE Server.
To configure the KIE Server environment mode, set the
org.kie.server.modesystem property to
org.kie.server.mode=production. To configure the deployment behavior for a corresponding project in Business Central, go to project Settings → General Settings → Version and toggle the Development Mode option. By default, KIE Server and all new projects in Business Central are in development mode. You cannot deploy a project with Development Mode turned on or with a manually added
SNAPSHOTversion suffix to a KIE Server that is in production mode.
If the build fails, address any problems described in the Alerts panel at the bottom of the screen.
To review project deployment details, click View deployment details in the deployment banner at the top of the screen or in the Deploy drop-down menu. This option directs you to the Menu → Deploy → Execution Servers page.
For more information about project deployment options, see Packaging and deploying a Red Hat Decision Manager project.