In this section, you will configure SAP Build Process Automation project where a Decision will be used to determine which business action should be executed for an event. You will also configure a decision table in the decision project
-
In the SAP BTP Cockpit, Navigate to your subaccount -> Sevices -> Instances and Subscriptions , Open the SAP Build Process Automation Application.
-
In the SAP Build Process Automation Application, In the Lobby Tab , Click on Create button to create a new project.
-
Choose the Build an Automated Process Tile.
Choose Business Process Tile.
-
Fill the project name as Events-to-Business-Actions-Framework and Choose Create
Accept the disclaimer if prompted!
-
The Project is now created , click on Cancel for the Create Process pop-up , as we will be creating Decisions and it's related Data Types in the following steps.
-
Under the Artifacts Tab of your project, Click on Create and then choose Decision .
Fill in the Decision Name as E2BDecision and Click on Create.
You will see the following screeen as the decision is created successfully.
- The Decision configuration requires the Input and Ouput parameters as well as the business Rule that maps the incoming event to it's associated business action. To configure the Input/Output parameters we need to create the Custom Data Type with the fields that the incoming event payload contains.
Under theArtifacts Tab, Click on Create and choose Data Types.
-
We will be creating two data types namely eventInfo and actionInfo which will have the structure of the incoming event payload and the action Id respectively. To create the datatypes follow the steps shown below:
a. Create Data Type called eventInfo
b. Click on New Field and Enter the Field Details as listed in the table below and click on Save. Note: The values are case-sensitive.
Name Type SourceSystem String DeviceType String DeviceLocation String c. Under theArtifacts Tab, Click on Create and choose Data Types.
d. Create data type called actionInfo
e. Click on New Field and Enter the Field Details as listed in the table below and click on Save
Name Type ActionId String -
As we have now created the required data types , let us go to the E2BDecision and configure the Input/Output parameters as shown below. Fill the Input Paramter Name as EventInfo and Choose the Type from the drop down as eventInfo created previously. Fill the Output Parameter Name as ActionInfo and choose the Type from the as actionInfo.
-
Next let us configure the Rules.
a. Click on Add Rule
b. Fill in the Rule Name as DecideAction and click on Next Step button.
c. To configure the Conditions follow the steps shown below. and Click on Next Step button.
d. To configure the Results follow the steps shown below, and Click on Next Step button.
e. Verify the Review Tab and click on Create button
f. An empty Decision Table will be created.
g. Fill the fields with following values: Note: Paste the values along with equals-to operator.
SourceSystem DeviceType DeviceLocation ActionId = 'sap-sitewise' = 'Motor' = '1017' Leave the ActionId field empty as it is to be filled later.
-
We need to configure another decision, which provides with the "Plant Details" of the plant that needs maintenance. As configured above, the Decision configuration requires the Input and Ouput parameters as well as the business Rule that maps the incoming event to it's associated business action. To configure the Input/Output parameters we need to create the Custom Data Type with the fields that the incoming event payload contains.
Under theArtifacts Tab, Click on Create and choose Data Types.
-
We will be creating two data types namely eventInfo and actionInfo which will have the structure of the incoming event payload and the action Id respectively. To create the datatypes follow the steps shown below:
a. Create Data Type called BucketInfo
b. Click on New Field and Enter the Field Details as listed in the table below and click on Save. Note: The values are case-sensitive. After saving, Navigate to Overview Tab.
Name Type BucketName String c. Under theArtifacts Tab, Click on Create and choose Data Types.
d. Create data type called EquipmentDetails
e. Click on New Field and Enter the Field Details as listed in the table below and click on Save
Name Type Location String Equipment String -
Under the Artifacts Tab of your project, Click on Create and then choose Decision .
Fill in the Decision Name as Plant_Details and Click on Create.
-
As we have now created the required data types for the decision, let us go to the Plant_Details and configure the Input/Output parameters as shown below.
-
Fill the Input Paramter Name as BucketInfo and Choose the Type from the drop down as BucketInfo created previously. Fill the Output Parameter Name as EquipmentDetails and choose the Type from the as EquipmentDetails.
-
Next let us configure the Rules. Click on the Rules Tab.
-
Let us configure the rules.
a. Click on Add Rule
b. Fill in the Rule Name as FetchEquipmentDetails and other details as shown in the picture below. click on Next Step button.
c. To configure the Conditions follow the steps shown below and click on Next Step button.
d. To configure the Results follow the steps shown below and click on Next Step button.
e. Verify the Review Tab, and Click on Create button.
f. An empty Decision Table will be created.
g. Fill the fields with values listed in the table below, and then click on the Save button. Note: Make sure the Location and Equipment are already maintained in your SAP S/4HANA system, or use the values of those that are already created in your SAP S/4HANA.
BucketName Location Equipment <your_s3_bucket_name>
'1010-SPA-SAC-PLAR1-DMIV' '210100019' -
To use the decision in our CAP extension application we need to deploy the Decision created.
First click on Release to release the Decisions.
Click on Release
-
Now that the project is released, it is ready for deployment. Click on the Deploy
Follow the steps shown in the following screenshots.
-
The Project is successfully deployed !
-
Go to E2BDecision , Click on the three dots to View Details and Click on View Details
Copy the Id from the Decision Details , which will be used in the Next Step for default action configuration, (remember this as E2BDecisionId).
-
Go to Plant_Details , Click on the three dots to View Details and Click on View Details
Copy the Id from the Decision Details , which will be used in the Next Step for pre-action configuration,(remember this as Plant_Details_Id).