Conductor: Event handler doesn't work

Created on 27 Feb 2019  路  4Comments  路  Source: Netflix/conductor

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"
}
question

All 4 comments

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?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

johnlongo picture johnlongo  路  3Comments

andrea11 picture andrea11  路  4Comments

RemcoBuddelmeijer picture RemcoBuddelmeijer  路  6Comments

HardiChandra picture HardiChandra  路  3Comments

gaoqichao021 picture gaoqichao021  路  3Comments