Skip to content

Commit 160508f

Browse files
yT0n1philippfromme
authored andcommitted
feat: improve error messages for missing properties and job type
- factor out template level rules into own template.
1 parent 1698a51 commit 160508f

File tree

11 files changed

+528
-503
lines changed

11 files changed

+528
-503
lines changed

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

Lines changed: 1 addition & 251 deletions
Original file line numberDiff line numberDiff line change
@@ -695,257 +695,7 @@
695695
}
696696
},
697697
{
698-
"if": {
699-
"properties": {
700-
"properties": {
701-
"contains": {
702-
"properties": {
703-
"binding": {
704-
"properties": {
705-
"type": {
706-
"const": "zeebe:adHoc"
707-
}
708-
},
709-
"required": [
710-
"type"
711-
]
712-
}
713-
},
714-
"required": [
715-
"binding"
716-
]
717-
}
718-
}
719-
},
720-
"required": [
721-
"properties"
722-
]
723-
},
724-
"then": {
725-
"anyOf": [
726-
{
727-
"required": [
728-
"elementType"
729-
],
730-
"properties": {
731-
"elementType": {
732-
"required": [
733-
"value"
734-
],
735-
"properties": {
736-
"value": {
737-
"const": "bpmn:AdHocSubProcess"
738-
}
739-
}
740-
}
741-
}
742-
},
743-
{
744-
"required": [
745-
"appliesTo"
746-
],
747-
"properties": {
748-
"appliesTo": {
749-
"const": [
750-
"bpmn:AdHocSubProcess"
751-
]
752-
}
753-
}
754-
}
755-
]
756-
}
757-
},
758-
{
759-
"if": {
760-
"properties": {
761-
"properties": {
762-
"contains": {
763-
"properties": {
764-
"binding": {
765-
"properties": {
766-
"type": {
767-
"const": "zeebe:adHoc"
768-
},
769-
"property": {
770-
"const": "outputCollection"
771-
}
772-
},
773-
"required": [
774-
"type",
775-
"property"
776-
]
777-
}
778-
},
779-
"required": [
780-
"binding"
781-
]
782-
}
783-
}
784-
},
785-
"required": [
786-
"properties"
787-
]
788-
},
789-
"then": {
790-
"$comment": "If adHoc outputCollection present, require outputElement (pairing).",
791-
"properties": {
792-
"properties": {
793-
"contains": {
794-
"properties": {
795-
"binding": {
796-
"properties": {
797-
"type": {
798-
"const": "zeebe:adHoc"
799-
},
800-
"property": {
801-
"const": "outputElement"
802-
}
803-
},
804-
"required": [
805-
"type",
806-
"property"
807-
]
808-
}
809-
},
810-
"required": [
811-
"binding"
812-
]
813-
}
814-
}
815-
},
816-
"required": [
817-
"properties"
818-
]
819-
}
820-
},
821-
{
822-
"if": {
823-
"properties": {
824-
"properties": {
825-
"contains": {
826-
"properties": {
827-
"binding": {
828-
"properties": {
829-
"type": {
830-
"const": "zeebe:adHoc"
831-
},
832-
"property": {
833-
"const": "outputElement"
834-
}
835-
},
836-
"required": [
837-
"type",
838-
"property"
839-
]
840-
}
841-
},
842-
"required": [
843-
"binding"
844-
]
845-
}
846-
}
847-
},
848-
"required": [
849-
"properties"
850-
]
851-
},
852-
"then": {
853-
"$comment": "If adHoc outputElement present, require outputCollection (pairing).",
854-
"properties": {
855-
"properties": {
856-
"contains": {
857-
"properties": {
858-
"binding": {
859-
"properties": {
860-
"type": {
861-
"const": "zeebe:adHoc"
862-
},
863-
"property": {
864-
"const": "outputCollection"
865-
}
866-
},
867-
"required": [
868-
"type",
869-
"property"
870-
]
871-
}
872-
},
873-
"required": [
874-
"binding"
875-
]
876-
}
877-
}
878-
},
879-
"required": [
880-
"properties"
881-
]
882-
}
883-
},
884-
{
885-
"if": {
886-
"properties": {
887-
"properties": {
888-
"contains": {
889-
"properties": {
890-
"binding": {
891-
"properties": {
892-
"type": {
893-
"const": "zeebe:adHoc"
894-
},
895-
"property": {
896-
"enum": [
897-
"outputCollection",
898-
"outputElement"
899-
]
900-
}
901-
},
902-
"required": [
903-
"type",
904-
"property"
905-
]
906-
}
907-
},
908-
"required": [
909-
"binding"
910-
]
911-
}
912-
}
913-
},
914-
"required": [
915-
"properties"
916-
]
917-
},
918-
"then": {
919-
"$comment": "If any adHoc output present, require taskDefinition type property.",
920-
"properties": {
921-
"properties": {
922-
"contains": {
923-
"properties": {
924-
"binding": {
925-
"properties": {
926-
"type": {
927-
"const": "zeebe:taskDefinition"
928-
},
929-
"property": {
930-
"const": "type"
931-
}
932-
},
933-
"required": [
934-
"type",
935-
"property"
936-
]
937-
}
938-
},
939-
"required": [
940-
"binding"
941-
]
942-
}
943-
}
944-
},
945-
"required": [
946-
"properties"
947-
]
948-
}
698+
"$ref": "./template/adHoc.json"
949699
}
950700
]
951701
}

0 commit comments

Comments
 (0)