Skip to content

Commit d136cf8

Browse files
committed
fix: allow to use output* properties without task definition
Related to camunda/tmp-camunda-modeler-adhoc-subprocess#2
1 parent 51d8cc5 commit d136cf8

File tree

7 files changed

+47
-283
lines changed

7 files changed

+47
-283
lines changed

packages/zeebe-element-templates-json-schema/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ All notable changes to [@camunda/zeebe-element-templates-json-schema](https://gi
66

77
___Note:__ Yet to be released changes appear here._
88

9+
## 0.31.1
10+
11+
* `FIX`: allow to use `output*` properties without task definition in `bpmn:AdHocSubProcess`
12+
913
## 0.31.0
1014

1115
* `FEAT`: support `activeElementsCollection` property on `zeebe:adHoc` ([#198](https://github.com/camunda/element-templates-json-schema/pull/198))

packages/zeebe-element-templates-json-schema/src/defs/template/adHoc.json

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
}
6363
},
6464
{
65-
"$comment": "When zeebe:adHoc output properties are used, all three required bindings must be present together",
65+
"$comment": "When zeebe:adHoc output properties are used, both required bindings must be present together",
6666
"if": {
6767
"properties": {
6868
"properties": {
@@ -145,29 +145,6 @@
145145
"binding"
146146
]
147147
}
148-
},
149-
{
150-
"contains": {
151-
"properties": {
152-
"binding": {
153-
"properties": {
154-
"type": {
155-
"const": "zeebe:taskDefinition"
156-
},
157-
"property": {
158-
"const": "type"
159-
}
160-
},
161-
"required": [
162-
"type",
163-
"property"
164-
]
165-
}
166-
},
167-
"required": [
168-
"binding"
169-
]
170-
}
171148
}
172149
]
173150
}

packages/zeebe-element-templates-json-schema/src/error-messages.json

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -534,24 +534,6 @@
534534
],
535535
"errorMessage": "When \"outputElement\" is defined for \"zeebe:adHoc\", \"outputCollection\" must be defined, too"
536536
},
537-
{
538-
"path": [
539-
"definitions",
540-
"template",
541-
"allOf",
542-
1,
543-
"allOf",
544-
9,
545-
"allOf",
546-
1,
547-
"then",
548-
"properties",
549-
"properties",
550-
"allOf",
551-
2
552-
],
553-
"errorMessage": "When using \"zeebe:adHoc\" with properties \"outputCollection\" and \"outputElement\", \"zeebe:taskDefinition\" with property=\"type\" must be set on the same element"
554-
},
555537
{
556538
"path": [
557539
"definitions",

packages/zeebe-element-templates-json-schema/test/fixtures/ad-hoc/missing-task-definition-type-property.js

Lines changed: 0 additions & 126 deletions
This file was deleted.

packages/zeebe-element-templates-json-schema/test/fixtures/ad-hoc/missing-task-definition.js

Lines changed: 0 additions & 111 deletions
This file was deleted.

packages/zeebe-element-templates-json-schema/test/fixtures/ad-hoc/valid.js

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,48 @@ export const template = [
5555
'value': '=anActiveElementsCollection'
5656
}
5757
]
58+
},
59+
{
60+
'$schema': 'https://unpkg.com/@camunda/zeebe-element-templates-json-schema/resources/schema.json',
61+
'name': 'AdHoc Template - BPMN implementation',
62+
'id': 'io.camunda.examples.AdHoc.Valid.BPMN',
63+
'description': 'activeElementsCollection, completionCondition, and cancelRemainingInstances',
64+
'version': 2,
65+
'appliesTo': [ 'bpmn:AdHocSubProcess' ],
66+
'elementType': { 'value': 'bpmn:AdHocSubProcess' },
67+
'properties': [
68+
{
69+
'type': 'Hidden',
70+
'binding': {
71+
'type': 'property',
72+
'name': 'cancelRemainingInstances'
73+
},
74+
'value': 'false'
75+
},
76+
{
77+
'type': 'String',
78+
'feel': 'required',
79+
'binding': {
80+
'type': 'property',
81+
'name': 'completionCondition'
82+
}
83+
},
84+
{
85+
'type': 'Hidden',
86+
'binding': { 'type': 'zeebe:adHoc', 'property': 'activeElementsCollection' },
87+
'value': '=anActiveElementsCollection'
88+
},
89+
{
90+
'type': 'Hidden',
91+
'binding': { 'type': 'zeebe:adHoc', 'property': 'outputCollection' },
92+
'value': 'toolCallResults'
93+
},
94+
{
95+
'type': 'Hidden',
96+
'binding': { 'type': 'zeebe:adHoc', 'property': 'outputElement' },
97+
'value': '={ id: toolCall._meta.id, name: toolCall._meta.name, content: toolCallResult }'
98+
}
99+
]
58100
}
59101
];
60102

packages/zeebe-element-templates-json-schema/test/spec/validationSpec.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -662,10 +662,6 @@ describe('validation', function() {
662662

663663
it('ad-hoc/missing-output-element-feel');
664664

665-
it('ad-hoc/missing-task-definition');
666-
667-
it('ad-hoc/missing-task-definition-type-property');
668-
669665
it('ad-hoc/valid');
670666

671667
});

0 commit comments

Comments
 (0)