200 |
- Only suspended or failed Orders of the same Workflow are considered
- If all Orders neither suspened nor failed then an error is raised with HTTP 420
- If the Orders are from different Workflows then the answer contains the field
disabledPositionChange with
{ "code": "NOT_ONE_WORKFLOW" }
- In this case a resume of the Orders is only possible without changing the position
- Considered Orders are listed in the field
orderIds
- The field
positions lists all common allowed position for resume
- If there is no common position then the answer contains the field
disabledPositionChange with
{ "code": "NO_COMMON_POSITIONS" }
- In this case a resume of the Orders is only possible without changing the position
- For example: If the "main" Order and a "child" Order (of a fork) are requested then they cannot have common allowed positions
- If only one Order is requested then some fields are in addition in the answer
variables : It contains a merge of the returned values of all previous jobs
variablesNotSettable : true or false
- It is true if the current position is at the beginning of the Order's scope
- In this case a resume of the Order is only possible without setting any variables
- For example: The first position of the Workflow for a "main" Order or the first position of a branch in a fork for a "child" Order
|
|
application/json
model |
example
{
"title": "available positions for a resume",
"$schema": "http://json-schema.org/draft-04/schema#",
"javaType": "com.sos.joc.model.order.OrdersPositions",
"type": "object",
"required": [
"deliveryDate",
"orders"
],
"properties": {
"deliveryDate": {
"description": "Value is UTC timestamp in ISO 8601 YYYY-MM-DDThh:mm:ss.sZ or empty",
"type": "string",
"format": "date-time"
},
"surveyDate": {
"description": "Value is UTC timestamp in ISO 8601 YYYY-MM-DDThh:mm:ss.sZ or empty",
"type": "string",
"format": "date-time"
},
"orderIds": {
"type": "array",
"uniqueItems": true,
"items": {
"type": "string",
"pattern": "^[^<>]*$",
"maxLength": 255
}
},
"workflowId": {
"javaType": "com.sos.controller.model.workflow.WorkflowId",
"type": "object",
"required": [
"path"
],
"properties": {
"path": {
"type": "string",
"pattern": "^[^<>]*$",
"maxLength": 255
},
"versionId": {
"type": "string",
"pattern": "^[^<>]*$",
"maxLength": 255
}
},
"additionalProperties": false
},
"positions": {
"type": "array",
"uniqueItems": true,
"items": {
"type": "object",
"javaType": "com.sos.joc.model.order.Positions",
"properties": {
"position": {
"description": "Actually, each even item is a string, each odd item is an integer",
"type": "array",
"items": {
"anyOf": [{
"type": "integer"
}, {
"type": "string"
}]
}
},
"positionString": {
"type": "string",
"pattern": "^[^<>]*$",
"maxLength": 255
}
}
}
},
"disabledPositionChange": {
"javaType": "com.sos.joc.model.order.PositionChange",
"type": "object",
"required": [
"code",
"message"
],
"description": "reasons that disallow the position change",
"properties": {
"code": {
"type": "string",
"javaType": "com.sos.joc.model.order.PositionChangeCode",
"enum": [
"NOT_ONE_WORKFLOW",
"NO_COMMON_POSITIONS"
]
},
"message": {
"type": "string"
}
}
},
"variables": {
"description": "a map for arbitrary key-value pairs",
"javaType": "com.sos.inventory.model.common.Variables",
"type": "object",
"additionalProperties": true
},
"variablesNotSettable": {
"description": "only relevant for resuming a single order. Occurs if order starts from the beginning in its scope",
"type": "boolean"
}
}
}
{ "deliveryDate": "2021-07-08T19:07:37.706+0000", "surveyDate": "2021-07-08T17:34:27.296+0000", "orderIds": [ "#2021-07-07#T5668412865-test" ], "workflowId": { "path": "/test/w42", "versionId": "dc6f31f8-9e7e-48ba-947a-f86e0f970055" }, "positions": [{ "position": [0], "positionString": "0" }, { "position": [1], "positionString": "1" }, { "position": [1, "then", 0], "positionString": "1/then:0" }, { "position": [2], "positionString": "2" }], "variables": { "hello": "world", "returnCode": 0 }, "variablesNotSettable": false }
{
"deliveryDate": "2021-07-08T19:07:37.706+0000",
"surveyDate": "2021-07-08T17:34:27.296+0000",
"orderIds": [
"#2021-07-07#T5668412865-test"
],
"workflowId": {
"path": "/test/w42",
"versionId": "dc6f31f8-9e7e-48ba-947a-f86e0f970055"
},
"positions": [{
"position": [0],
"positionString": "0"
}, {
"position": [1],
"positionString": "1"
}, {
"position": [1, "then", 0],
"positionString": "1/then:0"
}, {
"position": [2],
"positionString": "2"
}],
"variables": {
"hello": "world",
"returnCode": 0
},
"variablesNotSettable": false
}
|
401 |
Unauthorized! |
|
application/json
model |
example
{
"title": "authentication",
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"required": [
"isAuthenticated"
],
"properties": {
"user": {
"type": "string"
},
"accessToken": {
"type": "string"
},
"message": {
"type": "string"
},
"role": {
"type": "string"
},
"isAuthenticated": {
"type": "boolean"
},
"isPermitted": {
"type": "boolean",
"default": false
},
"sessionTimeout": {
"type": "integer",
"default": 1800
},
"enableTouch": {
"type": "boolean",
"default": true
}
}
}
{ "user": "root", "message": "Oops!", "isAuthenticated": false, "isPermitted": false }
{
"user": "root",
"message": "Oops!",
"isAuthenticated": false,
"isPermitted": false
}
|
403 |
Forbidden! The user doesn't have sufficient permissions for 'positions' |
|
application/json
model |
example
{
"title": "authentication",
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"required": [
"isAuthenticated"
],
"properties": {
"user": {
"type": "string"
},
"accessToken": {
"type": "string"
},
"message": {
"type": "string"
},
"role": {
"type": "string"
},
"isAuthenticated": {
"type": "boolean"
},
"isPermitted": {
"type": "boolean",
"default": false
},
"sessionTimeout": {
"type": "integer",
"default": 1800
},
"enableTouch": {
"type": "boolean",
"default": true
}
}
}
{ "user": "root", "message": "You don't have sufficient permissions for ...", "role": "all", "isAuthenticated": true, "isPermitted": false }
{
"user": "root",
"message": "You don't have sufficient permissions for ...",
"role": "all",
"isAuthenticated": true,
"isPermitted": false
}
|
420 |
'positions' failed! |
|
application/json
model |
example
{
"title": "error object with delivery date",
"$schema": "http://json-schema.org/draft-04/schema#",
"javaType": "com.sos.joc.model.common.Err420",
"type": "object",
"required": [
"deliveryDate",
"error"
],
"properties": {
"deliveryDate": {
"description": "Value is UTC timestamp in ISO 8601 YYYY-MM-DDThh:mm:ss.sZ or empty",
"type": "string",
"format": "date-time"
},
"surveyDate": {
"description": "Value is UTC timestamp in ISO 8601 YYYY-MM-DDThh:mm:ss.sZ or empty",
"type": "string",
"format": "date-time"
},
"error": {
"javaType": "com.sos.joc.model.common.Err",
"type": "object",
"required": [
"code",
"message"
],
"properties": {
"code": {
"type": "string"
},
"message": {
"type": "string"
}
}
}
}
}
{ "deliveryDate": "2016-05-05T21:13:35Z", "surveyDate": "2016-05-05T21:13:33Z", "error": { "code": "JOC-420", "message": "positions failed!" } }
{
"deliveryDate": "2016-05-05T21:13:35Z",
"surveyDate": "2016-05-05T21:13:33Z",
"error": {
"code": "JOC-420",
"message": "positions failed!"
}
}
|
440 |
Login Timeout! The client's session has expired and must log in again. |
|
application/json
model |
example
{
"title": "authentication",
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"required": [
"isAuthenticated"
],
"properties": {
"user": {
"type": "string"
},
"accessToken": {
"type": "string"
},
"message": {
"type": "string"
},
"role": {
"type": "string"
},
"isAuthenticated": {
"type": "boolean"
},
"isPermitted": {
"type": "boolean",
"default": false
},
"sessionTimeout": {
"type": "integer",
"default": 1800
},
"enableTouch": {
"type": "boolean",
"default": true
}
}
}
{ "user": "root", "message": "Session has expired. Please log in again", "role": "all", "isAuthenticated": false, "isPermitted": false }
{
"user": "root",
"message": "Session has expired. Please log in again",
"role": "all",
"isAuthenticated": false,
"isPermitted": false
}
|