Genpact Cora Knowledge Center

Support

Configuring HTTP Service Activities

V9.2

Overview

Configuring the HTTP service activities is an important step to expose the HTTP service, and start or resume a workflow when the service is called from an external application. The HTTP activities must be configured after you have created an HTTP listener, and defined its API definitions. For details on how to create an HTTP listener for HTTP service, refer to the Setting Up the HTTP Service article. 

For an HTTP service there are three main HTTP activities, which must be added and configured in the workflow:

  • HTTP Input activity 
  • HTTP Output activity 
  • HTTP Fault activity

 HTTP Input activity 

With the HTTP input activity you can select the HTTP service and operation (method) that you want to listen to in a dynamic workflow. The input activity helps you configure the entry point for the defined HTTP service request.

To add and configure the HTTP input activity,

The selected method response is displayed, to bind between the parameters a data source add an HTTP Input activity.   

  1. On the Cora SeQuence Admin portal, open the workflow in which you want to add the activities.
  2. From the tools panel, add HTTP Input Activity.
  3. Add the following details:
    • Name: Name of the activity
    • Alias: Alias for the activity
    • Description: Description about the activity
  4. Click Next.
  5. From the list, select the HTTP listener created for the HTTP service. You may also add new, edit or delete an existing listener from here.
  6. Click Next.
  7. On the HTTP Listener Input Bindings screen select the operation (method) that you wish to invoke.
  8. Click Finish.

The selected method response is displayed, to bind between the parameters a data source add an HTTP Input activity.   

HTTP Output activity

With the HTTP output activity you can bind the already created HTTP input activity to the data fields in the workflow. The output activity helps to display the workflow output in the respective fields.

To add and configure the HTTP output activity on a workflow,

  1. From the tools panel, add HTTP Output Activity.
  2. Add the following details:
    • Name: Name of the activity
    • Alias: Alias for the activity
    • Description: Description about the activity
  3. Click Next.
  4. On the HTTP Output Bindings screen, select the respective Input activity, and define the bindings between the HTTP service fields and the required data fields.
  5. Click Finish.

On activity execution the activity maps the returned objects from the HTTP service to the workflow data fields.

This activity sends the response at the end of the execution path. In other words, if you need to send the response immediately after the activity is executed, then one of the following conditions must exist in the workflow design.

  • There is a blocking activity after the HTTP Service Output Activity: Form, Task, or Timer.
  • The HTTP Output activity is triggered by manual execution. In simpler words, the user clicks Submit to trigger an automatic link after the HTTP Output activity.

NOTE:
You can use the values returned in the HTTP Output object in subsequent activities, by selecting HTTP Output object > ReturnValue in the Expression Editor.

HTTP Fault activity

With the HTTP Fault activity you can define an error message that displays if an HTTP service activity fails. You can only use this activity as part of a workflow that also includes an HTTP Input activity, and can execute this as part of an Error Handling and Compensation section of the workflow.

To add and configure the HTTP fault activity on a workflow,

  1. From the Tools panel, add HTTP Fault Activity.
  2. Add the following details:
    • Name: name of the activity
    • Alias: alias for the activity
    • Description: description about the activity
  3. Click Next.
  4. On the HTTP Fault Bindings screen, select the respective Input activity, choose the error from the Type drop-down and define the bindings between the selected error and the required data fields (if applicable).
    For more details regarding the error handling and the HTTP service error catalog, refer to the Setting up the HTTP Service article.