此内容没有您所选择的语言版本。
Chapter 5. MortgageApprovalProcess business process in Business Central
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.
For this tutorial, delete the existing MortgageApprovalProcess business process and recreate it to gain a better understanding of creating a business process. Creating a new business process using the same name ensures that the sample project deploys and tests without error.
Procedure
-
In Business Central, go to Menu
Design Projects Mortgage_Process. -
Input
MortgageApprovalProcess.bpmnin to the project’s asset search box and click MortgageApprovalProcess. - Select Delete from the toolbar, and click Delete to confirm that you want to delete this asset.
The following procedures guide you through the creation of each task, connection, and gateway that comprises the MortgageApprovalProcess business process.
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.
5.2.1. Validating the mortgage 复制链接链接已复制到粘贴板!
The mortgage validation business process determines whether the new application contains the required data before proceeding. If all of the specified data requirements are met, the application moves on to the mortgage calculation business process.
Procedure
-
In Business Central, go to Menu
Design Projects Mortgage_Process. -
Click Add Asset
Business Process. Enter the following values:
-
Business Process:
MortgageApprovalProcess Package: Select
com.myspace.mortgage_appThe Package specifies the location inside the existing project where the asset will be created. In this example, it is created in
com/myspace/mortgage_app.
-
Business Process:
- Click Ok. The diagram editor opens.
-
In the upper-right corner, click the Diagram properties
icon.
-
Scroll down and expand Process Data and click
in the Process Variables section.
Enter the following values:
-
Name:
application. -
Data Type:
Application [com.myspace.mortgage_app]
-
Name:
Create an outgoing connection to an exclusive gateway. Exclusive gateways are used to make decisions and react to events based on the available data.
Procedure
Click on the start event and create an outgoing connection from the start event to an exclusive gateway.
Create an outgoing connection from the exclusive gateway to a task.
Convert the new task to a business rule task.
-
Click on the business rules task and enter
Validationin the Name field of the Diagram properties panel. - Expand Implementation/Execution, select validation in the Rule Flow Group field.
Define the following Java expression in the On Exit Action field :
System.out.println(application.getProperty());
System.out.println(application.getProperty());Copy to Clipboard Copied! Toggle word wrap Toggle overflow -
Scroll down and expand the Data Assignments section and click
next to Assignments.
In the Validation Data I/O window, click Add to create the following assignments:
- Click Save.
- In the diagram editor, click Save, and Save, to confirm your changes.
5.2.3. Defining the validation data 复制链接链接已复制到粘贴板!
This section describes how to define the data that determines whether the application data is correct or contains an error or any missing information.
Procedure
Click on the Validation task and create an outgoing connection to an exclusive gateway.
Create an outgoing connection from the exclusive gateway to a new business rule task.
Click the created connection.
-
In the Diagram properties panel, input
Invalidin the Name field. - Expand Implementation/Execution, select Expression in the Condition Expression section.
-
Enter
ValidationErrorDO()in the drools expression field. -
Click on the business rule task and enter
Retract Validationin the Name field of the Diagram properties panel. -
Expand Implementation/Execution and enter
errorin the Rule Flow Group field. Create an outgoing connection from the Retract Validation task to a new user task.
-
Click the user task and in the Diagram properties panel, input
Correct Datain the Name field. Expand Implementation/Execution and enter the following values:
-
Task Name:
CorrectData -
Groups:
broker
-
Task Name:
-
Click
next to Assignments. In the Correct Data Data I/O window, click Add to create the following assignments:
In the Correct Data Data I/O window, click Add to create the following assignments:
- Click Save.
Connect the Correct Data back to the first exclusive gateway. Your workflow should look similar to the following diagram:
5.2.4. Calculating the mortgage 复制链接链接已复制到粘贴板!
The mortgage calculation business process determines the applicant’s mortgage borrowing limit.
Procedure
Return to the second exclusive gateway. Create an outgoing connection to a business rule task.
-
Click the created connection and in the Diagram properties panel, input
Validin the Name field. -
Expand Implementation/Execution, select Expression in the Condition Expression section, and enter
not ValidationErrorDO()in the drools expression field. -
Click the created business rule task and in the Diagram properties panel, input
Mortgage Calculationin the Name field. -
Expand Implementation/Execution and select
mortgagecalculationfrom the Rule Flow Group drop-down menu. -
Expand Data Assignments and click
next to Assignments.
In the Mortgage Calculation Data I/O window, click Add to create the following assignments and click Save.
Click on an empty space on the canvas, scroll down, expand Process Data, and click
next to Process Variables. Enter the following values:
-
Name:
inlimit -
Date Type:
Boolean
-
Name:
Create an outgoing connection from the Mortgage Calculation task to a user task.
Click on the user task, enter
Qualifyin the Name field, expand Implementation/Execution, and enter the following values:-
Task Name:
Qualify -
Groups:
approver Click
next to Assignments. In the Qualify Data I/O window, click Add to create the following assignments:
-
Task Name:
- Click Save. Above the canvas, click Save, and Save, to confirm your changes.
Create an outgoing connection from the Qualify task to an exclusive gateway.
- Click on the GATEWAYS icon in the node panel.
- Click on Exclusive and drag it to the right of the Qualify task.
- Create an outgoing connection from the exclusive gateway and connect it to a user task.
-
Click the connection and input
in Limitin the Name field of the Diagram properties panel. - Expand Implementation/Execution and select Condition in the Condition Expression section.
Select inlimit from the Process Variable drop-down menu and select Is true from the Condition drop-down menu.
Click the user task, enter
Final Approvalin the Name field, expand Implementation/Execution, and enter the following values:-
Task Name:
FinalApproval -
Groups:
manager
-
Task Name:
Click
next to Assignments. In the Final Approval Data I/O window, click Add to create the following assignments:
- Click Save. Above the canvas, click Save, and Save, to confirm your changes.
5.2.5. 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
Create an outgoing connection from the Final Approval user task and connect it to an end event.
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.
-
Click the connection and input
Not in Limitin the Name field of the Diagram properties panel. - Expand Implementation/Execution and select Condition in the Condition Expression section.
- Select inlimit from the Process Variable drop-down menu and select Is false from the Condition drop-down menu.
Click on an empty space on the canvas, scroll down, expand Process Data, and click
next to Process Variables. Enter the following values:
-
Name:
incdownpayment Data Type:
Boolean
-
Name:
-
Click the new user task and in the Diagram properties panel, input
Increase Down Paymentin the Name field. Expand Implementation/Execution and enter the following values:
-
Task Name:
IncreaseDownPayment -
Groups:
broker Click
next to Assignments. In the Increase Down Payment Data I/O window, click Add to create the following assignments:
-
Task Name:
- Click Save. Above the canvas, click Save, and Save, to confirm your changes.
- Create an outgoing connection from the Increase Down Payment user task to an exclusive gateway.
- Create an outgoing connection from the exclusive gateway to an end event.
-
Click the connection and input
Down payment not increasedin the Name field of the Diagram properties panel. - Expand Implementation/Execution and select Condition in the Condition Expression section.
- Select incdownpayment from the Process Variable drop-down menu and select Is false from the Condition drop-down menu.
- Create an outgoing connection from the exclusive gateway and connect it to the first exclusive gateway.
-
Click the connection and input
Down payment increasedin the Name field of the Diagram properties panel. - Expand Implementation/Execution and select Condition in the Condition Expression section.
- Select incdownpayment from the Process Variable drop-down menu and select Is true from the Condition drop-down menu.
- Click Save, and Save, to confirm your changes.
Figure 5.1. Final version of the business process