{
    "title": "jobChainNode",
    "id": "schemas/joe/jobChain/jobChainNode",
    "$schema": "http://json-schema.org/draft-04/schema#",
    "javaType": "com.sos.joc.model.joe.jobchain.JobChainNode",
    "type": "object",
    "extends": {
        "javaType": "JobChainEndNode"
    },
    "properties": {
        "job": {
            "description": "path to job",
            "type": "string"
        },
        "nextState": {
            "description": "name of the next job chain node in successful case",
            "type": "string"
        },
        "errorState": {
            "description": "name of the next job chain node in erroneous case",
            "type": "string"
        },
        "onError": {
            "description": "possible values: suspend and setback",
            "type": "string"
        },
        "delay": {
            "id": "schemas/common/nonNegativeInteger",
            "type": "integer",
            "minimum": 0
        },
        "onReturnCodes": {
            "type": "object",
            "javaType": "com.sos.joc.model.joe.jobchain.OnReturnCodes",
            "properties": {
                "onReturnCodeList": {
                    "xmlElement": "on_return_code",
                    "type": "array",
                    "items": {
                        "type": "object",
                        "javaType": "com.sos.joc.model.joe.jobchain.OnReturnCode",
                        "required": [
                            "returnCode"
                        ],
                        "properties": {
                            "returnCode": {
                                "type": "string"
                            },
                            "toState": {
                                "type": "object",
                                "javaType": "com.sos.joc.model.joe.jobchain.ToState",
                                "required": [
                                    "state"
                                ],
                                "properties": {
                                    "state": {
                                        "description": "name of a job chain node",
                                        "type": "string"
                                    }
                                }
                            },
                            "addOrder": {
                                "id": "schemas/joe/order/returnCodeAddOrder",
                                "javaType": "com.sos.joc.model.joe.order.ReturnCodeAddOrder",
                                "type": "object",
                                "required": [
                                    "xmlns",
                                    "jobChain",
                                    "id"
                                ],
                                "properties": {
                                    "xmlns": {
                                        "type": "string",
                                        "default": "https://jobscheduler-plugins.sos-berlin.com/NodeOrderPlugin"
                                    },
                                    "jobChain": {
                                        "type": "string"
                                    },
                                    "id": {
                                        "type": "string"
                                    },
                                    "params": {
                                        "id": "schemas/joe/common/params",
                                        "javaType": "com.sos.joc.model.joe.common.Params",
                                        "type": "object",
                                        "properties": {
                                            "paramList": {
                                                "xmlElement": "param",
                                                "type": "array",
                                                "items": {
                                                    "id": "schemas/joe/common/param",
                                                    "javaType": "com.sos.joc.model.joe.common.Param",
                                                    "type": "object",
                                                    "required": [
                                                        "name",
                                                        "value"
                                                    ],
                                                    "properties": {
                                                        "name": {
                                                            "type": "string"
                                                        },
                                                        "value": {
                                                            "type": "string"
                                                        }
                                                    }
                                                }
                                            },
                                            "copyParams": {
                                                "decription": "Only valid in start_job and add_order. Possible values for 'from' is task or order.",
                                                "type": "array",
                                                "uniqueItems": true,
                                                "items": {
                                                    "type": "object",
                                                    "javaType": "com.sos.joc.model.joe.common.CopyParams",
                                                    "xmlElement": "copy_params",
                                                    "required": [
                                                        "from"
                                                    ],
                                                    "properties": {
                                                        "from": {
                                                            "type": "string"
                                                        }
                                                    }
                                                }
                                            },
                                            "includes": {
                                                "type": "array",
                                                "items": {
                                                    "id": "schemas/joe/common/paramInclude",
                                                    "javaType": "com.sos.joc.model.joe.common.ParamInclude",
                                                    "xmlElement": "include",
                                                    "type": "object",
                                                    "properties": {
                                                        "file": {
                                                            "type": "string"
                                                        },
                                                        "liveFile": {
                                                            "type": "string"
                                                        },
                                                        "node": {
                                                            "type": "string"
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}