Hello, I have a Catch Event template that I will share below, my problem is that when I use this template directly, I can dynamically create the message name with the entered parameters, and the process progresses without errors.
{
“$schema”: “https://unpkg.com/@camunda/zeebe-element-templates-json-schema/resources/schema.json”,
“name”: “Service Task Result Event”,
“id”: “ServiceTaskResultEvent”,
“version”: 1,
“description”: “”,
“category”: {
“id”: “connectors”,
“name”: “Connectors”
},
“appliesTo”: [
“bpmn:IntermediateCatchEvent”
],
“elementType”: {
“value”: “bpmn:IntermediateCatchEvent”,
“eventDefinition”: “bpmn:MessageEventDefinition”
},
“groups”: [
{
“id”: “properties”,
“label”: “Properties”
}
],
“properties”: [
{
“label”: “Element id”,
“description”: “Kontrol edilecek service task element id’si.”,
“group”: “properties”,
“type”: “String”,
“value”: “”,
“binding”: {
“type”: “zeebe:input”,
“name”: “elementId”
},
“constraints”: {
“notEmpty”: true
}
},
{
“type”: “Hidden”,
“value”: “= elementId+ "-success"”,
“binding”: {
“type”: “bpmn:Message#property”,
“name”: “name”
},
“condition”: {
“property”: “isSuccess”,
“equals”: “success”
}
},
{
“type”: “Hidden”,
“value”: “= elementId+ "-fail"”,
“binding”: {
“type”: “bpmn:Message#property”,
“name”: “name”
},
“condition”: {
“property”: “isSuccess”,
“equals”: “fail”
}
},
{
“id”: “isSuccess”,
“label”: “Processing result”,
“group”: “properties”,
“description”: “İşlem başarılı/başarısız koşulu.”,
“value”: “success”,
“type”: “Dropdown”,
“choices”: [
{
“name”: “Success”,
“value”: “success”
},
{
“name”: “Fail”,
“value”: “fail”
}
],
“binding”: {
“type”: “zeebe:input”,
“name”: “isSuccess”
}
},
{
“id”: “resultExpression”,
“label”: “Result data map”,
“group”: “properties”,
“description”: “Gelen veriyi variableslara mapleme için, örn: {"deger1" : response.body.deger1}.”,
“feel”: “optional”,
“binding”: {
“name”: “resultExpression”,
“type”: “zeebe:property”
},
“type”: “Text”
},
{
“type”: “Hidden”,
“value”: “= WorkflowProcessInstanceId”,
“binding”: {
“type”: “bpmn:Message#zeebe:subscription#property”,
“name”: “correlationKey”
}
}
]
}
But when I use it after an event based gateway (this is what I really need, service task writes the relevant task to a message queue, another application reads the message and reports whether it is successful or unsuccessful, and the window listens to it and continues the process), it gives an error. Because it cannot access the elementId and isSuccess variables that I use as zeebe:input, the reason is that event based does not wait directly on message events, so these variables defined locally cannot be accessed.
Expected result of the expression ’ elementId+ “-fail”’ to be ‘STRING’, but was ‘NULL’. The evaluation reported the following warnings:
[NO_VARIABLE_FOUND] No variable found with name ‘elementId’
[INVALID_TYPE] Can’t add ‘“-fail”’ to ‘null’
reminder: this situation does not occur in parallel gateway because it goes directly to the message event step and can see local inputs.
What kind of solution could there be her