Search

Chapter 6. Business processes in Business Central

download PDF

A business process is a diagram that describes the order in which a series of steps must be executed using a flow chart. A business process consists of a collection of nodes that are linked to each other using connections. Each of the nodes represents one step in the overall process while the connections specify how to transition from one node to the other.

The sample Mortgage_Process contains the following predefined MortgageApprovalProcess business process.

sampleBP

6.1. Creating the business process

The following procedures guide you through the creation of tasks, connections, and gateways that make up the MortgageApprovalProcess business process. The mortgage validation business process determines whether a mortgage application contains all required data. If the specified data requirements are met, the application proceeds on to the mortgage calculation business process.

Procedure

  1. In Business Central, go to Menu Design Projects mortgage-process.
  2. Click Add Asset Business Process.
  3. Enter the following values:

    • Business Process: MortgageApprovalProcess
    • Package: Select com.myspace.mortgage_process

      The Package specifies the location inside the existing project where the asset will be created. In this example, it is created in com/myspace/mortgage_process.

  4. Click Ok. The diagram editor opens.
  5. In the upper-right corner, click the Properties diagram properties icon.
  6. Scroll down and expand Process Data and click btn plus in the Process Variables section.
  7. Enter the following values:

    • Name: application
    • Data Type: Application [com.myspace.mortgage_process]

6.1.1. Creating outgoing connections and exclusive gateways

This section shows you how to create outgoing connections, exclusive gateways, and business rule tasks. Use exclusive gateways to make decisions and react to events based on the available data.

Red Hat Process Automation Manager contains a predefined selection of node types to simplify business process creation. The predefined node panel is located on the left side of the diagram editor.

node panel

Procedure

  1. Drag a start event node on to the canvas.
  2. Create an outgoing connection from the start event to an exclusive gateway:

    1. On the canvas, click the start event node and click the Create Parallel icon.

      create parallel
    2. Hover over the config icon icon of the parallel and click the Convert into Exclusive icon.

      exclusive gateway
  3. Create an outgoing connection from the exclusive gateway to a business rule task:

    1. On the canvas, click the exclusive gateway and click the Create Task icon.

      create task
    2. Hover over the config icon icon of the task and click the Convert into Business Rule icon.

      bus rule task
  4. Configure the business rule task:

    1. Click the business rules task.
    2. If the Properties panel is not open, in the upper-right corner click the Properties diagram properties icon.
    3. In the Properties panel, enter Validation in the Name field.
    4. Expand Implementation/Execution, select New from the Rule Flow Group menu, and input validation.
    5. In the On Exit Action field, enter the following Java expression:

      System.out.println(application.getProperty());
    6. Expand Data Assignments and click btn assign next to Assignments.
    7. In the Validation Data I/O window, click Add and create the following assignments:

      val data io
  5. Above the canvas, click Save to confirm your changes.

6.1.2. Defining the validation data

This section shows you how to define the validation data that determines whether the application data is correct, contains an error, or has missing information.

Procedure

  1. Create an outgoing connection from the Validation task to an exclusive gateway:

    1. Click the Validation task and click the Create Parallel icon.
    2. Hover over the config icon icon of the parallel and click the Convert into Exclusive icon.

      exclusive gateway
  2. Create an outgoing connection from the exclusive gateway to a new business rule task:

    1. Click the exclusive gateway and click the Create Task icon.
    2. Drag the new task below the exclusive gateway as shown below.
    3. Hover over the config icon icon of the task and click the Convert into Business Rule icon.

      new br task
    4. If the Properties panel is not open, in the upper-right corner click the Properties diagram properties icon.
    5. In the Properties panel, enter Retract Validation in the Name field.
    6. Expand Implementation/Execution, select New from the Rule Flow Group menu, and input error.
  3. Configure the connection between the exclusive gateway and the business rule task:

    1. Click the connection.

      created connection
    2. If the Properties panel is not open, in the upper-right corner click the Properties diagram properties icon.
    3. In the Properties panel, enter Invalid in the Name field.
    4. Expand Implementation/Execution and select Expression in the Condition Expression section.
    5. From the list, select drools and enter ValidationErrorDO() in the Condition Expression field.

      languagedropdown
  4. Create an outgoing connection from the Retract Validation task to a new user task:

    1. Click the Retract Validation task and click the Create Task icon.
    2. Drag the new task below the Validation task as shown below.
    3. Hover over the config icon icon of the task and click the Convert into User icon.

      user task
    4. Click on the new user task and in the Properties panel, enter Correct Data in the Name field.
    5. Expand Implementation/Execution and enter CorrectData in the Task Name field.
    6. Select New from the Groups menu, and input broker.
    7. Click btn assign next to Assignments.
    8. In the Correct Data Data I/O window, click Add and create the following assignments:

      correct data io
    9. Above the canvas, click Save to confirm your changes.
  5. Click on the Correct Data user task, then click the Create sequence Flow icon and drag it back to the first exclusive gateway. Your workflow should look similar to the following diagram:

    workflow1

6.1.3. Calculating the mortgage

The mortgage calculation business process determines the applicant’s mortgage borrowing limit.

Procedure

  1. Return to the second exclusive gateway and create an outgoing connection to a new business rule task.

    second gateway
  2. Click the created connection and in the Properties panel, input Valid in the Name field.

    1. Expand Implementation/Execution and select Expression in the Condition Expression section.
    2. From the list, select drools and enter not ValidationErrorDO() in the Condition Expression field.
  3. Click the new business rule task and in the Properties panel, input Mortgage Calculation in the Name field.

    validconnection
    1. Expand Implementation/Execution, select New from the Rule Flow Group menu, and input mortgagecalculation.
  4. Expand Data Assignments and click btn assign next to Assignments.
  5. In the Mortgage Calculation Data I/O window, click Add to create the following assignments and click Save.

    mortgage calc assignments
  6. Click an empty space on the canvas, scroll down, expand Process Data, and click btn plus next to Process Variables. Enter the following values:

    • Name: inlimit
    • Date Type: Boolean
  7. Create an outgoing connection from the Mortgage Calculation task to a new user task.
  8. Click the user task, enter Qualify in the Name field.

    qualify task
  9. Expand Implementation/Execution and enter Qualify in the Task Name field.
  10. Select New from the Groups menu, and input approver.
  11. Click btn assign next to Assignments. In the Qualify Data I/O window, click Add to create the following assignments:

    qualify io
  12. Above the canvas, click Save to confirm your changes.
  13. Click on the Qualify user task, click on the Create parallel menu icon, and convert it to an exclusive gateway.
  14. Drag the new exclusive gateway below the Qualify user task.
  15. Create an outgoing connection from the exclusive gateway and connect it to a new user task.
  16. Click the connection and input In Limit in the Name field of the Properties panel.
  17. Expand Implementation/Execution and select Condition in the Condition Expression section.
  18. Select inlimit from the Process Variable drop-down menu and select Is true from the Condition drop-down menu.

    inlimit true
  19. Click the user task, enter Final Approval in the Name field.
  20. Expand Implementation/Execution and enter FinalApproval in the Task Name field.
  21. Select New from the Groups menu, and input manager.
  22. Click btn assign next to Assignments. In the Final Approval Data I/O window, click Add to create the following assignments:

    approval io
  23. Above the canvas, click Save to confirm your changes.

6.1.4. Increasing the down payment

The increasing the down payment business process checks to see if the applicant qualifies for the loan by increasing their down payment. The final result is either the final loan approval, or loan denial based on the applicant’s inability to increase the down payment.

Procedure

  1. Click on the Final Approval user task and select Create End from the user task quick menu.
  2. Move the end event below the Final Approval user task.

    create end
  3. Return to the exclusive gateway that connects with the Final Approval user task. Create a second outgoing connection and connect it to a new user task.

    new task
  4. Click the connection and input Not in Limit in the Name field of the Properties panel.
  5. Expand Implementation/Execution and select Condition in the Condition Expression section.
  6. Select inlimit from the Process Variable drop-down menu and select Is false from the Condition drop-down menu.
  7. Click an empty space on the canvas, scroll down, expand Process Data, and click btn plus next to Process Variables. Enter the following values:

    • Name: incdownpayment
    • Data Type: Boolean

      proc var new
  8. Click the new user task and in the Properties panel, input Increase Down Payment in the Name field.
  9. Expand Implementation/Execution and enter IncreaseDownPayment in the Task Name field.
  10. Select New from the Groups menu, and input broker.
  11. Click btn assign next to Assignments. In the Increase Down Payment Data I/O window, click Add to create the following assignments:

    increase down io
  12. Above the canvas, click Save to confirm your changes.
  13. Click on the Increase Down Payment user task, click on the Create parallel menu icon, and convert it to an exclusive gateway.
  14. Drag the new exclusive gateway below the Increase Down Payment user task.
  15. Create an outgoing connection from the exclusive gateway to an end event.
  16. Click the connection and input Down payment not increased in the Name field of the Properties panel.
  17. Expand Implementation/Execution and select Expresssion in the Condition Expression section.
  18. Input return !incdownpayment; and select java from the drop-down menu.
  19. Create an outgoing connection from the exclusive gateway and connect it to the first exclusive gateway.
  20. Click the connection and input Down payment increased in the Name field of the Properties panel.
  21. Expand Implementation/Execution and select Expresssion in the Condition Expression section.
  22. Input return incdownpayment; and select java from the drop-down menu.
  23. Above the canvas, click Save to confirm your changes and save the entire business process.

Figure 6.1. Final version of the business process

finalBP
Red Hat logoGithubRedditYoutubeTwitter

Learn

Try, buy, & sell

Communities

About Red Hat Documentation

We help Red Hat users innovate and achieve their goals with our products and services with content they can trust.

Making open source more inclusive

Red Hat is committed to replacing problematic language in our code, documentation, and web properties. For more details, see the Red Hat Blog.

About Red Hat

We deliver hardened solutions that make it easier for enterprises to work across platforms and environments, from the core datacenter to the network edge.

© 2024 Red Hat, Inc.