-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: support
zeebe:calledElement
templating
Related to camunda/camunda-modeler#3006
- Loading branch information
Showing
11 changed files
with
635 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 47 additions & 0 deletions
47
packages/zeebe-element-templates-json-schema/test/fixtures/called-element-applies-to-only.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
export const template = { | ||
'$schema': 'https://unpkg.com/@camunda/zeebe-element-templates-json-schema/resources/schema.json', | ||
'id': 'io.camunda.examples.Payment', | ||
'name': 'Payment', | ||
'description': 'Payment process call activity', | ||
'appliesTo': [ | ||
'bpmn:CallActivity' | ||
], | ||
'properties':[ | ||
{ | ||
'type': 'Hidden', | ||
'value': 'paymentProcess', | ||
'binding': { | ||
'type': 'zeebe:calledElement', | ||
'property': 'processId' | ||
} | ||
}, | ||
{ | ||
'label': 'Payment ID', | ||
'type': 'String', | ||
'binding': { | ||
'type': 'zeebe:input', | ||
'name': 'paymentID' | ||
} | ||
}, | ||
{ | ||
'label': 'Amount', | ||
'type': 'String', | ||
'binding': { | ||
'type': 'zeebe:input', | ||
'name': 'amount' | ||
} | ||
}, | ||
{ | ||
'label': 'Outcome', | ||
'type': 'String', | ||
'description': 'Name of variable to store the result data in.', | ||
'value': 'paymentOutcome', | ||
'binding': { | ||
'type': 'zeebe:output', | ||
'source': '=outcome' | ||
} | ||
} | ||
] | ||
}; | ||
|
||
export const errors = null; |
90 changes: 90 additions & 0 deletions
90
...-templates-json-schema/test/fixtures/called-element-invalid-applies-to-no-element-type.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
export const template = { | ||
'$schema': 'https://unpkg.com/@camunda/zeebe-element-templates-json-schema/resources/schema.json', | ||
'id': 'io.camunda.examples.Payment', | ||
'name': 'Payment', | ||
'description': 'Payment process call activity', | ||
'appliesTo': [ | ||
'bpmn:Task' | ||
], | ||
'properties':[ | ||
{ | ||
'type': 'Hidden', | ||
'value': 'paymentProcess', | ||
'binding': { | ||
'type': 'zeebe:calledElement', | ||
'property': 'processId' | ||
} | ||
}, | ||
{ | ||
'label': 'Payment ID', | ||
'type': 'String', | ||
'binding': { | ||
'type': 'zeebe:input', | ||
'name': 'paymentID' | ||
} | ||
}, | ||
{ | ||
'label': 'Amount', | ||
'type': 'String', | ||
'binding': { | ||
'type': 'zeebe:input', | ||
'name': 'amount' | ||
} | ||
}, | ||
{ | ||
'label': 'Outcome', | ||
'type': 'String', | ||
'description': 'Name of variable to store the result data in.', | ||
'value': 'paymentOutcome', | ||
'binding': { | ||
'type': 'zeebe:output', | ||
'source': '=outcome' | ||
} | ||
} | ||
] | ||
}; | ||
|
||
export const errors = [ | ||
{ | ||
keyword: 'required', | ||
dataPath: '', | ||
schemaPath: '#/allOf/1/allOf/2/then/anyOf/0/required', | ||
params: { missingProperty: 'elementType' }, | ||
message: "should have required property 'elementType'" | ||
}, | ||
{ | ||
keyword: 'const', | ||
dataPath: '/appliesTo', | ||
schemaPath: '#/allOf/1/allOf/2/then/anyOf/1/properties/appliesTo/const', | ||
params: { allowedValue: [ 'bpmn:CallActivity' ] }, | ||
message: 'should be equal to constant' | ||
}, | ||
{ | ||
keyword: 'anyOf', | ||
dataPath: '', | ||
schemaPath: '#/allOf/1/allOf/2/then/anyOf', | ||
params: {}, | ||
message: 'should match some schema in anyOf' | ||
}, | ||
{ | ||
keyword: 'if', | ||
dataPath: '', | ||
schemaPath: '#/allOf/1/allOf/2/if', | ||
params: { failingKeyword: 'then' }, | ||
message: 'should match "then" schema' | ||
}, | ||
{ | ||
keyword: 'type', | ||
dataPath: '', | ||
schemaPath: '#/oneOf/1/type', | ||
params: { type: 'array' }, | ||
message: 'should be array' | ||
}, | ||
{ | ||
keyword: 'oneOf', | ||
dataPath: '', | ||
schemaPath: '#/oneOf', | ||
params: { passingSchemas: null }, | ||
message: 'should match exactly one schema in oneOf' | ||
} | ||
]; |
93 changes: 93 additions & 0 deletions
93
.../zeebe-element-templates-json-schema/test/fixtures/called-element-invalid-element-type.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
export const template = { | ||
'$schema': 'https://unpkg.com/@camunda/zeebe-element-templates-json-schema/resources/schema.json', | ||
'id': 'io.camunda.examples.Payment', | ||
'name': 'Payment', | ||
'description': 'Payment process call activity', | ||
'appliesTo': [ | ||
'bpmn:Task' | ||
], | ||
'elementType': { | ||
'value': 'bpmn:Task' | ||
}, | ||
'properties':[ | ||
{ | ||
'type': 'Hidden', | ||
'value': 'paymentProcess', | ||
'binding': { | ||
'type': 'zeebe:calledElement', | ||
'property': 'processId' | ||
} | ||
}, | ||
{ | ||
'label': 'Payment ID', | ||
'type': 'String', | ||
'binding': { | ||
'type': 'zeebe:input', | ||
'name': 'paymentID' | ||
} | ||
}, | ||
{ | ||
'label': 'Amount', | ||
'type': 'String', | ||
'binding': { | ||
'type': 'zeebe:input', | ||
'name': 'amount' | ||
} | ||
}, | ||
{ | ||
'label': 'Outcome', | ||
'type': 'String', | ||
'description': 'Name of variable to store the result data in.', | ||
'value': 'paymentOutcome', | ||
'binding': { | ||
'type': 'zeebe:output', | ||
'source': '=outcome' | ||
} | ||
} | ||
] | ||
}; | ||
|
||
export const errors = [ | ||
{ | ||
keyword: 'const', | ||
dataPath: '/elementType/value', | ||
schemaPath: '#/allOf/1/allOf/2/then/anyOf/0/properties/elementType/properties/value/const', | ||
params: { allowedValue: 'bpmn:CallActivity' }, | ||
message: 'should be equal to constant' | ||
}, | ||
{ | ||
keyword: 'const', | ||
dataPath: '/appliesTo', | ||
schemaPath: '#/allOf/1/allOf/2/then/anyOf/1/properties/appliesTo/const', | ||
params: { allowedValue: [ 'bpmn:CallActivity' ] }, | ||
message: 'should be equal to constant' | ||
}, | ||
{ | ||
keyword: 'anyOf', | ||
dataPath: '', | ||
schemaPath: '#/allOf/1/allOf/2/then/anyOf', | ||
params: {}, | ||
message: 'should match some schema in anyOf' | ||
}, | ||
{ | ||
keyword: 'if', | ||
dataPath: '', | ||
schemaPath: '#/allOf/1/allOf/2/if', | ||
params: { failingKeyword: 'then' }, | ||
message: 'should match "then" schema' | ||
}, | ||
{ | ||
keyword: 'type', | ||
dataPath: '', | ||
schemaPath: '#/oneOf/1/type', | ||
params: { type: 'array' }, | ||
message: 'should be array' | ||
}, | ||
{ | ||
keyword: 'oneOf', | ||
dataPath: '', | ||
schemaPath: '#/oneOf', | ||
params: { passingSchemas: null }, | ||
message: 'should match exactly one schema in oneOf' | ||
} | ||
]; |
Oops, something went wrong.