Skip to content

Commit

Permalink
feat: support receive and send task templating
Browse files Browse the repository at this point in the history
  • Loading branch information
barmac authored Nov 15, 2023
1 parent fbfce32 commit 867928b
Show file tree
Hide file tree
Showing 6 changed files with 153 additions and 55 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,6 @@
},
{
"if": {
"properties": {
"eventDefinition": {
"enum": [
"bpmn:MessageEventDefinition"
]
}
},
"required": [
"eventDefinition"
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,64 @@
"type"
]
}
}
},
"required": [
"binding"
]
}
}
}
},
"required": [
"properties"
]
},
"then": {
"required": [
"elementType"
],
"properties": {
"elementType": {
"required": [
"value"
],
"properties": {
"eventDefinition": {
"const": "bpmn:MessageEventDefinition"
"value": {
"enum": [
"bpmn:ReceiveTask",
"bpmn:SendTask",
"bpmn:StartEvent",
"bpmn:IntermediateCatchEvent",
"bpmn:IntermediateThrowEvent",
"bpmn:BoundaryEvent",
"bpmn:EndEvent"
]
}
},
"required": [
"eventDefinition"
"allOf": [
{
"if": {
"properties": {
"value": {
"enum": [
"bpmn:StartEvent",
"bpmn:IntermediateCatchEvent",
"bpmn:IntermediateThrowEvent",
"bpmn:BoundaryEvent",
"bpmn:EndEvent"

]
}
}
},
"then": {
"eventDefinition": {
"const": "bpmn:MessageEventDefinition"
},
"required": [
"eventDefinition"
]
}
}
]
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export const template = {
'name': 'MissingBindingName',
'id': 'com.camunda.example.MissingBindingName',
'name': 'MissingEventDefinition',
'id': 'com.camunda.example.MissingEventDefinition',
'appliesTo': [
'bpmn:IntermediateCatchEvent'
],
Expand All @@ -23,12 +23,21 @@ export const errors = [
{
keyword: 'required',
dataPath: '/elementType',
schemaPath: '#/allOf/1/allOf/0/then/properties/elementType/required',
schemaPath: '#/allOf/1/allOf/0/then/properties/elementType/allOf/0/then/required',
params: {
missingProperty: 'eventDefinition'
},
message: 'should have required property \'eventDefinition\''
},
{
'dataPath': '/elementType',
'keyword': 'if',
'message': 'should match "then" schema',
'params': {
'failingKeyword': 'then'
},
'schemaPath': '#/allOf/1/allOf/0/then/properties/elementType/allOf/0/if'
},
{
keyword: 'if',
dataPath: '',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,23 +1,45 @@
export const template = {
'name': 'MissingBindingName',
'id': 'com.camunda.example.MissingBindingName',
'appliesTo': [
'bpmn:IntermediateCatchEvent'
],
'elementType': {
value: 'bpmn:IntermediateCatchEvent',
eventDefinition: 'bpmn:MessageEventDefinition'
export const template = [
{
'name': 'ValidTemplateEvent',
'id': 'com.camunda.example.ValidTemplateEvent',
'appliesTo': [
'bpmn:IntermediateCatchEvent'
],
'elementType': {
value: 'bpmn:IntermediateCatchEvent',
eventDefinition: 'bpmn:MessageEventDefinition'
},
'properties': [
{
'label': 'foo',
'type': 'String',
'binding': {
'type': 'bpmn:Message#property',
'name': 'name'
}
}
]
},
'properties': [
{
'label': 'foo',
'type': 'String',
'binding': {
'type': 'bpmn:Message#property',
'name': 'name'
{
'name': 'ValidTemplateReceiveTask',
'id': 'com.camunda.example.ValidTemplateReceiveTask',
'appliesTo': [
'bpmn:Task'
],
'elementType': {
value: 'bpmn:ReceiveTask'
},
'properties': [
{
'label': 'foo',
'type': 'String',
'binding': {
'type': 'bpmn:Message#property',
'name': 'name'
}
}
}
]
};
]
}
];

export const errors = null;
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,21 @@ export const errors = [
{
keyword: 'required',
dataPath: '/elementType',
schemaPath: '#/allOf/1/allOf/0/then/properties/elementType/required',
schemaPath: '#/allOf/1/allOf/0/then/properties/elementType/allOf/0/then/required',
params: {
missingProperty: 'eventDefinition'
},
message: 'should have required property \'eventDefinition\''
},
{
'dataPath': '/elementType',
'keyword': 'if',
'message': 'should match "then" schema',
'params': {
'failingKeyword': 'then'
},
'schemaPath': '#/allOf/1/allOf/0/then/properties/elementType/allOf/0/if'
},
{
keyword: 'if',
dataPath: '',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,23 +1,45 @@
export const template = {
'name': 'MissingBindingName',
'id': 'com.camunda.example.MissingBindingName',
'appliesTo': [
'bpmn:IntermediateCatchEvent'
],
'elementType': {
value: 'bpmn:IntermediateCatchEvent',
eventDefinition: 'bpmn:MessageEventDefinition'
export const template = [
{
'name': 'ValidTemplateEvent',
'id': 'com.camunda.example.ValidTemplateEvent',
'appliesTo': [
'bpmn:IntermediateCatchEvent'
],
'elementType': {
value: 'bpmn:IntermediateCatchEvent',
eventDefinition: 'bpmn:MessageEventDefinition'
},
'properties': [
{
'label': 'foo',
'type': 'String',
'binding': {
'type': 'bpmn:Message#zeebe:subscription#property',
'name': 'correlationKey'
}
}
]
},
'properties': [
{
'label': 'foo',
'type': 'String',
'binding': {
'type': 'bpmn:Message#zeebe:subscription#property',
'name': 'correlationKey'
{
'name': 'ValidTemplateReceiveTask',
'id': 'com.camunda.example.ValidTemplateReceiveTask',
'appliesTo': [
'bpmn:Task'
],
'elementType': {
value: 'bpmn:ReceiveTask'
},
'properties': [
{
'label': 'foo',
'type': 'String',
'binding': {
'type': 'bpmn:Message#zeebe:subscription#property',
'name': 'correlationKey'
}
}
}
]
};
]
}
];

export const errors = null;

0 comments on commit 867928b

Please sign in to comment.