UNPKG

38.5 kBJSONView Raw
1{
2 "$schema": "http://json-schema.org/draft-07/schema",
3 "$id": "http://camunda.org/schema/element-templates/1.0",
4 "title": "Element Template Schema",
5 "definitions": {
6 "properties": {
7 "allOf": [
8 {
9 "type": "array",
10 "description": "List of properties of the element template.",
11 "allOf": [
12 {
13 "examples": [
14 [
15 {
16 "label": "Name",
17 "type": "String",
18 "binding": {
19 "type": "property",
20 "name": "name"
21 }
22 }
23 ]
24 ]
25 }
26 ],
27 "items": {
28 "type": "object",
29 "default": {},
30 "allOf": [
31 {
32 "if": {
33 "properties": {
34 "type": {
35 "const": "Dropdown"
36 }
37 },
38 "required": [
39 "type"
40 ]
41 },
42 "then": {
43 "required": [
44 "choices"
45 ]
46 }
47 },
48 {
49 "definitions": {
50 "condition": {
51 "type": "object",
52 "required": [
53 "property"
54 ],
55 "properties": {
56 "type": {
57 "$id": "#/condition/type",
58 "const": "simple",
59 "description": "The type of the condition.",
60 "default": "simple"
61 },
62 "property": {
63 "$id": "#/condition/property",
64 "type": "string",
65 "description": "The id of the property to check."
66 }
67 },
68 "oneOf": [
69 {
70 "properties": {
71 "equals": {
72 "type": [
73 "string",
74 "number",
75 "boolean"
76 ]
77 }
78 },
79 "required": [
80 "equals"
81 ]
82 },
83 {
84 "properties": {
85 "oneOf": {
86 "type": "array",
87 "items": {
88 "type": [
89 "string",
90 "number"
91 ]
92 }
93 }
94 },
95 "required": [
96 "oneOf"
97 ]
98 },
99 {
100 "properties": {
101 "isActive": {
102 "type": "boolean",
103 "description": "For `true`, activates the property when given property is active"
104 }
105 },
106 "required": [
107 "isActive"
108 ]
109 }
110 ]
111 },
112 "conditionDependingOnId": {
113 "required": [
114 "property"
115 ],
116 "properties": {
117 "property": {
118 "const": {
119 "$data": "2/id"
120 }
121 }
122 }
123 }
124 },
125 "allOf": [
126 {
127 "$comment": "property#condition should not depend on property#id",
128 "if": {
129 "required": [
130 "id",
131 "condition"
132 ],
133 "properties": {
134 "condition": {
135 "$ref": "#/definitions/properties/allOf/0/items/allOf/1/definitions/conditionDependingOnId"
136 }
137 }
138 },
139 "then": {
140 "not": {
141 "required": [
142 "condition"
143 ]
144 }
145 }
146 }
147 ],
148 "properties": {
149 "id": {
150 "type": "string",
151 "description": "Unique identifier of the property."
152 },
153 "condition": {
154 "type": "object",
155 "description": "Condition(s) to activate the binding.",
156 "allOf": [
157 {
158 "examples": [
159 {
160 "type": "simple",
161 "property": "httpMethod",
162 "equals": "GET"
163 },
164 {
165 "type": "simple",
166 "property": "httpMethod",
167 "oneOf": [
168 "POST",
169 "PUT",
170 "DELETE"
171 ]
172 },
173 {
174 "allMatch": [
175 {
176 "type": "simple",
177 "property": "authType",
178 "equals": "Basic"
179 },
180 {
181 "type": "simple",
182 "property": "httpMethod",
183 "oneOf": [
184 "POST",
185 "PUT",
186 "DELETE"
187 ]
188 }
189 ]
190 }
191 ]
192 }
193 ],
194 "oneOf": [
195 {
196 "$ref": "#/definitions/properties/allOf/0/items/allOf/1/definitions/condition"
197 },
198 {
199 "properties": {
200 "allMatch": {
201 "$id": "#/allMatch",
202 "type": "array",
203 "items": {
204 "$ref": "#/definitions/properties/allOf/0/items/allOf/1/definitions/condition"
205 },
206 "minItems": 1
207 }
208 },
209 "required": [
210 "allMatch"
211 ]
212 }
213 ]
214 }
215 }
216 },
217 {
218 "if": {
219 "properties": {
220 "type": {
221 "not": {
222 "const": "Number"
223 }
224 }
225 },
226 "required": [
227 "type"
228 ]
229 },
230 "then": {
231 "properties": {
232 "value": {
233 "type": [
234 "string",
235 "boolean"
236 ]
237 }
238 }
239 }
240 }
241 ],
242 "properties": {
243 "value": {
244 "$id": "#/properties/property/value",
245 "type": [
246 "string",
247 "number",
248 "boolean"
249 ],
250 "description": "The value of a control field."
251 },
252 "description": {
253 "$id": "#/properties/property/description",
254 "type": "string",
255 "description": "The description of a control field."
256 },
257 "label": {
258 "$id": "#/properties/property/label",
259 "type": "string",
260 "description": "The label of a control field."
261 },
262 "type": {
263 "$id": "#/properties/property/type",
264 "type": "string",
265 "description": "The type of a control field."
266 },
267 "editable": {
268 "$id": "#/properties/property/editable",
269 "type": "boolean",
270 "description": "Indicates whether a control field is editable or not."
271 },
272 "choices": {
273 "$id": "#/properties/property/choices",
274 "type": "array",
275 "description": "The choices for dropdown fields.",
276 "default": [],
277 "items": {
278 "$id": "#/properties/property/choices/item",
279 "type": "object",
280 "default": {},
281 "properties": {
282 "name": {
283 "$id": "#/properties/property/choices/item/name",
284 "type": "string",
285 "description": "The name of a choice."
286 },
287 "value": {
288 "$id": "#/properties/property/choices/item/value",
289 "type": "string",
290 "description": "The value of a choice."
291 },
292 "condition": {
293 "$ref": "#/definitions/properties/allOf/0/items/allOf/1/properties/condition"
294 }
295 },
296 "required": [
297 "value",
298 "name"
299 ]
300 }
301 },
302 "constraints": {
303 "$id": "#/properties/property/constraints",
304 "type": "object",
305 "description": "The validation constraints of a control field.",
306 "allOf": [
307 {
308 "examples": [
309 {
310 "notEmpty": true
311 }
312 ]
313 }
314 ],
315 "properties": {
316 "notEmpty": {
317 "$id": "#/properties/property/constraints/notEmpty",
318 "type": "boolean",
319 "description": "The control field must not be empty."
320 },
321 "minLength": {
322 "$id": "#/properties/property/constraints/minLength",
323 "type": "number",
324 "description": "The minimal length of a control field value."
325 },
326 "maxLength": {
327 "$id": "#/properties/property/constraints/maxLength",
328 "type": "number",
329 "description": "The maximal length for a control field value."
330 },
331 "pattern": {
332 "$id": "#/properties/property/constraints/pattern",
333 "description": "A regular expression pattern for a constraint.",
334 "oneOf": [
335 {
336 "type": "object",
337 "default": {},
338 "properties": {
339 "value": {
340 "$id": "#/properties/property/constraints/pattern/value",
341 "type": "string",
342 "description": "The regular expression of a pattern."
343 },
344 "message": {
345 "$id": "#/properties/property/constraints/pattern/message",
346 "type": "string",
347 "description": "The validation message of a pattern."
348 }
349 }
350 },
351 {
352 "type": "string"
353 }
354 ]
355 }
356 }
357 },
358 "group": {
359 "$id": "#/properties/property/group",
360 "type": "string",
361 "description": "The custom group of a control field."
362 }
363 }
364 }
365 },
366 {
367 "$schema": "http://json-schema.org/draft-07/schema",
368 "type": "array",
369 "description": "List of properties of the element template.",
370 "items": {
371 "type": "object",
372 "default": {},
373 "required": [
374 "binding"
375 ],
376 "allOf": [
377 {
378 "if": {
379 "properties": {
380 "binding": {
381 "properties": {
382 "type": {
383 "const": "property"
384 }
385 },
386 "required": [
387 "type"
388 ]
389 }
390 },
391 "required": [
392 "binding"
393 ]
394 },
395 "then": {
396 "properties": {
397 "type": {
398 "enum": [
399 "String",
400 "Text",
401 "Hidden",
402 "Dropdown",
403 "Boolean"
404 ]
405 }
406 }
407 }
408 },
409 {
410 "if": {
411 "properties": {
412 "binding": {
413 "properties": {
414 "type": {
415 "const": "camunda:executionListener"
416 }
417 },
418 "required": [
419 "type"
420 ]
421 }
422 },
423 "required": [
424 "binding"
425 ]
426 },
427 "then": {
428 "properties": {
429 "type": {
430 "enum": [
431 "Hidden"
432 ]
433 },
434 "binding": {
435 "properties": {
436 "implementationType": {
437 "enum": [
438 "class",
439 "delegateExpression",
440 "expression",
441 "script"
442 ]
443 }
444 },
445 "oneOf": [
446 {
447 "not": {
448 "properties": {
449 "implementationType": {
450 "const": "script"
451 }
452 }
453 }
454 },
455 {
456 "required": [
457 "scriptFormat"
458 ]
459 },
460 {
461 "allOf": [
462 {
463 "not": {
464 "required": [
465 "implementationType"
466 ]
467 }
468 },
469 {
470 "not": {
471 "required": [
472 "scriptFormat"
473 ]
474 }
475 }
476 ]
477 }
478 ]
479 }
480 }
481 }
482 },
483 {
484 "if": {
485 "properties": {
486 "binding": {
487 "properties": {
488 "type": {
489 "enum": [
490 "camunda:property",
491 "camunda:outputParameter",
492 "camunda:in",
493 "camunda:in:businessKey",
494 "camunda:out",
495 "camunda:errorEventDefinition"
496 ]
497 }
498 },
499 "required": [
500 "type"
501 ]
502 }
503 },
504 "required": [
505 "binding"
506 ]
507 },
508 "then": {
509 "properties": {
510 "type": {
511 "enum": [
512 "String",
513 "Hidden",
514 "Dropdown"
515 ]
516 }
517 }
518 }
519 },
520 {
521 "if": {
522 "properties": {
523 "binding": {
524 "properties": {
525 "type": {
526 "enum": [
527 "camunda:inputParameter",
528 "camunda:field"
529 ]
530 }
531 },
532 "required": [
533 "type"
534 ]
535 }
536 },
537 "required": [
538 "binding"
539 ]
540 },
541 "then": {
542 "properties": {
543 "type": {
544 "enum": [
545 "String",
546 "Text",
547 "Hidden",
548 "Dropdown"
549 ]
550 }
551 }
552 }
553 }
554 ],
555 "properties": {
556 "binding": {
557 "$id": "#/properties/property/binding",
558 "type": "object",
559 "description": "Specifying how the property is mapped to BPMN or Camunda extension elements and attributes.",
560 "required": [
561 "type"
562 ],
563 "allOf": [
564 {
565 "if": {
566 "properties": {
567 "type": {
568 "enum": [
569 "property",
570 "camunda:property",
571 "camunda:inputParameter",
572 "camunda:field"
573 ]
574 }
575 },
576 "required": [
577 "type"
578 ]
579 },
580 "then": {
581 "required": [
582 "name"
583 ]
584 }
585 },
586 {
587 "if": {
588 "properties": {
589 "type": {
590 "const": "camunda:outputParameter"
591 }
592 },
593 "required": [
594 "type"
595 ]
596 },
597 "then": {
598 "required": [
599 "source"
600 ]
601 }
602 },
603 {
604 "if": {
605 "properties": {
606 "type": {
607 "const": "camunda:in"
608 }
609 },
610 "required": [
611 "type"
612 ]
613 },
614 "then": {
615 "anyOf": [
616 {
617 "required": [
618 "variables"
619 ]
620 },
621 {
622 "required": [
623 "target"
624 ]
625 }
626 ]
627 }
628 },
629 {
630 "if": {
631 "properties": {
632 "type": {
633 "const": "camunda:out"
634 }
635 },
636 "required": [
637 "type"
638 ]
639 },
640 "then": {
641 "oneOf": [
642 {
643 "required": [
644 "variables"
645 ],
646 "not": {
647 "anyOf": [
648 {
649 "required": [
650 "source"
651 ]
652 },
653 {
654 "required": [
655 "sourceExpression"
656 ]
657 }
658 ]
659 }
660 },
661 {
662 "required": [
663 "source"
664 ],
665 "not": {
666 "anyOf": [
667 {
668 "required": [
669 "variables"
670 ]
671 },
672 {
673 "required": [
674 "sourceExpression"
675 ]
676 }
677 ]
678 }
679 },
680 {
681 "required": [
682 "sourceExpression"
683 ],
684 "not": {
685 "anyOf": [
686 {
687 "required": [
688 "variables"
689 ]
690 },
691 {
692 "required": [
693 "source"
694 ]
695 }
696 ]
697 }
698 },
699 {
700 "required": [
701 "variables",
702 "sourceExpression"
703 ],
704 "not": {
705 "required": [
706 "source"
707 ]
708 }
709 },
710 {
711 "required": [
712 "variables",
713 "source"
714 ],
715 "not": {
716 "required": [
717 "sourceExpression"
718 ]
719 }
720 }
721 ]
722 }
723 },
724 {
725 "if": {
726 "properties": {
727 "type": {
728 "const": "camunda:errorEventDefinition"
729 }
730 },
731 "required": [
732 "type"
733 ]
734 },
735 "then": {
736 "oneOf": [
737 {
738 "required": [
739 "errorRef"
740 ]
741 }
742 ]
743 }
744 },
745 {
746 "examples": [
747 {
748 "type": "property",
749 "name": "name"
750 },
751 {
752 "type": "camunda:property",
753 "name": "property"
754 },
755 {
756 "type": "camunda:inputParameter",
757 "name": "input"
758 },
759 {
760 "type": "camunda:outputParameter",
761 "source": "output"
762 },
763 {
764 "type": "camunda:in",
765 "target": "target"
766 },
767 {
768 "type": "camunda:in:businessKey"
769 },
770 {
771 "type": "camunda:out",
772 "source": "output"
773 },
774 {
775 "type": "camunda:executionListener",
776 "event": "start"
777 },
778 {
779 "type": "camunda:field",
780 "name": "field"
781 },
782 {
783 "type": "camunda:errorEventDefinition",
784 "errorRef": "error"
785 },
786 {
787 "type": "camunda:errorEventDefinition",
788 "errorRef": "error"
789 }
790 ]
791 }
792 ],
793 "properties": {
794 "type": {
795 "$id": "#/properties/property/binding/type",
796 "type": "string",
797 "enum": [
798 "property",
799 "camunda:property",
800 "camunda:inputParameter",
801 "camunda:outputParameter",
802 "camunda:in",
803 "camunda:out",
804 "camunda:in:businessKey",
805 "camunda:executionListener",
806 "camunda:field",
807 "camunda:errorEventDefinition"
808 ],
809 "description": "The type of a property binding."
810 },
811 "name": {
812 "$id": "#/properties/property/binding/name",
813 "type": "string",
814 "description": "The name of a property binding."
815 },
816 "event": {
817 "$id": "#/properties/property/binding/event",
818 "type": "string",
819 "description": "The event type of a property binding (camunda:executionListener)."
820 },
821 "scriptFormat": {
822 "$id": "#/properties/property/binding/scriptFormat",
823 "type": "string",
824 "description": "The script format of a property binding (camunda:outputParameter, camunda:inputParameter)."
825 },
826 "source": {
827 "$id": "#/properties/property/binding/source",
828 "type": "string",
829 "description": "The source value of a property binding (camunda:outputParameter, camunda:out)."
830 },
831 "target": {
832 "$id": "#/properties/property/binding/target",
833 "type": "string",
834 "description": "The target value of a property binding (camunda:in)."
835 },
836 "expression": {
837 "$id": "#/properties/property/binding/expression",
838 "type": "boolean",
839 "description": "Indicates whether the control field value is an expression (camunda:in, camunda:field)."
840 },
841 "variables": {
842 "$id": "#/properties/property/binding/variables",
843 "type": "string",
844 "enum": [
845 "all",
846 "local"
847 ],
848 "description": "The variable mapping of a property binding (camunda:in)."
849 },
850 "sourceExpression": {
851 "$id": "#/properties/property/binding/sourceExpression",
852 "type": "string",
853 "description": "The string containing the expression for the source attribute (camunda:out)."
854 }
855 }
856 }
857 }
858 }
859 }
860 ]
861 },
862 "template": {
863 "type": "object",
864 "allOf": [
865 {
866 "required": [
867 "name",
868 "id",
869 "appliesTo",
870 "properties"
871 ],
872 "properties": {
873 "name": {
874 "$id": "#/name",
875 "type": "string",
876 "description": "The name of the element template."
877 },
878 "id": {
879 "$id": "#/id",
880 "type": "string",
881 "description": "The identifier of the element template."
882 },
883 "description": {
884 "$id": "#/description",
885 "type": "string",
886 "description": "The description of the element template."
887 },
888 "version": {
889 "$id": "#/version",
890 "type": "integer",
891 "description": "Optional version of the template. If you add a version to a template it will be considered unique based on its ID and version. Two templates can have the same ID if their version is different."
892 },
893 "isDefault": {
894 "$id": "#/isDefault",
895 "type": "boolean",
896 "description": "Indicates whether the element template is a default template."
897 },
898 "deprecated": {
899 "$id": "#/deprecated",
900 "type": [
901 "boolean",
902 "object"
903 ],
904 "description": "Indicates whether the element template is deprecated.",
905 "properties": {
906 "message": {
907 "$id": "#/deprecated/message",
908 "type": "string",
909 "description": "Optional message to describe migration path."
910 },
911 "documentationRef": {
912 "$id": "#/deprecated/documentationRef",
913 "type": "string",
914 "pattern": "^(https|http)://.*",
915 "description": "Optional link to migration documentation."
916 }
917 }
918 },
919 "appliesTo": {
920 "$id": "#/appliesTo",
921 "type": "array",
922 "description": "List of BPMN types the template can be applied to.",
923 "default": [],
924 "items": {
925 "$id": "#/appliesTo/items",
926 "type": "string",
927 "pattern": "^[\\w\\d]+:[\\w\\d]+$",
928 "allOf": [
929 {
930 "examples": [
931 "bpmn:Task",
932 "bpmn:ServiceTask",
933 "bpmn:SequenceFlow",
934 "bpmn:Process",
935 "bpmn:StartEvent",
936 "bpmn:Gateway"
937 ]
938 }
939 ]
940 }
941 },
942 "elementType": {
943 "$id": "#/elementType",
944 "type": "object",
945 "description": "The BPMN type the element will be transformed into.",
946 "default": {},
947 "required": [
948 "value"
949 ],
950 "properties": {
951 "value": {
952 "$id": "#/elementType/value",
953 "type": "string",
954 "pattern": "^[\\w\\d]+:[\\w\\d]+$",
955 "allOf": [
956 {
957 "examples": [
958 "bpmn:ServiceTask",
959 "bpmn:UserTask",
960 "bpmn:StartEvent",
961 "bpmn:ExclusiveGateway",
962 "bpmn:ParallelGateway"
963 ]
964 }
965 ]
966 }
967 }
968 },
969 "metadata": {
970 "$id": "#/metadata",
971 "type": "object",
972 "description": "Some custom properties for further configuration.",
973 "default": {}
974 },
975 "entriesVisible": {
976 "$id": "#/entriesVisible",
977 "type": "boolean",
978 "description": "Select whether non-template entries are visible in the properties panel."
979 },
980 "groups": {
981 "$id": "#/groups",
982 "type": "array",
983 "description": "Custom fields can be ordered together via groups.",
984 "allOf": [
985 {
986 "examples": [
987 [
988 {
989 "id": "group-1",
990 "label": "My Group"
991 }
992 ]
993 ]
994 }
995 ],
996 "items": {
997 "$id": "#/groups/group",
998 "type": "object",
999 "default": {},
1000 "required": [
1001 "id",
1002 "label"
1003 ],
1004 "properties": {
1005 "id": {
1006 "$id": "#/groups/group/id",
1007 "type": "string",
1008 "description": "The id of the custom group"
1009 },
1010 "label": {
1011 "$id": "#/groups/group/label",
1012 "type": "string",
1013 "description": "The label of the custom group"
1014 }
1015 }
1016 }
1017 },
1018 "documentationRef": {
1019 "$id": "#/documentationRef",
1020 "type": "string",
1021 "pattern": "^(https|http)://.*"
1022 }
1023 }
1024 }
1025 ],
1026 "properties": {
1027 "properties": {
1028 "$ref": "#/definitions/properties",
1029 "$id": "#/properties"
1030 },
1031 "scopes": {
1032 "$id": "#/scopes",
1033 "type": "array",
1034 "description": "Special scoped bindings that allow you to configure nested elements.",
1035 "allOf": [
1036 {
1037 "examples": [
1038 [
1039 {
1040 "type": "bpmn:Error",
1041 "id": "Error_1",
1042 "properties": [
1043 {
1044 "value": "error-code",
1045 "binding": {
1046 "type": "property",
1047 "name": "errorCode"
1048 }
1049 },
1050 {
1051 "value": "error-message",
1052 "binding": {
1053 "type": "property",
1054 "name": "camunda:errorMessage"
1055 }
1056 },
1057 {
1058 "value": "error-name",
1059 "binding": {
1060 "type": "property",
1061 "name": "name"
1062 }
1063 }
1064 ]
1065 }
1066 ]
1067 ]
1068 }
1069 ],
1070 "items": {
1071 "$id": "#/scopes/item",
1072 "type": "object",
1073 "default": {},
1074 "properties": {
1075 "type": {
1076 "$id": "#scopes/item/type",
1077 "type": "string",
1078 "description": "The type of a scope.",
1079 "enum": [
1080 "camunda:Connector",
1081 "bpmn:Error"
1082 ]
1083 },
1084 "properties": {
1085 "$id": "#/scopes/properties",
1086 "description": "List of properties of a scope.",
1087 "default": [],
1088 "allOf": [
1089 {
1090 "$ref": "#/definitions/properties/allOf/0"
1091 },
1092 {
1093 "$ref": "#/definitions/properties/allOf/1"
1094 }
1095 ]
1096 }
1097 },
1098 "required": [
1099 "type",
1100 "properties"
1101 ],
1102 "allOf": [
1103 {
1104 "if": {
1105 "properties": {
1106 "type": {
1107 "enum": [
1108 "bpmn:Error"
1109 ]
1110 }
1111 },
1112 "required": [
1113 "type"
1114 ]
1115 },
1116 "then": {
1117 "required": [
1118 "id"
1119 ]
1120 }
1121 }
1122 ]
1123 }
1124 }
1125 }
1126 }
1127 },
1128 "oneOf": [
1129 {
1130 "description": "An element template configuration.",
1131 "$ref": "#/definitions/template"
1132 },
1133 {
1134 "type": "array",
1135 "description": "A list of element template configurations.",
1136 "items": {
1137 "$ref": "#/definitions/template"
1138 }
1139 }
1140 ]
1141}
\No newline at end of file