Technology Blogs by SAP
Learn how to extend and personalize SAP applications. Follow the SAP technology blog for insights into SAP BTP, ABAP, SAP Analytics Cloud, SAP HANA, and more.
cancel
Showing results for 
Search instead for 
Did you mean: 
Archana
Product and Topic Expert
Product and Topic Expert
Decision capability of SAP Build Process Automation provide options to build business rules which can be consumed (a) directly in external application or (b) inside process or automations. These decisions once created, can be reused across different solutions. For example, a decision created for standalone consumption can also be used in the process or vice-versa.

Using decision is relatively made simple with 5 key steps:Let us now understand each step in bit more details:

Create Business Project and Decision


Before creating any artefact, you have to create business project. Business project bundles all the artefacts of a particular use case or scenario. You can create the Business Process project from the Lobby of SAP Build Process Automation design studio.

» Note: if you want to create only decision, then cancel the pop-up that comes to create business process (which asks for the project name and description)




  • From the Overview page, click to create Decision.



 

Model and Configure your Decision aka Business Rules


Once the decision is created, it will directly open the decision editor where you can define input and output parameters, add rules, and model these rules with with expressions.

» Note: If you have any validation errors while modelling, it will appear in the Design Console (at the bottom of the editor).

In this blog, I will not cover details about designing of the business rules. You can follow the tutorial ( from Step 2)  or SAP Help Portal to try it out yourself.

There are multiple features available while modelling business rules like orchestration of decisions, reusable rules that can be used as formula or function, local variables which are created and consumed inside decisions only. (we will cover them in detail in subsequent blogs)


 

Release and Deploy


These are two mandatory lifecycle operations for any SAP Build Process Automation artefacts.

  • Release will create a new version of the project which locks the state of the artefacts inside the project. Version has {major}.{minor}.{patch} format.

  • Deploy will push the versioned project into the runtime repository after which it can be consumed from different applications and processes. Only deployed decisions are consumable.


Some points to note:

  • Any number of versions can be created.

  • Any deployed or released version can be viewed by simply clicking the respective version from “Editable” dropdown (as shown in the screenshot below)

  • The current version can be reverted to any lowest deployed version in the same major version. This will over-write the latest editable / versioned copy of the business rules. For example: If you have 1.0.0, 1.0.1, 2.0.0, 2.0.2 versions then 2.0.2 can be reverted only until 2.0.0.




Consume Decision


Once you have deployed decision, it can be consume from the process or applications.

  • If you want to consume decision independently in any application, be it in SAP or non-SAP, cloud or on-premises, then you can do so with the RESTful Decision API.


You can use the Decision API to invoke the decision. The required decision ID can be picked from the deployed version information (as shown in the screenshot below).


» Note: If you do not specify any version then the latest deployed version will be automatically invoked, but if you want to invoke explicit version then use the version information.





  • We have simplified the use of decision across any process automation artefact like process, automation, or forms.  With this integrated experience, users can easily build and consume business rules in the process without the need to worry about cumbersome data type manipulation or API calls or managing the output.


To consume decision in process, all you need is to (a) create a process in the same business project and add the rule, (b) map the decision input with the actual process context data.




 




This gives you a quick overview of how Decisions aka Business Rules can be development, deployed and consumed in applications. We have learning journey, missions and multiple tutorials on SAP Build Process Automation which uses decisions. You can learn more about our product from the links below:

 


 
5 Comments
pjcools
Active Contributor
0 Kudos
Thanks archana.shukla nice guide for creating Decisions within SAP BPA. As we have discussed the initial screen of "What would you like to do" could be improved to make it clearer to users on how they start creating artifacts for Decisions. While Cancel is an option, not the best user experience here so I am hoping this initial page will be enhanced and improved in the near future.
0 Kudos
Hi archana.shukla, about reverting versions, I've a problem that tells me that I can't restore the project because it contains a Decision artifact. It also won't let me deploy version.

I opened a note to solve this problem, but is it normal? Any idea why this might be happening?
arunsubbu
Explorer
0 Kudos
Hi archana.shukla ,
Thanks for this detailed blog.
I was trying to test a decision. But always end up in empty result even though the return code is 200.
Like we have an option in BRF to simulate and understand how the rule checks each row and identifies the result, do we have any option here in decision? Is testing with https://api.sap.com/api/SPA_Decision/tryout the only option?

 

 
SF_Commune
Explorer
0 Kudos

Hello Arunkumar,

 

We have an option to test through Postman. I tried one and executed in both API Hub as well as through Postman. However, the result is same and return code is 200 there as well.

 

Hello Archana Shukla, Please let us know if we miss anything. I also observed that the model is failed, though we have the correct input json file, it is still saying that the input parameters are not valid.

 

Decision Error

Thanks,

Nanda

brianjpg
Explorer
0 Kudos

Hi Archana,

So am I understanding correctly that there is no longer an option to deploy a rule/decision to an S/4 on-premise system?  The only option is to consume deployed decisions via the Restful API and decisions are always deployed to a BTP runtime?

Thanks,

Brian.