...
Step 1 | Create a Data Model field by right-clicking on the Root Node → Add Field of Type → Float. Set the Field Name and Description to RequestAmount. | |||||
Step 2 | Add an Input control in the Form Container Element and bind it to field RequestAmount in the Data Model.
Set the Label of the Input control to Request Amount. Remove the Label of the Form Container. Set the Label of the Form to Request Details. Click Save. | |||||
Step 3 | Click the Workflow button to open the FAB Process Designer. Go to the Requirements tab. Click the Add button and enter the requirement details. In this example, we will use the following values: Id: AMOUNT_GT_1000 Description: Amount > $1000 Go to the Tasks tab. Click the Requirements button of the Approve task and select the requirement. Click OK. Go to the Process Flow tab and the requirement is now reflected in the Approve task. Click Save & close. | |||||
Step 4 | Implement the Requirement in ABAP by clicking the Code button. In the Form Life-Cycle dialog, click Auto-Generate Class Name button then click Generate Class. In the Workflow section, click the ABAP Routine button next to Evaluate Task/Outcome Requirements to create the implementation of the REQUIREMENT_EVALUATE method. Click the button again to open the class editor. Implement the following logic for the Requirement and Activate.
In the Form Life-Cycle dialog, click Save. | |||||
Step 5 | Add an Action to Update the Process Flow Diagram when the Request Amount is Changed (optional). Configure a Default Path. Go to Workflow → Tasks → Actions (Approve Task). In the APPROVE action, click the Behaviour button and tick Default Path. Click OK. In the FAB Process Designer, click Save & Close. Test the application. |
Using Roles in a Workflow
...
Step 1 | Implement the Role Determination in ABAP by clicking the Code button. In the Workflow section, click the ABAP Routine button next to Determine Approvers for Roles to create the implementation of the DETERMINE_APPROVERS_FOR_ROLE method. Click the button again to open the class editor. Implement the following logic for the user assignment and Activate.
Note here that we have assigned two user IDs FABAPPR1 and FABAPPR2 to Role Approver1 and Role Approver2, respectively. In the Form Life-Cycle dialog, click Save. Once DETERMINE_APPROVERS_FOR_ROLE has been implemented, it is possible to check the agents for each Task by clicking on the Task in the Process Flow Diagram of the application. |
Using View Control and View Variables in a Workflow
It is often desired that certain sections of the App are only visible to certain users at different stages of the Workflow. For this capability, we can use the concept of View Control to restrict the visibility or editability of sections depending on the user's Role.
To demonstrate, let us two sections:
...
Submission Details
...
View Control lets you add a layer of security that regulates which users or roles can view and edit certain sections of the application.
View Variables lets you add a catalog of Data Model fields (Booleans) that can be used by the View Control.
To demonstrate this functionality, let us two create two sections in the application:
Submission Details
Approver Comments
In this application, only users with Role Approver1 should be able to edit the Approver Comments, and the Approver Comments should not be visible until the application has reached Level Approval or Complete.
Step 1 | Create a Data Model field by right-clicking on the Root Node → Add Field. Set the Field Name and Description to ApproverComments. | ||
Step 2 | Add a new Form with Label Approver Details. Add a Text Area in the Form Element and bind it to field ApproverComments in the Data Model. | ||
Step 3 | To control the visibility of the Approver Details Form, create a new Data Model field ApproverDetailsVisible type Boolean. The recommended practice is to place the view control variables in a dedicated Structure Type Node in the Data Model. In this example, we use ViewControl. | ||
Step 4 | Set the Visible Property of the Approver Details Form to ViewControl/ApproverDetailsVisible. Click Save. After saving, the Approver Details Form is no longer visible because the default value of a Boolean Field is false. | ||
Step 5 | The objective of this step is to restrict the editing of the Approver Comments to users with Role Approver1 and the Approver Comments should not be visible until the application has reached Level Approval. Click the Workflow button to open the FAB Process Designer. In the FAB Process Designer, go to View Variables tab. Click the Add button and enter the following information: Variable name: ViewControl/ApproverDetailsVisible Auto. Set to false at each new Level: Ticked Click Save.
Go to View Control tab. Click the Add button and enter the following information: Level: Approve Role: Approver1 Variable name: ViewControl/ApproverDetailsVisible Click Save. Using this setting, the View Variable ViewControl/ApproverDetailsVisible is set to true when the workflow is at Level Approve and the current user has Role Approver1. Hence, when the user FABAPPR1 (Approver1) opens the request, the Approver Details Form will be visible because the Variable ViewControl/ApproverDetailsVisible is set to true. On the other hand, the Approver Details Form will not be visible for Initiator because it does not have the Role Approver1. |
Using Parallel Tasks in a Workflow
...