Skip to content

Commit

Permalink
feat: disallow depending on itself for allMatch condition
Browse files Browse the repository at this point in the history
  • Loading branch information
barmac committed Jan 16, 2024
1 parent 4a0e2b6 commit e4438d1
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,36 @@
"not": {
"properties": {
"condition": {
"required": [
"property"
],
"properties": {
"property": {
"const": {
"$data": "2/id"
"anyOf": [
{
"required": [
"property"
],
"properties": {
"property": {
"const": {
"$data": "2/id"
}
}
}
},
{
"required": [
"allMatch"
],
"allMatch": {
"contains": {
"properties": {
"property": {
"const": {
"$data": "2/id"
}
}
}
}
}
}
}
]
}
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
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': {
'allMatch': [
{
'type': 'simple',
property: 'myId',
equals: 'text'
}
]
}
}
]
};

export const errors = [];
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ describe('validation', function() {
testTemplate('condition-wrong-type');


testTemplate('condition-multiple');
testOnly('condition-multiple');


testTemplate('condition-empty-allMatch');
Expand All @@ -294,6 +294,9 @@ describe('validation', function() {


testOnly('condition-on-itself');


testOnly('condition-allMatch-on-itself');
});


Expand Down

0 comments on commit e4438d1

Please sign in to comment.