Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Next »

  1. 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;
    }
    
    
  2. Custom actions will now receive the CustomActionContext.

    /**
     * Context used by action running in the Workflow.
     */
    public interface CustomActionContext extends RuntimeContext, Transactional, PluginContext {
    
      /**
       * Return the specification of the Workflow that started this action
       */
      WorkflowSpecification getWorkflowSpecification();
    
      /**
       * Return the specification of the Action.
       */
       getSpecification();
    
      /**
       * Return the logical start time of the Workflow
       */
      long getLogicalStartTime();
    
      /**
       * @return a {@link WorkflowToken}
       */
      WorkflowToken getToken();
    
      /**
       * Return true if the execution of the action is successful, false otherwise. This method can be
       * used from {@link AbstractCustomAction#destroy} to determine the status of the
       * {@link CustomAction}.
       */
      @Beta
      boolean isSuccessful();
    }
  3. 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;
    	}
    }
  4.  WorkflowConfigurer will allow adding the CustomAction as 

    // Adds a CustomAction to the Workflow.
    void addAction(CustomAction customAction);
  5. We will deprecate following classes: 

    Deprecated ClassNew ClassDescription
    WorkflowActionCustomActionRepresents the action that is running as a part of the Workflow.
    AbstractWorkflowActionAbstractCustomActionDefault implementation for the custom actions in the Workflow.
    WorkflowActionConfigurerCustomActionConfigurerConfigurer for the actions in the Workflow.
       

 

  • No labels