Callback API

OpenAPI 2.0 (Swagger) callback server description

Using Callback API for Actions, Rules and Conditions

  1. Open the Callback API page and download the swagger file for the callback server.
  2. Open https://editor.swagger.io/, import the swagger file for the callback server into the Swagger editor, click Generate server, choose your language and/or technology. Then you will have an archive with generated server.
  3. Fix code generation errors in the server code (if present). Run this server on some url (for example http://localhost:5000)
  4. Open the Callback API page. Write http://localhost:5000/callbackapi/getactions in Getting a list of actions setting, click Test. It will become green if callback server is accessible. Write http://localhost:5000/callbackapi/executeaction in Action execution setting, click Test it will become green if callback server is accessible. Click Save.
  5. Open the generated server code, find the GetActions method and return request containing List (for example "Action1", "Action2" etc.)
  6. If everything went well, you can now choose Actions with these names as implementations for Activities in the Designer. Whenever Workflow Server starts the execution of these Actions, it will request the ExecuteAction method on your server.

The same logic applies to Rules and Conditions.

Response

Callback server must send the following response to any request submitted.

{ "success": true/false, "data": "response data if an operation succeeded", "error": "error(exception) name", "message": "error(exception) details" }

Getting a list of actions

Url: http://server/callbackapi/getactions

Request parameters

none

Response data

list of actions ["Action1", "Action2", "Action3"]

Action execution

Url: http://server/callbackapi/executeaction

Request parameters

name Action name
parameter action parameter specified in the Designer (activity)
processInstance ProcessInstanse object serialized to json

Response data

json with new process parameters {"Parameter1":1, "Parameter2":"Some string"}

Getting a list of conditions

Url: http://server/callbackapi/getconditions

Request parameters

none

Response data

list of conditions ["Condition1", "Condition2", "Condition3"]

Execution of the condition

Url: http://server/callbackapi/executecondition

Request parameters

name Condition name
parameter condition parameter specified in the Designer (transition)
processInstance ProcessInstanse object serialized to json

Response data

Condition result true/false

Getting rules

Url: http://server/callbackapi/getrules

Request parameters

none

Response date

list of rules ["Rule1", "Rule2", "Rule3"]

Checking the rule

Url: http://server/callbackapi/checkrule

Request parameters

name Rule name
processInstance ProcessInstanse object serialized to json
identityid user id
parameter rule parameter from the Designer

Response data

Result of a rule check true/false

Getting identities

Url: http://server/callbackapi/getidentities

Request parameters

name Rule name
processInstance ProcessInstanse object serialized to json
parameter rule parameter from the Designer

Response data

User identity list ["userId1", "userId2", "userId3"]

Generate

Url: http://server/callbackapi/generate

Request parameters

schemecode Scheme code
schemeid Scheme version id
parameters Workflow parameters
scheme Workflow XML scheme

Response data

XML scheme of workflow <Process Name="SimpleWF">... </Process>

Process status changed

Url: http://server/callbackapi/processstatuschanged

Request parameters

processId Process id
schemeCode Scheme code
processInstance ProcessInstanse object serialized to json

Response data

none
Top