Skip to main content

Extended Points

DispatcherExtension is the plugin extension interface, which inherits PF4J's ExtensionPoint interface:

public interface DispatcherExtension extends ExtensionPoint {
String handle(Resource resource, DispatchInfo dispatchInfo);

String getName();

default String getIcon() { return null; }

default String getSchema() { return null; }
}

TaskExtension is the extension interface of plugins, which inherits PF4J's ExtensionPoint Interface:

getName()

The getName() method returns the name of the plugin, which will also define the resource protocol name that the plugin fits in, that is, the resourceProtocol's field in the task configuration.Rill Flow will select an executor for the task by matching the resource Protocol's name with the task executor.

handle()

The handle() method, the task process, is the core of the task processing extension plugin, and when the task properly matched with the executor is distributed by the Rill Flow, will call the handle() method of the executor to complete the task.

handle() method contains two parameters:

  • Resource:Resource type, with resourceName, schemeProtocoland schemeValue fields to pass the resourceName configured and parsed structure to the executor for use.
  • DispatchInfo: DispatchInfo, with the following fields:
    • ExecutionId: Execution ID for this workflow
    • TaskInfo: TaskInfo type, contains details of the current task including task name, task status, task definition information, etc. See the code annotation and plugin example code of that type.

getIcon()

The display icon used to provide tasks to the admin background. The default implementation returns empty will be displayed using the default icon.

If you want to customize the display icon, implement this method and return the base 64 encoding string for icon.

getSchema()

Form format that needs to be displayed and completed when providing tasks for the admin page to define the protocol. See: json-schema

When creating the tasks of the protocol, the admin page resolves the schema string returned by the plugin, displays the schema defined form after the required parameters, and places the user's information in the task-defined parameters fields of yaml. In the handle() method, you can get the user-filled parameter by dispatchInfo.getTask().getParameters().