Skip to content

3.6.2. Api Activity

Ettiene Mare edited this page Mar 9, 2020 · 4 revisions

The Api Activity will make http calls to a rest like service.
The Api Activity is configured in the process definition.

Specification

The Api Activity is configured in the process definition.

{
    "name" : "deposit",
    "activities": [
        {
            "name": "session",
            "type": "api-activity",
            "next": "landing",
            "endpoints": [
              {
                "url": "[WF]/user",
                "method": "GET",
                "mappings":[
                  {"client": "register.firstName", "remote": "name", "direction": "in"}
                ]
              }
            ]
        }
    ]
}

Parameters

Parameter Description
name The name of the activity.
type The type of the activity, it should be api-activity.
next The next activity to execute after the activity finished executing.
endpoints A collection of api's to call.

endpoints

Parameter Description
url The url of the api. Use [] to get config settings, or use the full url e.g. http://mysite/login.
method The http verb to use. E.g. GET, PUT, POST, DELETE.
mappings The map between the model, body and response.

mappings

Parameter Description
client The field in the model. Don't use the root for the values. There should always be a period in the name.
remote The field in the response when the direction is in or inout, The field in the body if the direction is out or inout.
direction The direction of the mapping.

direction

Direction Description
in Set the the model value to the response value.
out Set the field in the body to the value in the model.
inout Two way binding.

NOTE
The querystring will not be mapped, You need to do it in the url field.

Home

  1. Setup

  2. Configure

  3. Design

    3.1.Introduction

    3.2. Core

    3.2.1. Workflow
    3.2.2. Analytics
    3.2.3. Messages

    3.3. Services

    3.3.1. Workflow
    3.3.2. Analytics
    3.3.3. Config
    3.3.4. Model
    3.3.5. Validator
    3.3.6. Http

    3.4. Validators

    3.4.1. Required
    3.4.2. Regex
    3.4.3. Range
    3.4.4. Custom

    3.5. Pipes

    3.5.1. Currency

    3.6. Activities

    3.6.1. Page
    3.6.2. Api
    3.6.3. Assign
    3.6.4. Decision
    3.6.5. Code
    3.6.6. IPC
    3.6.7. Finish
    3.6.8. Redirect
    3.6.9. Switch
    3.6.10. Custom

    3.7. Web Components

    3.7.1. React

Clone this wiki locally