Package com.yworkflow.definition.model
Interface Result<E extends Result<?>>
- Type Parameters:
E- the specific result type (for type safety in builder patterns)
- All Known Subinterfaces:
ConditionalResult,DefaultResult
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 Summary
Modifier and TypeMethodDescriptionvoidExecutes all post-functions associated with this result.voidExecutes all pre-functions associated with this result.Returns the destination of this result.getDueAt()Returns the due date for this result.Returns the enter status of this result.Returns the exit status of this result.Returns the list of owners for this result.Returns the post-functions associated with this result.Returns the pre-functions associated with this result.Returns the validators associated with this result.booleanChecks if this result is complete.voidverifyInputs(WorkflowExecutionContext context) Verifies that all required inputs are present and valid for this result.Methods inherited from interface com.yworkflow.definition.model.base.Model
getExtensions, getParent, getProperties, getPropertyDifferenceMethods inherited from interface com.yworkflow.definition.model.validation.Validatable
validate
-
Method Details
-
executePreFunctions
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
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
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
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
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
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
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
-