Skip to content

Commit 50b9c04

Browse files
authored
feat: support zeebe:calledDecision binding
Related to camunda/camunda-modeler#5025
1 parent 18de06d commit 50b9c04

18 files changed

+1311
-7
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ All notable changes to [@camunda/zeebe-element-templates-json-schema](https://gi
66

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

9-
* `FEAT`: support `zeebe:formDefinition` binding ([#169](https://github.com/camunda/element-templates-json-schema/pull/169)
9+
* `FEAT`: support `zeebe:calledDecision` binding ([#165](https://github.com/camunda/element-templates-json-schema/pull/165))
10+
* `FEAT`: support `zeebe:formDefinition` binding ([#169](https://github.com/camunda/element-templates-json-schema/pull/169))
1011

1112
## 0.23.0
1213

packages/zeebe-element-templates-json-schema/src/defs/properties.json

Lines changed: 89 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,8 @@
5959
"zeebe:taskDefinition",
6060
"zeebe:calledElement",
6161
"zeebe:linkedResource",
62-
"zeebe:formDefinition"
62+
"zeebe:formDefinition",
63+
"zeebe:calledDecision"
6364
]
6465
}
6566
},
@@ -422,8 +423,67 @@
422423
}
423424
}
424425
}
426+
},
427+
{
428+
"if": {
429+
"properties": {
430+
"binding": {
431+
"properties": {
432+
"type": { "const": "zeebe:calledDecision" },
433+
"property": { "const": "resultVariable" }
434+
},
435+
"required": ["type", "property"]
436+
}
437+
},
438+
"required": ["binding"]
439+
},
440+
"then": {
441+
"not": {
442+
"required": ["feel"]
443+
}
444+
}
445+
},
446+
{
447+
"if": {
448+
"properties": {
449+
"binding": {
450+
"properties": {
451+
"type": {
452+
"const": "zeebe:calledDecision"
453+
},
454+
"property": {
455+
"enum": [
456+
"resultVariable",
457+
"decisionId"
458+
]
459+
}
460+
},
461+
"required": [
462+
"type",
463+
"property"
464+
]
465+
}
466+
},
467+
"required": [
468+
"binding"
469+
]
470+
},
471+
"then": {
472+
"required": [
473+
"type"
474+
],
475+
"properties": {
476+
"type": {
477+
"enum": [
478+
"Hidden",
479+
"String",
480+
"Text",
481+
"Dropdown"
482+
]
483+
}
484+
}
485+
}
425486
}
426-
427487
],
428488
"properties": {
429489
"binding": {
@@ -578,6 +638,31 @@
578638
]
579639
}
580640
},
641+
{
642+
"if": {
643+
"properties": {
644+
"type": {
645+
"const": "zeebe:calledDecision"
646+
}
647+
},
648+
"required": [
649+
"type"
650+
]
651+
},
652+
"then": {
653+
"properties": {
654+
"property": {
655+
"enum": [
656+
"decisionId",
657+
"resultVariable"
658+
]
659+
}
660+
},
661+
"required": [
662+
"property"
663+
]
664+
}
665+
},
581666
{
582667
"$ref": "examples.json#/binding"
583668
}
@@ -600,7 +685,8 @@
600685
"zeebe:calledElement",
601686
"zeebe:linkedResource",
602687
"zeebe:userTask",
603-
"zeebe:formDefinition"
688+
"zeebe:formDefinition",
689+
"zeebe:calledDecision"
604690
]
605691
},
606692
"name": {

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

Lines changed: 143 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -318,6 +318,149 @@
318318
}
319319
]
320320
}
321+
},
322+
{
323+
"if": {
324+
"properties": {
325+
"properties": {
326+
"contains": {
327+
"properties": {
328+
"binding": {
329+
"properties": {
330+
"type": {
331+
"const": "zeebe:calledDecision"
332+
}
333+
},
334+
"required": [
335+
"type"
336+
]
337+
}
338+
},
339+
"required": [
340+
"binding"
341+
]
342+
}
343+
}
344+
},
345+
"required": [
346+
"properties"
347+
]
348+
},
349+
"then": {
350+
"anyOf": [
351+
{
352+
"required": [
353+
"elementType"
354+
],
355+
"properties": {
356+
"elementType": {
357+
"required": [
358+
"value"
359+
],
360+
"properties": {
361+
"value": {
362+
"const": "bpmn:BusinessRuleTask"
363+
}
364+
}
365+
}
366+
}
367+
},
368+
{
369+
"required": [
370+
"appliesTo"
371+
],
372+
"properties": {
373+
"appliesTo": {
374+
"const": [
375+
"bpmn:BusinessRuleTask"
376+
]
377+
}
378+
}
379+
}
380+
],
381+
"allOf": [
382+
{
383+
"properties": {
384+
"properties": {
385+
"contains": {
386+
"properties": {
387+
"binding": {
388+
"properties": {
389+
"property": {
390+
"const": "decisionId"
391+
}
392+
},
393+
"required": [
394+
"property"
395+
]
396+
}
397+
},
398+
"required": [
399+
"binding"
400+
]
401+
}
402+
}
403+
}
404+
},
405+
{
406+
"properties": {
407+
"properties": {
408+
"contains": {
409+
"properties": {
410+
"binding": {
411+
"properties": {
412+
"property": {
413+
"const": "resultVariable"
414+
}
415+
},
416+
"required": [
417+
"property"
418+
]
419+
}
420+
},
421+
"required": [
422+
"binding"
423+
]
424+
}
425+
}
426+
}
427+
},
428+
{
429+
"not": {
430+
"properties": {
431+
"properties": {
432+
"contains": {
433+
"properties": {
434+
"binding": {
435+
"properties": {
436+
"type": {
437+
"enum": [
438+
"zeebe:taskDefinition",
439+
"zeebe:taskDefinition:type"
440+
]
441+
}
442+
},
443+
"required": [
444+
"type"
445+
]
446+
}
447+
},
448+
"required": [
449+
"binding"
450+
]
451+
}
452+
}
453+
},
454+
"required": [
455+
"properties"
456+
]
457+
}
458+
}
459+
],
460+
"required": [
461+
"properties"
462+
]
463+
}
321464
}
322465
]
323466
}

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

Lines changed: 70 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@
149149
"properties",
150150
"type"
151151
],
152-
"errorMessage": "invalid property.binding type ${0}; must be any of { property, zeebe:taskDefinition:type, zeebe:input, zeebe:output, zeebe:property, zeebe:taskHeader, bpmn:Message#property, bpmn:Message#zeebe:subscription#property, zeebe:taskDefinition, zeebe:calledElement, zeebe:linkedResource, zeebe:userTask }"
152+
"errorMessage": "invalid property.binding type ${0}; must be any of { property, zeebe:taskDefinition:type, zeebe:input, zeebe:output, zeebe:property, zeebe:taskHeader, bpmn:Message#property, bpmn:Message#zeebe:subscription#property, zeebe:taskDefinition, zeebe:calledElement, zeebe:linkedResource, zeebe:userTask, zeebe:formDefinition, zeebe:calledDecision }"
153153
},
154154
{
155155
"path": [
@@ -219,5 +219,74 @@
219219
0
220220
],
221221
"errorMessage": "When using \"zeebe:formDefinition\", \"zeebe:userTask\" must be set on the same element"
222+
},
223+
{
224+
"path": [
225+
"definitions",
226+
"template",
227+
"allOf",
228+
1,
229+
"allOf",
230+
5,
231+
"then",
232+
"allOf",
233+
0,
234+
"properties",
235+
"properties",
236+
"contains",
237+
"properties",
238+
"binding",
239+
"properties",
240+
"property"
241+
],
242+
"errorMessage": "Binding type \"zeebe:calledDecision\" must contain property \"decisionId\""
243+
},
244+
{
245+
"path": [
246+
"definitions",
247+
"template",
248+
"allOf",
249+
1,
250+
"allOf",
251+
5,
252+
"then",
253+
"allOf",
254+
1,
255+
"properties",
256+
"properties",
257+
"contains",
258+
"properties",
259+
"binding",
260+
"properties",
261+
"property"
262+
],
263+
"errorMessage": "Binding type \"zeebe:calledDecision\" must contain property \"resultVariable\""
264+
},
265+
{
266+
"path": [
267+
"definitions",
268+
"template",
269+
"allOf",
270+
1,
271+
"allOf",
272+
5,
273+
"then",
274+
"allOf",
275+
2
276+
],
277+
"errorMessage": "Binding type \"zeebe:taskDefinition\" or \"zeebe:taskDefinition:type\" cannot be set when binding type \"zeebe:calledDecision\" is set."
278+
},
279+
{
280+
"path": [
281+
"definitions",
282+
"properties",
283+
"allOf",
284+
1,
285+
"items",
286+
"allOf",
287+
15,
288+
"then"
289+
],
290+
"errorMessage": "Property \"resultVariable\" cannot be a Feel expression"
222291
}
223292
]

0 commit comments

Comments
 (0)