Based on the result from calling the business rules component,
we will use a Choice activity to divide the process into separate
paths. The loan request will follow one of two paths: automatic approval
or manual approval.
To create a Choice activity, complete the following steps:
- In the process editor palette, under the Structures category,
click Choice.
- Click the connection between CheckAutoApproval and Reply.
The Choice activity is added.
- Rename Choice to AutoApprovalTest.
To create a condition to check if the loan amount can be automatically
approved, complete the following steps.
- In the process editor, click the Case label.
- In the Properties view, click the Description tab
and type AutoApproved in the Display
Name field.
- To define the condition is checked using Visual Java, click Details and
select Java from the Expression language list.
- For the Expression Type, select Visual.
- In the canvas, click true and replace it
with AutoApprovalResponseData, as shown in the following screen capture.
In this case, if AutoApprovalResponseData is true, we will follow
this conditional path.
To add the approved assignment, complete the following steps.
- Add an Assign activity below AutoApproved, but in the Choice container,
and rename it Approved.
- Click on Select From and select String.
- Type Your application has been approved.
- Click Select To and select BankReponse.
The completed Approved assign activity is shown below.
- The business process should now look like the following screenshot: