Skip to content

Commit b80004f

Browse files
feat: support zeebe:script binding property
Related to camunda/camunda-modeler#5026
1 parent 9216393 commit b80004f

21 files changed

+1461
-13
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ 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:script` binding ([#166](https://github.com/camunda/element-templates-json-schema/pull/166))
910
* `FEAT`: support `zeebe:calledDecision` binding ([#165](https://github.com/camunda/element-templates-json-schema/pull/165))
1011
* `FEAT`: support `zeebe:formDefinition` binding ([#169](https://github.com/camunda/element-templates-json-schema/pull/169))
1112

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

Lines changed: 157 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,8 @@
6060
"zeebe:calledElement",
6161
"zeebe:linkedResource",
6262
"zeebe:formDefinition",
63-
"zeebe:calledDecision"
63+
"zeebe:calledDecision",
64+
"zeebe:script"
6465
]
6566
}
6667
},
@@ -327,16 +328,27 @@
327328
"binding": {
328329
"properties": {
329330
"type": {
330-
"enum": ["zeebe:input", "zeebe:output"]
331+
"enum": [
332+
"zeebe:input",
333+
"zeebe:output"
334+
]
331335
}
332336
},
333-
"required": ["type"]
337+
"required": [
338+
"type"
339+
]
334340
},
335341
"type": {
336-
"enum": ["Boolean", "Number"]
342+
"enum": [
343+
"Boolean",
344+
"Number"
345+
]
337346
}
338347
},
339-
"required": ["binding", "type"]
348+
"required": [
349+
"binding",
350+
"type"
351+
]
340352
},
341353
"then": {
342354
"properties": {
@@ -483,6 +495,119 @@
483495
}
484496
}
485497
}
498+
},
499+
{
500+
"if": {
501+
"properties": {
502+
"binding": {
503+
"properties": {
504+
"type": {
505+
"const": "zeebe:script"
506+
},
507+
"property": {
508+
"const": "resultVariable"
509+
}
510+
},
511+
"required": [
512+
"type",
513+
"property"
514+
]
515+
}
516+
},
517+
"required": [
518+
"binding"
519+
]
520+
},
521+
"then": {
522+
"not": {
523+
"required": [
524+
"feel"
525+
]
526+
}
527+
}
528+
},
529+
{
530+
"if": {
531+
"properties": {
532+
"type": {
533+
"enum": [
534+
"String",
535+
"Text"
536+
]
537+
},
538+
"binding": {
539+
"properties": {
540+
"type": {
541+
"const": "zeebe:script"
542+
},
543+
"property": {
544+
"const": "expression"
545+
}
546+
},
547+
"required": [
548+
"type",
549+
"property"
550+
]
551+
}
552+
},
553+
"required": [
554+
"type",
555+
"binding"
556+
]
557+
},
558+
"then": {
559+
"properties": {
560+
"feel": {
561+
"enum": [
562+
"required"
563+
]
564+
}
565+
},
566+
"required": [
567+
"feel"
568+
]
569+
}
570+
},
571+
{
572+
"if": {
573+
"properties": {
574+
"binding": {
575+
"properties": {
576+
"type": {
577+
"const": "zeebe:script"
578+
},
579+
"property": {
580+
"enum": [
581+
"resultVariable",
582+
"expression"
583+
]
584+
}
585+
},
586+
"required": [
587+
"type",
588+
"property"
589+
]
590+
}
591+
},
592+
"required": [
593+
"binding"
594+
]
595+
},
596+
"then": {
597+
"required": [
598+
"type"
599+
],
600+
"properties": {
601+
"type": {
602+
"enum": [
603+
"Hidden",
604+
"String",
605+
"Text",
606+
"Dropdown"
607+
]
608+
}
609+
}
610+
}
486611
}
487612
],
488613
"properties": {
@@ -613,6 +738,31 @@
613738
]
614739
}
615740
},
741+
{
742+
"if": {
743+
"properties": {
744+
"type": {
745+
"const": "zeebe:script"
746+
}
747+
},
748+
"required": [
749+
"type"
750+
]
751+
},
752+
"then": {
753+
"properties": {
754+
"property": {
755+
"enum": [
756+
"expression",
757+
"resultVariable"
758+
]
759+
}
760+
},
761+
"required": [
762+
"property"
763+
]
764+
}
765+
},
616766
{
617767
"if": {
618768
"properties": {
@@ -686,7 +836,8 @@
686836
"zeebe:linkedResource",
687837
"zeebe:userTask",
688838
"zeebe:formDefinition",
689-
"zeebe:calledDecision"
839+
"zeebe:calledDecision",
840+
"zeebe:script"
690841
]
691842
},
692843
"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
@@ -461,6 +461,149 @@
461461
"properties"
462462
]
463463
}
464+
},
465+
{
466+
"if": {
467+
"properties": {
468+
"properties": {
469+
"contains": {
470+
"properties": {
471+
"binding": {
472+
"properties": {
473+
"type": {
474+
"const": "zeebe:script"
475+
}
476+
},
477+
"required": [
478+
"type"
479+
]
480+
}
481+
},
482+
"required": [
483+
"binding"
484+
]
485+
}
486+
}
487+
},
488+
"required": [
489+
"properties"
490+
]
491+
},
492+
"then": {
493+
"anyOf": [
494+
{
495+
"required": [
496+
"elementType"
497+
],
498+
"properties": {
499+
"elementType": {
500+
"required": [
501+
"value"
502+
],
503+
"properties": {
504+
"value": {
505+
"const": "bpmn:ScriptTask"
506+
}
507+
}
508+
}
509+
}
510+
},
511+
{
512+
"required": [
513+
"appliesTo"
514+
],
515+
"properties": {
516+
"appliesTo": {
517+
"const": [
518+
"bpmn:ScriptTask"
519+
]
520+
}
521+
}
522+
}
523+
],
524+
"allOf": [
525+
{
526+
"properties": {
527+
"properties": {
528+
"contains": {
529+
"properties": {
530+
"binding": {
531+
"properties": {
532+
"property": {
533+
"const": "expression"
534+
}
535+
},
536+
"required": [
537+
"property"
538+
]
539+
}
540+
},
541+
"required": [
542+
"binding"
543+
]
544+
}
545+
}
546+
}
547+
},
548+
{
549+
"properties": {
550+
"properties": {
551+
"contains": {
552+
"properties": {
553+
"binding": {
554+
"properties": {
555+
"property": {
556+
"const": "resultVariable"
557+
}
558+
},
559+
"required": [
560+
"property"
561+
]
562+
}
563+
},
564+
"required": [
565+
"binding"
566+
]
567+
}
568+
}
569+
}
570+
},
571+
{
572+
"not": {
573+
"properties": {
574+
"properties": {
575+
"contains": {
576+
"properties": {
577+
"binding": {
578+
"properties": {
579+
"type": {
580+
"enum": [
581+
"zeebe:taskDefinition",
582+
"zeebe:taskDefinition:type"
583+
]
584+
}
585+
},
586+
"required": [
587+
"type"
588+
]
589+
}
590+
},
591+
"required": [
592+
"binding"
593+
]
594+
}
595+
}
596+
},
597+
"required": [
598+
"properties"
599+
]
600+
}
601+
}
602+
],
603+
"required": [
604+
"properties"
605+
]
606+
}
464607
}
465608
]
466609
}

0 commit comments

Comments
 (0)