{
    "title": "jobStreamJob",
    "$schema": "http://json-schema.org/draft-04/schema#",
    "description": "A job started by the jobstream starter",
    "javaType": "com.sos.joc.model.jobstreams.JobStreamJob",
    "type": "object",
    "properties": {
        "jobId": {
            "type": "number",
            "format": "utc-millisec",
            "minimum": 0
        },
        "job": {
            "type": "string",
            "pattern": "^[^<>]*$",
            "maxLength": 255
        },
        "startDelay": {
            "type": "number",
            "format": "utc-millisec",
            "minimum": 0
        },
        "nextPeriod": {
            "description": "Date time. Value is UTC timestamp in ISO 8601 YYYY-MM-DDThh:mm:ss.sZ",
            "type": "string",
            "format": "date-time"
        },
        "skipOutCondition": {
            "type": "boolean"
        },
        "inconditions": {
            "type": "array",
            "items": {
                "description": "In Condition",
                "javaType": "com.sos.joc.model.jobstreams.InCondition",
                "type": "object",
                "properties": {
                    "id": {
                        "type": "number",
                        "format": "utc-millisec",
                        "minimum": 0
                    },
                    "jobStream": {
                        "type": "string",
                        "pattern": "^[^<>]*$",
                        "maxLength": 255
                    },
                    "consumed": {
                        "type": "boolean"
                    },
                    "markExpression": {
                        "type": "boolean"
                    },
                    "skipOutCondition": {
                        "type": "boolean"
                    },
                    "haveReferenceToOtherFolders": {
                        "type": "boolean"
                    },
                    "conditionExpression": {
                        "description": "Expression for Condition",
                        "javaType": "com.sos.joc.model.jobstreams.ConditionExpression",
                        "type": "object",
                        "properties": {
                            "expression": {
                                "type": "string",
                                "pattern": "^(?s)((?!<script( |>)|<svg/on).)*$"
                            },
                            "validatedExpression": {
                                "type": "string",
                                "pattern": "^(?s)((?!<script( |>)|<svg/on).)*$"
                            },
                            "value": {
                                "type": "boolean"
                            },
                            "jobStreamEvents": {
                                "type": "array",
                                "items": {
                                    "type": "string",
                                    "pattern": "^[^<>]*$",
                                    "maxLength": 255
                                }
                            }
                        }
                    },
                    "nextPeriod": {
                        "description": "Date time. Value is UTC timestamp in ISO 8601 YYYY-MM-DDThh:mm:ss.sZ",
                        "type": "string",
                        "format": "date-time"
                    },
                    "inconditionCommands": {
                        "type": "array",
                        "items": {
                            "description": "In Condition",
                            "javaType": "com.sos.joc.model.jobstreams.InConditionCommand",
                            "type": "object",
                            "properties": {
                                "id": {
                                    "type": "number",
                                    "format": "utc-millisec",
                                    "minimum": 0
                                },
                                "command": {
                                    "type": "string",
                                    "pattern": "^[^<>]*$",
                                    "maxLength": 255
                                },
                                "commandParam": {
                                    "type": "string",
                                    "pattern": "^[^<>]*$",
                                    "maxLength": 255
                                }
                            }
                        }
                    },
                    "outconditions": {
                        "type": "array",
                        "items": {
                            "description": "List of all Conditions using an event",
                            "javaType": "com.sos.joc.model.jobstreams.JobstreamConditions",
                            "type": "object",
                            "properties": {
                                "jobStream": {
                                    "type": "string",
                                    "pattern": "^[^<>]*$",
                                    "maxLength": 255
                                },
                                "jobs": {
                                    "type": "array",
                                    "items": {
                                        "description": "In Condition",
                                        "javaType": "com.sos.joc.model.jobstreams.ConditionRef",
                                        "type": "object",
                                        "properties": {
                                            "job": {
                                                "description": "absolute path based on live folder of a JobScheduler object.",
                                                "type": "string",
                                                "pattern": "^(/|(/[^/\\<>?:\"|*]+)+)$",
                                                "maxLength": 255
                                            },
                                            "expressions": {
                                                "type": "array",
                                                "items": {
                                                    "type": "string",
                                                    "pattern": "^(?s)((?!<script( |>)|<svg/on).)*$"
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        },
        "outconditions": {
            "type": "array",
            "items": {
                "description": "Out Condition",
                "javaType": "com.sos.joc.model.jobstreams.OutCondition",
                "type": "object",
                "properties": {
                    "id": {
                        "type": "number",
                        "format": "utc-millisec",
                        "minimum": 0
                    },
                    "jobStream": {
                        "type": "string",
                        "pattern": "^[^<>]*$",
                        "maxLength": 255
                    },
                    "conditionExpression": {
                        "description": "Expression for Condition",
                        "javaType": "com.sos.joc.model.jobstreams.ConditionExpression",
                        "type": "object",
                        "properties": {
                            "expression": {
                                "type": "string",
                                "pattern": "^(?s)((?!<script( |>)|<svg/on).)*$"
                            },
                            "validatedExpression": {
                                "type": "string",
                                "pattern": "^(?s)((?!<script( |>)|<svg/on).)*$"
                            },
                            "value": {
                                "type": "boolean"
                            },
                            "jobStreamEvents": {
                                "type": "array",
                                "items": {
                                    "type": "string",
                                    "pattern": "^[^<>]*$",
                                    "maxLength": 255
                                }
                            }
                        }
                    },
                    "outconditionEvents": {
                        "type": "array",
                        "items": {
                            "description": "Out Condition Event",
                            "javaType": "com.sos.joc.model.jobstreams.OutConditionEvent",
                            "type": "object",
                            "properties": {
                                "id": {
                                    "type": "number",
                                    "format": "utc-millisec",
                                    "minimum": 0
                                },
                                "command": {
                                    "type": "string",
                                    "pattern": "^[^<>]*$",
                                    "maxLength": 255
                                },
                                "event": {
                                    "type": "string",
                                    "pattern": "^[^<>]*$",
                                    "maxLength": 255
                                },
                                "exists": {
                                    "type": "boolean"
                                },
                                "globalEvent": {
                                    "type": "boolean"
                                },
                                "existsInJobStream": {
                                    "type": "boolean"
                                },
                                "jobStream": {
                                    "type": "string",
                                    "pattern": "^[^<>]*$",
                                    "maxLength": 255
                                }
                            }
                        }
                    },
                    "inconditions": {
                        "type": "array",
                        "items": {
                            "description": "List of all Conditions using an event",
                            "javaType": "com.sos.joc.model.jobstreams.JobstreamConditions",
                            "type": "object",
                            "properties": {
                                "jobStream": {
                                    "type": "string",
                                    "pattern": "^[^<>]*$",
                                    "maxLength": 255
                                },
                                "jobs": {
                                    "type": "array",
                                    "items": {
                                        "description": "In Condition",
                                        "javaType": "com.sos.joc.model.jobstreams.ConditionRef",
                                        "type": "object",
                                        "properties": {
                                            "job": {
                                                "description": "absolute path based on live folder of a JobScheduler object.",
                                                "type": "string",
                                                "pattern": "^(/|(/[^/\\<>?:\"|*]+)+)$",
                                                "maxLength": 255
                                            },
                                            "expressions": {
                                                "type": "array",
                                                "items": {
                                                    "type": "string",
                                                    "pattern": "^(?s)((?!<script( |>)|<svg/on).)*$"
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}