Example usage for org.springframework.statemachine.event StateMachineEventPublisher publishTransitionStart

List of usage examples for org.springframework.statemachine.event StateMachineEventPublisher publishTransitionStart

Introduction

In this page you can find the example usage for org.springframework.statemachine.event StateMachineEventPublisher publishTransitionStart.

Prototype

void publishTransitionStart(Object source, Transition<?, ?> transition);

Source Link

Document

Publish a transition start event.

Usage

From source file:org.springframework.statemachine.support.StateMachineObjectSupport.java

protected void notifyTransitionStart(StateContext<S, E> stateContext) {
    try {/*from w w  w  .  j  a  va2  s .  co  m*/
        stateMachineHandlerCallHelper.callOnTransitionStart(getBeanName(), stateContext);
        stateListener.transitionStarted(stateContext.getTransition());
        stateListener.stateContext(stateContext);
        if (contextEventsEnabled) {
            StateMachineEventPublisher eventPublisher = getStateMachineEventPublisher();
            if (eventPublisher != null) {
                eventPublisher.publishTransitionStart(this, stateContext.getTransition());
            }
        }
    } catch (Throwable e) {
        log.warn("Error during notifyTransitionStart", e);
    }
}