{
    "title": "Orderlist",
    "$schema": "http://json-schema.org/draft-04/schema#",
    "javaType": "com.sos.controller.model.order.OrderList",
    "type": "object",
    "properties": {
        "eventId": {
            "type": "string"
        },
        "array": {
            "type": "array",
            "items": {
                "javaType": "com.sos.controller.model.order.OrderItem",
                "type": "object",
                "properties": {
                    "id": {
                        "type": "string"
                    },
                    "arguments": {
                        "description": "a map for arbitrary key-value pairs",
                        "javaType": "com.sos.inventory.model.common.Variables",
                        "type": "object",
                        "additionalProperties": true
                    },
                    "workflowPosition": {
                        "javaType": "com.sos.controller.model.workflow.WorkflowPosition",
                        "type": "object",
                        "required": [
                            "workflowId",
                            "position"
                        ],
                        "properties": {
                            "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
                            },
                            "position": {
                                "description": "Actually, each even item is a string, each odd item is an integer",
                                "type": "array",
                                "items": {
                                    "anyOf": [
                                        {
                                            "type": "integer"
                                        },
                                        {
                                            "type": "string"
                                        }
                                    ]
                                }
                            }
                        },
                        "additionalProperties": false
                    },
                    "state": {
                        "javaType": "com.sos.controller.model.order.OrderState",
                        "type": "object",
                        "properties": {
                            "TYPE": {
                                "type": "string"
                            },
                            "expected": {
                                "description": "set if state == ExpectingNotices",
                                "type": "array",
                                "items": {
                                    "type": "object",
                                    "javaType": "com.sos.controller.model.order.ExpectedNotice",
                                    "properties": {
                                        "boardPath": {
                                            "type": "string"
                                        },
                                        "noticeId": {
                                            "type": "string"
                                        }
                                    },
                                    "additionalProperties": false
                                }
                            },
                            "cycleState": {
                                "type": "object",
                                "javaType": "com.sos.controller.model.order.OrderCycleState",
                                "description": "set if state == BetweenCycles or processing inside a cycle",
                                "properties": {
                                    "next": {
                                        "description": "Value is UTC timestamp in ISO 8601 YYYY-MM-DDThh:mm:ss.sZ or empty",
                                        "type": "string",
                                        "format": "date-time"
                                    },
                                    "since": {
                                        "description": "Value is UTC timestamp in ISO 8601 YYYY-MM-DDThh:mm:ss.sZ or empty",
                                        "type": "string",
                                        "format": "date-time"
                                    },
                                    "index": {
                                        "type": "integer"
                                    }
                                },
                                "additionalProperties": false
                            },
                            "subagentId": {
                                "type": "string"
                            }
                        },
                        "additionalProperties": false
                    },
                    "attachedState": {
                        "javaType": "com.sos.controller.model.order.OrderAttachedState",
                        "type": "object",
                        "properties": {
                            "TYPE": {
                                "description": "Attaching, Attached, ...",
                                "type": "string"
                            },
                            "agentName": {
                                "type": "string"
                            }
                        },
                        "additionalProperties": false
                    },
                    "historicOutcomes": {
                        "type": "array",
                        "items": {
                            "type": "object",
                            "javaType": "com.sos.controller.model.workflow.HistoricOutcome",
                            "properties": {
                                "position": {
                                    "description": "Actually, each even item is a string, each odd item is an integer",
                                    "type": "array",
                                    "items": {
                                        "anyOf": [
                                            {
                                                "type": "integer"
                                            },
                                            {
                                                "type": "string"
                                            }
                                        ]
                                    }
                                },
                                "outcome": {
                                    "javaType": "com.sos.controller.model.common.Outcome",
                                    "type": "object",
                                    "required": [
                                        "TYPE"
                                    ],
                                    "properties": {
                                        "TYPE": {
                                            "description": "Succeeded, Failed, Disrupted, Cancelled, Killed, TimedOut",
                                            "type": "string"
                                        },
                                        "namedValues": {
                                            "description": "a map for arbitrary key-value pairs",
                                            "javaType": "com.sos.inventory.model.common.Variables",
                                            "type": "object",
                                            "additionalProperties": true
                                        },
                                        "outcome": {
                                            "description": "outcome-schema.json"
                                        }
                                    },
                                    "additionalProperties": false
                                }
                            },
                            "additionalProperties": false
                        }
                    },
                    "scheduledFor": {
                        "type": "number",
                        "format": "utc-millisec",
                        "minimum": 0
                    },
                    "isSuspended": {
                        "type": "boolean"
                    },
                    "removeWhenTerminated": {
                        "type": "boolean"
                    },
                    "stopPositions": {
                        "type": "array",
                        "items": {
                            "anyOf": [
                                {
                                    "description": "Actually, each even item is a string, each odd item is an integer",
                                    "type": "array",
                                    "items": {
                                        "anyOf": [
                                            {
                                                "type": "integer"
                                            },
                                            {
                                                "type": "string"
                                            }
                                        ]
                                    }
                                },
                                {
                                    "type": "string"
                                }
                            ]
                        }
                    }
                },
                "additionalProperties": false
            }
        }
    },
    "additionalProperties": false
}