Skip to Content

Create an API Trigger for the Process

Create an API trigger for the business process.
You will learn
  • How to create an API trigger to start an instance of a business process from any service, like SAP Build Apps
chaitanya-priya-puvvadaChaitanya Priya PuvvadaJanuary 27, 2023
Created by
celineaudinsap
January 25, 2023
Contributors
celineaudinsap
thecodester

A business process is started by defining a trigger, an event that indicates to your SAP Build Process Automation tenant to start a process instance.

Process triggers can be either a form, such as a request form, or an API call, where an external system starts the process.

You can start an instance of your process using an API call, with the inputs for the call configured from the process builder. These inputs can then be used as input fields in your process.

  • Step 1

    Once you have completed the tutorial Acquire A Template Project From The Store, your process looks as below.

    Process
    1. Open the process Order Processing.

      Process
    2. From the Editable version of the Sales Order Approvals Dev Tutorial project, choose the three dots of the Order Processing Form and select Remove to delete the form.

      Delete Form

      A warning message will inform you that the related bindings will be removed. Choose OK.

      Warning

      Save the project.

    3. To add an API trigger for the process, click on the + > API > New API Trigger.

      Since the bindings are lost, all the artifacts are in error state. Once the API trigger is created, the bindings will be updated.

      New API Trigger
    4. Enter the name of the trigger as Sales Order Trigger. Choose Create.

      Create API Trigger Pop Up
    Log in to complete tutorial
  • Step 2
    1. Select Sales Order Trigger, click on the Canvas, and choose Inputs. Then choose Configure to configure inputs.

      Inputs
    2. In the Configure Process Inputs window, choose Add Input to add parameters.

      Add the following parameter:

      Name Type
      salesOrderDetails SalesOrder

      Apply changes.

      Add Inputs
    3. Once the trigger is created successfully, you can view the trigger under the Triggers section in the Overview page.

      Triggers Overview

      You can edit, deactivate, or delete the API trigger properties from Triggers tab in the respective process builder overview.

      • Deactivate means that while the trigger exists in design-time, you cannot consume it in runtime.

      • Delete will permanently delete the trigger from design-time, but for already deployed processes the trigger will still exist at runtime.

      In general, any changes in the trigger will be affective only when the process is released and deployed.

      Note: All the API triggers that are created in that project will be shown.

    Save the project.

    How are the inputs added for an API trigger?

    Log in to complete tutorial
  • Step 3

    Since you have created an API trigger, the bindings were lost as mentioned in Step 1. Let’s adjust the process with the new inputs configured for the API trigger.

    1. Choose the condition artifact and click on Open Condition Editor.

      Condition

      Enter the condition for the orderAmount.

      Condition
      Condition

      Click on Apply.

    2. Choose Approval Form to adjust the bindings.

      Modify the General section. Since the process would be started through an API, remove the Users Process Started by and enter your EmailID that was configured for the tenant.

      Condition

      Modify the Inputs section.

      Condition
    3. Choose Order Confirmation Form to adjust the bindings.

      Modify the General section. Since the process would be started through an API, remove the Users Process Started by and enter your EmailID that was configured for the tenant.

      Confirmation

      Modify the Inputs section.

      Inputs
    4. Choose Order Rejection Notification Form to adjust the bindings.

      Modify the General Section. Since the process would be started through an API, remove the Users Process Stared by and enter your EmailID that was configured for the tenant.

      Rejection Form

      Modify Inputs section.

      Inputs
    5. Choose Auto Approval Notification Form to adjust the bindings.

      Modify the General section. Since the process would be started through an API, remove the Users Process Started by and enter your EmailID that was configured for the tenant.

      Approval Notification

      Modify the Inputs section.

      Inputs
    6. Save your project.

    Log in to complete tutorial
  • Step 4
    1. Release the project.

      Release
    2. After successful release of the project, deploy the project.

      Deploy

    You have successfully released and deployed the process and it is ready to consume via APIs.


    Log in to complete tutorial
Back to top