Hi!
I have a problem with Event handler. I can't make it work(
Could you help me with a problem or show me an example with it?
Thanks in advance!
Taskdef
[{
"name": "task_100",
"retryCount": 3,
"timeoutSeconds": 3600,
"timeoutPolicy": "TIME_OUT_WF",
"retryLogic": "FIXED",
"retryDelaySeconds": 600,
"responseTimeoutSeconds": 3600
}]
Workflow
{
"name": "test8",
"description": "Test",
"version": 1,
"tasks": [
{
"name": "event_task",
"taskReferenceName": "event_0",
"type": "EVENT",
"startDelay": 0,
"sink": "conductor",
"optional": false
},
{
"name": "task_100",
"taskReferenceName": "task_100",
"type": "SIMPLE",
"startDelay": 0,
"optional": false
}
],
"schemaVersion": 2,
"restartable": true
}
Event handler
{
"name": "task_100_event_handler",
"event": "conductor:test8:event_0",
"condition": "True",
"actions": [
{
"action": "complete_task",
"complete_task": {
"workflowId": "${source.externalId.workflowId}",
"taskRefName": "task_100"
},
"expandInlineJSON": true
}
],
"active": "true"
}
Event handler with the below modification works. I am not sure yet on the
${source.externalId.workflowId}
{
"name": "task_100_event_handler",
"event": "conductor:test8:event_0",
"condition": "1==1",
"actions": [
{
"action": "complete_task",
"complete_task": {
"workflowId": "${workflowInstanceId}",
"taskRefName": "task_100"
},
"expandInlineJSON": true
}
],
"active": "true"
}
Thanks @jkaipa for answering. I have fixed the documentation to reflect this.
@MaksimRT please refer the developer labs here to acclimatize yourself to the usage of event handlers.
@apanicker-nflx Thank you very much for the example!
I checked it and it works as expected!
@apanicker-nflx I have a small question. Is it possible to fire an event via REST API?