There are no secrets to success. It is the result of preparation, hard work, and learning from failure.

Saturday 21 March 2020

SAP Cloud Platform Business Rules- Part 2

Click here and follow my SAP UI5/FIORI snippets and information Page
SAP Cloud Platform Business Rules- Part 1
SAP Cloud Platform Business Rules- Part 3
In part-1,I explained all the configurations steps for Business rules.In part-2, I am going to explain below points.Go through it and please let me know in case of any doubt/issue.

->How to create Business rules project.
->How to create Data Objects(Entity).
->How to create attribute.
->How to create service and vocabulary.
->How to create decision tree.
->How to write conditions in decision tree.
->How to deploy service on cloud.
Step 1- Click on "Manage Rules project". I have highlighted below in the screenshot.
Step 2- You will get below screen.         
Step 3- Click on add(+) button to create the rules project.I have highlighted above in the screenshot. 
You will get below screen.
I have given input in Name filed is : "DemoRules1"
I have given input in Description filed is : "Offers for credit cards example"
You can give any name as per your requirement.
  A. Click on "Save" button to create the project.
  B. Click on "Validate" button to validate the project.
  C. Click on "Edit" button.
  D. Click on "Activate" button to activate the project.

Step 4- Select "Data Objects" and from the menu list, select the "Local data Objects".I have highlighted below in the screenshot.
Step 5- Click on Add(+) button to create entity. I have highlighted above in the screenshot.
Entity- It contains properties.
Give entity name, description and select type.In the select option you will get three options.Select the one option as per your requirement.
Options are:   A- Structure
                     B- Table
                     C- Element
I have selected structure for my case. After filling the details,click on save button to create the entity.
Click on edit button and select "Attributes" option and add at least one property under the entity.
 Add property under the attributes section and then save, validate and activate the entity.
 I have created three properties for my input case.
You have to create two entities, one for input and another one for output.
I have created two properties for my output case.follow same above steps for output entity and properties.
Step 6- Select "Rule Services" option and click on add(+) button to create service. I have highlighted below in the screenshot.
  
Provide the details and save to create service.
Click on edit button and select "vocabulary".
Click on add(+) button to add vocabulary under the service.
In vocabulary, we select created entities and it's usage(whether input or result). Save, Validate and Activate.

Step 7- Select "Rules" and from the menu,select "Local Rules".
Click on add(+) button to create rules. You will get below screen.
Give Name and create the rules.You will get below screen.
Click on setting button.I have highlighted above in the screenshot. You will get below screen.
 A. Change Hit policy to "All Match".
 B. In condition write your properties of created input entity.Suggestions would be coming automatically.
 C. Select operator and click on plus(+) button to add row below.
 D. Select output entity.All properties would be added under the result.
 E. Give default value 0.
 I have added three conditions because I have three properties in input entity.
 Click on Apply.You will get below screen.
Click on "Add Row" and select "Insert First".
Write value in input and output properties.If it is string data type then write with quote.If it is number data type then write without quote.
Save,Validate and Activate. You can add any number of row.

Step 8- Select "Rulesets" and click on add(+) button to create rulesets.

Give name, description and select rule service.
Click on Add rule and select created rule.
Save,Validate and Activate.

Step 9- Select "Rule Services" and click on the deploy button. I have highlighted below in the screenshot.

You will get below screen.
Click on "SAP Cloud Platform".You would get successful deployment message.

Congratulations! Successfully we have created BRM project,Entities,Attributes,service,vocabulary,decision tree with conditions and deployment of BRM on cloud .

In the next post I will show, How to use/call BRM project in SAPUI5/FIORI application. 

No comments:

Post a Comment