-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
117 additions
and
83 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
155 changes: 81 additions & 74 deletions
155
packages/element-templates-json-schema-shared/src/defs/condition.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,94 +1,101 @@ | ||
{ | ||
"$id": "#/condition", | ||
"type": "object", | ||
"description": "Condition(s) to activate the binding.", | ||
"allOf": [ | ||
{ | ||
"$ref": "examples.json#/condition" | ||
} | ||
], | ||
"definitions": { | ||
"properties": { | ||
"id": { | ||
"type": "string", | ||
"description": "Unique identifier of the property." | ||
}, | ||
"condition": { | ||
"type": "object", | ||
"required": [ | ||
"property" | ||
], | ||
"properties": { | ||
"type": { | ||
"$id": "#/condition/type", | ||
"const": "simple", | ||
"description": "The type of the condition.", | ||
"default": "simple" | ||
}, | ||
"property": { | ||
"$id": "#/condition/property", | ||
"type": "string", | ||
"description": "The id of the property to check." | ||
} | ||
}, | ||
"oneOf": [ | ||
"description": "Condition(s) to activate the binding.", | ||
"allOf": [ | ||
{ | ||
"$ref": "examples.json#/condition" | ||
} | ||
], | ||
"definitions": { | ||
"condition": { | ||
"type": "object", | ||
"required": [ | ||
"property" | ||
], | ||
"properties": { | ||
"equals": { | ||
"type": [ | ||
"string", | ||
"number", | ||
"boolean" | ||
] | ||
"type": { | ||
"$id": "#/condition/type", | ||
"const": "simple", | ||
"description": "The type of the condition.", | ||
"default": "simple" | ||
}, | ||
"property": { | ||
"$id": "#/condition/property", | ||
"type": "string", | ||
"description": "The id of the property to check." | ||
} | ||
}, | ||
"required": [ | ||
"equals" | ||
"oneOf": [ | ||
{ | ||
"properties": { | ||
"equals": { | ||
"type": [ | ||
"string", | ||
"number", | ||
"boolean" | ||
] | ||
} | ||
}, | ||
"required": [ | ||
"equals" | ||
] | ||
}, | ||
{ | ||
"properties": { | ||
"oneOf": { | ||
"type": "array", | ||
"items": { | ||
"type": [ | ||
"string", | ||
"number" | ||
] | ||
} | ||
} | ||
}, | ||
"required": [ | ||
"oneOf" | ||
] | ||
}, | ||
{ | ||
"properties": { | ||
"isActive": { | ||
"type": "boolean", | ||
"description": "For `true`, activates the property when given property is active" | ||
} | ||
}, | ||
"required": [ | ||
"isActive" | ||
] | ||
} | ||
] | ||
} | ||
}, | ||
"oneOf": [ | ||
{ | ||
"$ref": "#/properties/condition/definitions/condition" | ||
}, | ||
{ | ||
"properties": { | ||
"oneOf": { | ||
"allMatch": { | ||
"$id": "#/allMatch", | ||
"type": "array", | ||
"items": { | ||
"type": [ | ||
"string", | ||
"number" | ||
] | ||
} | ||
} | ||
}, | ||
"required": [ | ||
"oneOf" | ||
] | ||
}, | ||
{ | ||
"properties": { | ||
"isActive": { | ||
"type": "boolean", | ||
"description": "For `true`, activates the property when given property is active" | ||
"$ref": "#/properties/condition/definitions/condition" | ||
}, | ||
"minItems": 1 | ||
} | ||
}, | ||
"required": [ | ||
"isActive" | ||
"allMatch" | ||
] | ||
} | ||
] | ||
} | ||
}, | ||
"oneOf": [ | ||
{ | ||
"$ref": "#/definitions/condition" | ||
}, | ||
{ | ||
"properties": { | ||
"allMatch": { | ||
"$id": "#/allMatch", | ||
"type": "array", | ||
"items": { | ||
"$ref": "#/definitions/condition" | ||
}, | ||
"minItems": 1 | ||
} | ||
}, | ||
"required": [ | ||
"allMatch" | ||
] | ||
} | ||
] | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
packages/zeebe-element-templates-json-schema/test/fixtures/condition-on-itself.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
export const template = { | ||
'name': 'Condition', | ||
'id': 'example.com.condition', | ||
'appliesTo': [ | ||
'bpmn:ServiceTask' | ||
], | ||
'properties': [ | ||
{ | ||
'id': 'myId', | ||
'label': 'input 1', | ||
'type': 'String', | ||
'binding': { | ||
'type': 'property', | ||
'name': 'input1' | ||
}, | ||
'condition': { | ||
property: 'myId', | ||
equals: 'text' | ||
} | ||
} | ||
] | ||
}; | ||
|
||
export const errors = []; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters