SAP Build process automation has both workflow management and intelligent robotic process automation capabilities. This blog post will mainly focus on workflow management part.
Check New Learning Tutorial on SAP Process Automation to understand the basics and trial system setup.
From SAP Build Work Zone (Standard edition), an employee will raise a relocation request.
The process will be triggered by a form. The form can be designed in Form editor. The deployed version of the process will have the form link and launchpad configuration parameters, which can be used to fill up the form using browser or configure as application in SAP Build workzone.
Create an action to get employee details based on employee ID. From API response, we will retrieve country, city, first name, last name and hire data. For this demo, I am simply using northwind ODATA API.
Please note: All the data are fake data.
To create action, BTP destination is pre-requisite.
Go to Control tower -> Destinations -> Click ‘New Destination’. All the destination with property sap.processautomation.enabled = true, will show up in the list -> Click ‘Add’.
Create Data Type for input and output parameters and add Decision rule.
Input DT:
Output DT:
Input |
Result |
|||||
YEAR( TODAY() ) – YEAR( EmpDetails.HireDate ) |
EmpDetails.NewLocation |
Eligible |
Rework |
Comments |
Decisoin |
Name |
>= 1 |
= CONCAT( EmpDetails.CurrentCity , ‘, ‘ , EmpDetails.CurrentCountry ) |
TRUE |
TRUE |
‘Requested Location is same as current location.’ |
– |
CONCAT( EmpDetails.FirstName , ‘ ‘ , EmpDetails.LastName ) |
< 1 |
– |
FALSE |
– |
‘Reapply after completing 1 year of service.’ |
‘Rejected’ |
CONCAT( EmpDetails.FirstName , ‘ ‘ , EmpDetails.LastName ) |
>= 1 |
!= CONCAT( EmpDetails.CurrentCity , ‘, ‘ , EmpDetails.CurrentCountry ) |
TRUE |
FALSE |
– |
‘Accepted’ |
CONCAT( EmpDetails.FirstName , ‘ ‘ , EmpDetails.LastName ) |
Also, Use custom variable to set status as ‘Rejected’/ ‘Accepted’ in the notification for based on the decision taken. When it goes to approval step, and if the approval rejects the request, the variable value will be set to ‘Rejected’ .
If eligible = false, send auto rejection notification form to the employee.
If eligible = true but requested new location is same as current location, request form will be sent back to the employee for rework.
If eligible= true and requested new location is not same as current location, request form will be sent for approval.
If the form is rejected by approver, the custom variable named ‘decision’ will be set as ‘Rejected’ using decision rule.
Irrespective of approval decision, notification form will be sent to the employee for acknowledgement.
Set the runtime variables and deploy.
To check the logs of process execution :
Go to Monitoring -> Process and Workflow Definitions -> Select the process and Show Instances.
Thank you for reading this blog post. Please feel free to share your feedback or thoughts in the comments section or ask any questions in the Q&A tag below.
Regards,
Priyanka Chakraborti