Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disallow subscription binding for bpmn:SendTask #122

Merged
merged 1 commit into from
Nov 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions packages/zeebe-element-templates-json-schema/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ All notable changes to [@camunda/zeebe-element-templates-json-schema](https://gi

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

## 0.16.1

* `FIX`: disallow `bpmn:Message#zeebe:subscription#property` binding for `bpmn:SendTask`

## 0.16.0

* `FEAT`: support `isActive` condition ([#120](https://github.com/camunda/element-templates-json-schema/pull/120))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,87 @@
"binding": {
"properties": {
"type": {
"const": "bpmn:Message#property"
}
},
"required": [
"type"
]
}
},
"required": [
"binding"
]
}
}
},
"required": [
"properties"
]
},
"then": {
"required": [
"elementType"
],
"properties": {
"elementType": {
"required": [
"value"
],
"properties": {
"value": {
"enum": [
"bpmn:ReceiveTask",
"bpmn:SendTask",
"bpmn:StartEvent",
"bpmn:IntermediateCatchEvent",
"bpmn:IntermediateThrowEvent",
"bpmn:BoundaryEvent",
"bpmn:EndEvent"
]
}
},
"allOf": [
{
"if": {
"properties": {
"value": {
"enum": [
"bpmn:Message#property",
"bpmn:Message#zeebe:subscription#property"
"bpmn:StartEvent",
"bpmn:IntermediateCatchEvent",
"bpmn:IntermediateThrowEvent",
"bpmn:BoundaryEvent",
"bpmn:EndEvent"

]
}
}
},
"then": {
"eventDefinition": {
"const": "bpmn:MessageEventDefinition"
},
"required": [
"eventDefinition"
]
}
}
]
}
}
}
},
{
"if": {
"properties": {
"properties": {
"contains": {
"properties": {
"binding": {
"properties": {
"type": {
"const": "bpmn:Message#zeebe:subscription#property"
}
},
"required": [
"type"
Expand Down Expand Up @@ -43,7 +119,6 @@
"value": {
"enum": [
"bpmn:ReceiveTask",
"bpmn:SendTask",
"bpmn:StartEvent",
"bpmn:IntermediateCatchEvent",
"bpmn:IntermediateThrowEvent",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
export const template = {
'name': 'InvalidElementType',
'id': 'com.camunda.example.InvalidElementType',
'appliesTo': [
'bpmn:Task'
],
'elementType': {
value: 'bpmn:SendTask'
},
'properties': [
{
'label': 'foo',
'type': 'String',
'binding': {
'type': 'bpmn:Message#zeebe:subscription#property',
'name': 'correlationKey'
}
}
]
};

export const errors = [
{
dataPath: '/elementType/value',
keyword: 'enum',
schemaPath: '#/allOf/1/allOf/1/then/properties/elementType/properties/value/enum',
params: {
'allowedValues': [
'bpmn:ReceiveTask',
'bpmn:StartEvent',
'bpmn:IntermediateCatchEvent',
'bpmn:IntermediateThrowEvent',
'bpmn:BoundaryEvent',
'bpmn:EndEvent'
]
},
message: 'should be equal to one of the allowed values'
},
{
keyword: 'if',
dataPath: '',
schemaPath: '#/allOf/1/allOf/1/if',
params: {
'failingKeyword': 'then'
},
message: 'should match "then" schema'
},
{
dataPath: '',
keyword: 'type',
message: 'should be array',
params: {
type: 'array',
},
schemaPath: '#/oneOf/1/type',
},
{
dataPath: '',
keyword: 'oneOf',
message: 'should match exactly one schema in oneOf',
params: {
passingSchemas: null
},
schemaPath: '#/oneOf'
}
];
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export const errors = [
{
keyword: 'required',
dataPath: '/elementType',
schemaPath: '#/allOf/1/allOf/0/then/properties/elementType/allOf/0/then/required',
schemaPath: '#/allOf/1/allOf/1/then/properties/elementType/allOf/0/then/required',
params: {
missingProperty: 'eventDefinition'
},
Expand All @@ -36,12 +36,12 @@ export const errors = [
'params': {
'failingKeyword': 'then'
},
'schemaPath': '#/allOf/1/allOf/0/then/properties/elementType/allOf/0/if'
'schemaPath': '#/allOf/1/allOf/1/then/properties/elementType/allOf/0/if'
},
{
keyword: 'if',
dataPath: '',
schemaPath: '#/allOf/1/allOf/0/if',
schemaPath: '#/allOf/1/allOf/1/if',
params: {
'failingKeyword': 'then'
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,9 @@ describe('validation', function() {


testTemplate('message-subscription-property-invalid-event-definition');


testTemplate('message-subscription-property-invalid-element-type');
});


Expand Down