Custom system tasks require TaskType enum / conductor-common modification
Under https://netflix.github.io/conductor/extend/#system-tasks, it says:
To create system tasks follow the steps below:
Extend com.netflix.conductor.core.execution.tasks.WorkflowSystemTask
Instantiate the new class as part of the startup (eager singleton)
Implement the TaskMapper interface
Add this implementation to the map identified by TaskMappers
However, this does not seem to be a complete list of steps required.
In https://github.com/Netflix/conductor/blob/master/core/src/main/java/com/netflix/conductor/core/execution/DeciderService.java#L543 and https://github.com/Netflix/conductor/blob/master/core/src/main/java/com/netflix/conductor/core/execution/DeciderService.java#L569, the registered task mapper is only ever used if a corresponding TaskType enum entry is also added.
It seems that we cannot add our own custom system tasks without modifying TaskType.java in conductor-common?
@kyle--lee Correct, custom task will have to be added to TaskType. We'll update the docs to create custom system tasks at the earliest possible. Or, please feel free to send in a PR. Thank you.
Update: Custom system tasks are not necessarily added to TaskType, or any other core modules.
For example:
public class CustomTask extends WorkflowSystemTask {
public CustomTask(...) {
super(CUSTOM_TASK_NAME);
}
}
will register the custom task by putting it in the registry map. Also, ensure to initialize CustomTask as eager singleton.
@kishorebanala thanks for the response!
I agree, it seems if you can register it and eagerly initialize it, and the system task will be run by Conductor.
However, it doesn't seem like it is possible it register a TaskMapper for it without also modifying TaskType. If this is the case, can I open a PR to update the docs? Are TaskMappers essential for registering a system task?
This issue is stale, because it has been open for 45 days with no activity. Remove the stale label or comment, or this will be closed in 7 days.
This issue was closed, because it has been stalled for 7 days with no activity.