Spend Management Blog Posts by SAP
cancel
Showing results for 
Search instead for 
Did you mean: 
NMZ
Associate
Associate
0 Likes
279

As a pre-requisite, you must ensure that your SAP Build Process Automation (SBPA) project contains at least a main process, where all the steps of the process are defined. If you aim to visualise certain major milestones within the process, you can do that by using a combination of sub-processes and “Wait for API call” steps. Create a business document via your own microservice and make your implementation also receive status updates for the business documents it creates. Your own microservice can now call the SBPA process instance and pass the updated status.

Sub-Processes:

Represent the milestones in this context. You can create a sub-process either directly on the canvas using the “+” in between process steps, or upfront on the overview tab, using the create button. The sub-processes can be used for deeper structuring complex processes, but for visualising the milestones only, they do not have to contain any steps.

Sub processes will be displayed in a UI component once they are done in the current flow:

NMZ_0-1767366330158.png

Now that we have the milestones visualised, we also want to show the progress of the process over time. Usually a process will only pause, if there is a direct user input required for example via a form or an approval that is modelled inside the process. But when calling something outside of the process that introduces a delay, this can’t be represented in the process.

This could be for example an external API to create a Purchase Order in S/4. If there is an approval active within the S/4 system, the SBPA process would not wait for the approval to happen, it would continue directly after the creation of the PO. To pause a process in such a case, “Wait for API call” steps can be used.

Wait for API call steps:

The “Wait for API call” steps allow the process to pause in between two milestones, if next milestone is not reached yet. (also see Create a Wait for an API Call Trigger and 10 - Call 3rd-Party System and Wait for Callback)

With the help of the “Wait for API call” steps, you achieve two things:

  1. The process pauses at this step, until a call to the according API (trigger) happens from the outside.
  2. You can provide information into the process with that API call. By defining outputs for the wait step, you define the API that can be called later. The provided values can be evaluated later in the process

The “Wait for API call” steps can be re-used in the process. If there are several places in the process where you want to wait and evaluate the incoming API call, you just have to define an according “Wait for API call” step once. The places where the defined wait step is inserted, can also be individually renamed, which helps to keep the process organised.

Otherwise, if you are not re-using the “Wait for API call” steps, for each new one, a new API endpoint would be created.

Wait steps after an action are special

In general, for updating the status of a process, a single “wait for API call” step with a variable “status” as output would be sufficient, but there is also the case of performing an action first. In that case, in SAP Ariba intake Management, a separate step is created, that has the variables “error” and “id”. If the error variable is not empty, this indicates that the action did fail, otherwise the id needs to be populated with the id of the created document.

In general:

  • “Wait for API call” steps will create an according trigger in the project. This trigger is an API endpoint and can be re-used at different places in the process.
  • Every “Wait for API call” requires the id of the process instance as a parameter. It is also possible to provide additional parameters

How to model to make use of polling

A detailed description is shown in the sequence diagram below. 

NMZ_0-1767366890356.png

If you are using your own microservice app-to-app authentication has to be set up as described in https://cap.cloud.sap/docs/java/security#app-to-app

If you do not use your own microservice, the API call to “startIntake” needs to be performed by the Wind-up UI directly and the API call to the “backend for business document creation” must be called via an action from the SBPA process. A later status update and display will then not be possible.