Class Task

All Implemented Interfaces:
Serializable, Step
Direct Known Subclasses:
PreSaveWikiPageTask, SaveUserProfileTask, SaveWikiPageTask

public abstract class Task
extends AbstractStep
AbstractStep subclass that executes instructions, uninterrupted, and results in an Outcome. Concrete classes only need to implement AbstractStep.execute(). When the execution step completes, execute must return Outcome.STEP_COMPLETE, Outcome.STEP_CONTINUE or Outcome.STEP_ABORT. Subclasses can add any errors by calling the helper method AbstractStep.addError(String). The execute method should generally capture and add errors to the error list instead of throwing a WikiException.

Since:
2.5
See Also:
Serialized Form
  • Constructor Details

    • Task

      public Task​(String messageKey)
      Public constructor that creates a new Task with a specified message key. After construction, the protected method AbstractStep.setWorkflow(int, Map) should be called.
      Parameters:
      messageKey - the Step's message key, such as decision.editPageApproval. By convention, the message prefix should be a lower-case version of the Step's type, plus a period (e.g., task. and decision.).
    • Task

      public Task​(int workflowId, Map<String,​Serializable> workflowContext, String messageKey)
      Constructs a new instance of a Task, with an associated Workflow and message key.
      Parameters:
      workflowId - the parent workflow id to set
      workflowContext - the parent workflow context to set
      messageKey - the i18n message key
  • Method Details