RulesEngine/schema/workflow-schema.json

144 lines
2.7 KiB
JSON

{
"$schema": "http://json-schema.org/draft-07/schema#",
"definitions": {
"Rule": {
"title": "Rule",
"properties": {
"RuleName": {
"type": "string"
},
"Operator": {
"enum": [
"And",
"AndAlso",
"Or",
"OrElse"
]
},
"ErrorMessage": {
"type": "string"
},
"ErrorType": {
"enum": [
"Warning",
"Error"
]
},
"SuccessEvent": {
"type": "string"
},
"Rules": {
"type": "array",
"items": {
"anyOf": [
{
"$ref": "#/definitions/LeafRule"
},
{
"$ref": "#/definitions/Rule"
}
]
}
},
"Properties": {
"type": "object"
},
"Actions": {
"$ref": "#/definitions/RuleActions"
}
},
"required": [
"RuleName",
"Operator",
"Rules"
],
"type": "object"
},
"LeafRule": {
"title": "Leaf Rule",
"type": "object",
"required": [
"RuleName",
"Expression"
],
"properties": {
"RuleName": {
"type": "string"
},
"Expression": {
"type": "string"
},
"RuleExpressionType": {
"enum": [
"LambdaExpression"
]
},
"ErrorMessage": {
"type": "string"
},
"ErrorType": {
"enum": [
"Warning",
"Error"
]
},
"SuccessEvent": {
"type": "string"
},
"Properties": {
"type": "object"
},
"Actions": {
"$ref": "#/definitions/RuleActions"
}
}
},
"ActionInfo": {
"properties": {
"Name": {
"type": "string"
},
"Context": {
"type": "object"
}
},
"required": [
"Name"
]
},
"RuleActions": {
"properties": {
"OnSuccess": {
"$ref": "#/definitions/ActionInfo"
},
"OnFailure": {
"$ref": "#/definitions/ActionInfo"
}
}
}
},
"properties": {
"WorkFlowName": {
"type": "string"
},
"Rules": {
"type": "array",
"items": {
"anyOf": [
{
"$ref": "#/definitions/LeafRule"
},
{
"$ref": "#/definitions/Rule"
}
]
}
}
},
"required": [
"WorkFlowName",
"Rules"
],
"type": "object"
}