Interface LifecycleManager

  • All Known Implementing Classes:
    LifecycleManagerImpl

    public interface LifecycleManager
    Provides lifecycle functionality for a project. This is the entry point for executing a transition on a stateful object. The LifecycleManager uses internally LifecycleConfiguration lifecycle configuration which must be configured by a user. If any exception occurs during a transition will be placed into the TransitionResult transition result.
    • Method Detail

      • execute

        TransitionResult execute​(StatefulObject statefulObject,
                                 String event)
        Executes a transition of the stateful object according the event.
        Parameters:
        statefulObject - an object which state should be changed with corresponding actions execution
        event - a signal which helps to define the target state
        Returns:
        TransitionResult transition result containing information about executed transition
        Throws:
        TransitionNotFoundException - if no transition was found for corresponding stateful object's source state and event
        AmbiguousTransitionException - if there are more then one matching transitions
      • execute

        TransitionResult execute​(StatefulObject statefulObject,
                                 String event,
                                 Map<String,​Object> variables)
        Executes a transition of the stateful object according the event. The method contains an additional map of variables which is used in the actions and conditions during a transition.
        Parameters:
        statefulObject - an object which state should be changed with corresponding actions execution
        event - a signal which helps to define the target state
        variables - any external data which is necessary during transition performance
        Returns:
        TransitionResult transition result containing information about executed transition
        Throws:
        TransitionNotFoundException - if no transition was found for the corresponding stateful object's source state and event
        AmbiguousTransitionException - if there are more then one matching transitions