Task Group Runner
Task groups can be exposed to the external services via the "Task Group Runner" API.
This enables the execution of tasks in a task group without the need for a 3Sixty migration job.
For example this API can be accessed via
https://example-objective-3sixty/3sixty-admin/api/taskgrouprunner
Endpoints
There are 3 endpoints that developers and external users can interact with:
-
GET /list can be used to get a list of publicly available task groups
-
Here is an example:
http://localhost:8080/3sixty-admin/api/taskgrouprunner/list
-
Returns a JSON array containing
-
-
GET /info can be used to get more information about an individual task group. This endpoint expects the id of the task group to be provided as a url parameter.
-
Here is an example:
http://example-server/3sixty-admin/api/taskgrouprunner/123/info
-
-
POST /run can be used to run a task group. This endpoint expects the id of the task group to be provided as a url parameter. Document metadata must be passed in as a JSON field named metadata. Optionally, a document binary can be passed in a field named binary. By using the optional returnBinary field in the url parameters, the return type can be controlled. Setting this value to true will cause the response content type to be in binary format. If it is false, or not provided, the response will be in JSON format.
Examples
Here is an example of running a task group that has id of 123.
http://example-server/3sixty-admin/api/taskgrouprunner/123/run
Here is an example of sending document fields to the task group. The following JSON must be POST’ed to the run endpoint in a Form-Data field named metadata. In this example we are sending two fields to the task group, namely question and question_type fields.
{
"documentFields": {
"question": {
"fieldType": "STRING",
"fieldName": "question",
"fieldValue": "How are you?"
},
"question_type": {
"fieldType": "STRING",
"fieldName": "question_type",
"fieldValue": "Greeting"
}
}
}
In case we just need the binary contents of the document and no metadata, we need to send an empty metadata field, meaning an empty JSON. Here is an example: {}
Task Groups can be created and made publicly available by using the Task Group UI in 3SIxty admin page, as seen below:
Related Articles: