API changes
New interface will be added for the custom actions
/** * Defines a custom action in the Workflow. */ public interface CustomAction extends ProgramLifecycle<CustomActionContext> { /** * Configure a custom Workflow action. */ void configure(CustomActionConfigurer configurer); /** * @throws Exception */ void run() throws Exception; }Custom actions will now receive the CustomActionContext.
/** * Context used by action running in the Workflow. */ public interface CustomActionContext extends RuntimeContext, Transactional, PluginContext, WorkflowInfoProvider { /** * Return the specification of the custom Action. */ CustomActionSpecification getSpecification(); /** * Return the logical start time of the Workflow */ long getLogicalStartTime(); /** * Return the state of the custom action. */ ProgramState getState(); }AbstractCustomAction can implement the CustomAction interface.
public abstract class AbstractCustomAction implements CustomAction { private CustomActionContext context; @Override public void initialize(CustomActionContext context) throws Exception { this.context = context; } protected final CustomActionContext getContext() { return context; } }WorkflowConfigurer will allow adding the CustomAction as
// Adds a CustomAction to the Workflow. void addAction(CustomAction customAction);We will deprecate following classes: