Interface Result<E extends Result<?>>

Type Parameters:
E - the specific result type (for type safety in builder patterns)
All Superinterfaces:
CanCopy<E>, HasId<ResultId>, Model<E,ResultId>, Validatable
All Known Subinterfaces:
ConditionalResult, DefaultResult

public interface Result<E extends Result<?>> extends Model<E,ResultId>
Represents the result of executing a transition in a workflow. A result defines what happens after a transition is executed, including the destination state, any functions to be executed, and additional metadata about the transition outcome.

Results are the core mechanism for controlling workflow flow. They specify where the workflow should go next and what processing should occur during the transition. Results can have pre-functions, post-functions, and validators that are executed at different stages of the transition.

Results support various types of destinations including single states, forks (multiple parallel states), and joins (synchronization points). They also support ownership assignment and due date specification for workflow management and monitoring.

Since:
1.0
See Also:
  • Method Details

    • executePreFunctions

      void executePreFunctions(WorkflowExecutionContext context) throws WorkflowException
      Executes all pre-functions associated with this result. Pre-functions are executed before the transition is completed and can be used for validation, logging, or preparation tasks.
      Parameters:
      context - the execution context
      Throws:
      WorkflowException - if any pre-function execution fails
    • executePostFunctions

      void executePostFunctions(WorkflowExecutionContext context) throws WorkflowException
      Executes all post-functions associated with this result. Post-functions are executed after the transition is completed and can be used for cleanup, notifications, or follow-up tasks.
      Parameters:
      context - the execution context
      Throws:
      WorkflowException - if any post-function execution fails
    • verifyInputs

      void verifyInputs(WorkflowExecutionContext context) throws WorkflowException
      Verifies that all required inputs are present and valid for this result. This method is called before executing the result to ensure that all necessary data is available.
      Parameters:
      context - the execution context
      Throws:
      WorkflowException - if validation fails
    • getValidators

      List<Validator> getValidators()
      Returns the validators associated with this result. Validators are used to ensure that the result can be executed with the current attributes.
      Returns:
      the list of validators for this result
    • getPostFunctions

      List<Function> getPostFunctions()
      Returns the post-functions associated with this result. Post-functions are executed after the transition is completed.
      Returns:
      the list of post-functions for this result
    • getPreFunctions

      List<Function> getPreFunctions()
      Returns the pre-functions associated with this result. Pre-functions are executed before the transition is completed.
      Returns:
      the list of pre-functions for this result
    • getDestination

      DestinationId getDestination()
      Returns the destination of this result. The destination specifies where the workflow should transition to after this result is executed.
      Returns:
      the destination ID for this result
    • getOwners

      List<String> getOwners()
      Returns the list of owners for this result. Owners are responsible for the workflow instance when it reaches the destination state.
      Returns:
      the list of owner identifiers
    • getDueAt

      String getDueAt()
      Returns the due date for this result. The due date specifies when the workflow should be completed by.
      Returns:
      the due date string (ISO format) or null if not specified
    • getExitStatus

      ResultStatus getExitStatus()
      Returns the exit status of this result. The exit status indicates the outcome of the transition when leaving the current state.
      Returns:
      the exit status for this result
    • getEnterStatus

      ResultStatus getEnterStatus()
      Returns the enter status of this result. The enter status indicates the initial status when entering the destination state.
      Returns:
      the enter status for this result
    • isComplete

      boolean isComplete()
      Checks if this result is complete. A complete result has all necessary information to be executed successfully.
      Returns:
      true if the result is complete, false otherwise