he content summary highlights the added or modified segments that require processing through workflows (jobs). The current method enables the creation of these workflows.
URL
(POST) /api/apps/wbflex/documents/{id}/branches/content/workflows/new
PARAMETERS
The URL parameters are:
|
id |
Specify the Flex container ID |
string, Mandatory |
The BODY must be a JSON object with these properties:
|
token |
The token obtained when creating the content summary |
string, Mandatory |
|
branch |
Optional. Create workflows only for this specific branch. Otherwise we create workflows for all branches. |
string?, Optional |
|
locales |
Optional list of target locales to create jobs for. If null then work in all locales will be assigned to jobs. |
string[], Optional |
|
maxSegments |
Optional, default is 500. The maximum is 10.000. For each branch and locale, the system will create a workflow (jobs) with no more than this number of segments. No job will contain more than this number of segments. |
int?, Optional |
|
|
|
|
|
|
JOB PROPERTIES |
|
|
workflowProfileId |
An optional workflow profile ID. If null then the method uses the project’s profile (see the “Workflow & Supplier” page in the project). |
int, Optional |
|
deadline |
Optional deadline for completion of work. Deadlines are assigned to the jobs that are created with the workflow. Example:
|
datetime?, Optional |
|
instructions |
Optional instructions added to each job. Visible to the workers. |
string?, Optional |
|
comments |
Optional internal comments added to each job. Not visible to workers (unless these are internal and have sufficient access rights) |
string?, Optional |
|
jobsCfs |
Optional custom fields to assign to all jobs created for a file’s workflow. See Custom Field Collection Record for details. Note: You reference a CF by either its “id” or its “title” (name). Example:
|
object[], Optional |
|
|
|
|
|
|
CALLBACKS |
|
|
callbackurl
|
Specify a URL which will be called upon success or failure of operation. This makes polling for operation status unnecessary. See Callbacks (with asynchronous operations) |
Optional |
RESULTS
The operation is asynchronous and may take a few seconds to complete. The method returns an Asynchronous operation result:
{
"trm": {
"requestid":32230,
"status":"Waiting",
"statusText":"Waiting..."
}
}
Specify the callback in the payload to be automatically notified of completion. Otherwise you need to poll the operation for completion (until status = “Finished”). When finished (or via the callback) you obtain the results as a JSON:
{
"trm": { ... }
"custom": {
"items": [ .... information about created workflows ... ]
}
}
The items node contains one object per branch and locale. Example:
[
{
"locale": "de",
"branch": "V1",
"jobIds": [
3824
],
"segments": {
"assigned": 21,
"skipped": 0,
"failures": 0
}
},
{
"locale": "fr",
"branch": "V1",
"jobIds": [
3825
],
"segments": {
"assigned": 31,
"skipped": 0,
"failures": 0
}
}
]
If the system could not create jobs for a branch and locale, it will be printed with an error node:
{
"locale": "fr",
"branch": "V1",
"error": "Failed to create jobs ...."
}
The properties are:
-
locale: The target locale of the workflow.
-
branch: The branch from which all segments originate.
-
jobIds: The list of jobs created for the segments of this branch and locale. For example, if the workflow configuration defines both Translation and Revision steps, two jobs will be created.
-
segments.assigned: The total number of segments assigned to the workflow.
-
error: An error message if jobs could not be created for the branch / locale.