{
    "title": "workflow",
    "$schema": "http://json-schema.org/draft-04/schema#",
    "javaType": "com.sos.jobscheduler.model.workflow.WorkflowJobs",
    "description": "only for the validation, not used as pojo",
    "type": "object",
    "required": [
        "jobs"
    ],
    "properties": {
        "jobs": {
            "javaType": "com.sos.jobscheduler.model.workflow.Jobs",
            "type": "object",
            "additionalProperties": {
                "javaType": "com.sos.jobscheduler.model.job.Job",
                "type": "object",
                "javaInterfaces": [
                    "com.sos.joc.model.common.IConfigurationObject"
                ],
                "required": [
                    "agentName",
                    "executable",
                    "taskLimit"
                ],
                "properties": {
                    "agentName": {
                        "type": "string",
                        "pattern": "^[^<>]*$",
                        "maxLength": 255
                    },
                    "executable": {
                        "javaType": "com.sos.jobscheduler.model.job.ExecutableScript",
                        "type": "object",
                        "required": [
                            "TYPE",
                            "script"
                        ],
                        "propertyOrder": [
                            "TYPE",
                            "script"
                        ],
                        "properties": {
                            "script": {
                                "type": "string",
                                "minLength": 1
                            },
                            "TYPE": {
                                "type": "string",
                                "enum": [
                                    "ExecutableScript"
                                ],
                                "javaEnumNames": [
                                    "ExecutableScript"
                                ],
                                "default": "ExecutableScript"
                            }
                        },
                        "additionalProperties": false
                    },
                    "returnCodeMeaning": {
                        "javaType": "com.sos.jobscheduler.model.job.JobReturnCode",
                        "type": "object",
                        "oneOf": [
                            {
                                "required": [
                                    "success"
                                ]
                            },
                            {
                                "required": [
                                    "failure"
                                ]
                            }
                        ],
                        "properties": {
                            "success": {
                                "type": "array",
                                "minItems": 1,
                                "items": {
                                    "type": "integer"
                                }
                            },
                            "failure": {
                                "type": "array",
                                "minItems": 1,
                                "items": {
                                    "type": "integer"
                                }
                            }
                        },
                        "additionalProperties": false
                    },
                    "taskLimit": {
                        "type": "integer",
                        "minimum": 1,
                        "default": 1
                    },
                    "timeout": {
                        "type": "integer",
                        "minimum": 0
                    },
                    "graceTimeout": {
                        "type": "integer",
                        "minimum": 0
                    },
                    "jobClass": {
                        "description": "absolute path of a JobScheduler object.",
                        "type": "string",
                        "pattern": "^(/|(/[^/\\<>?:\"|*]+)+)$",
                        "maxLength": 255,
                        "minLength": 1
                    },
                    "defaultArguments": {
                        "description": "a map for arbitrary key-value pairs",
                        "javaType": "com.sos.jobscheduler.model.common.Variables",
                        "type": "object",
                        "returnCode": {
                            "type": "integer"
                        },
                        "additionalProperties": {
                            "type": "string"
                        }
                    },
                    "title": {
                        "type": "string",
                        "pattern": "^[^<>]*$",
                        "maxLength": 255
                    },
                    "documentationId": {
                        "type": "number",
                        "format": "utc-millisec",
                        "minimum": 0
                    },
                    "logLevel": {
                        "javaType": "com.sos.joc.model.inventory.common.JobLogLevel",
                        "type": "string",
                        "enum": [
                            "INFO",
                            "DEBUG",
                            "TRACE"
                        ]
                    },
                    "criticality": {
                        "javaType": "com.sos.joc.model.inventory.common.JobCriticality",
                        "type": "string",
                        "enum": [
                            "NORMAL",
                            "CRITICAL"
                        ]
                    },
                    "path": {
                        "description": "absolute path of a JobScheduler object.",
                        "type": "string",
                        "pattern": "^(/|(/[^/\\<>?:\"|*]+)+)$",
                        "maxLength": 255,
                        "minLength": 1
                    }
                },
                "additionalProperties": false
            }
        }
    },
    "additionalProperties": true
}