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

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

Introduction

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

Prototype

void publishStateMachineError(Object source, StateMachine<?, ?> stateMachine, Exception exception);

Source Link

Document

Publish a state machine error.

Usage

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

protected void notifyStateMachineError(StateContext<S, E> stateContext) {
    try {/*w ww .  j  a  v a  2  s  . co  m*/
        stateMachineHandlerCallHelper.callOnStateMachineError(getBeanName(), stateContext);
        stateListener.stateMachineError(stateContext.getStateMachine(), stateContext.getException());
        stateListener.stateContext(stateContext);
        if (contextEventsEnabled) {
            StateMachineEventPublisher eventPublisher = getStateMachineEventPublisher();
            if (eventPublisher != null) {
                eventPublisher.publishStateMachineError(this, stateContext.getStateMachine(),
                        stateContext.getException());
            }
        }
    } catch (Throwable e) {
        log.warn("Error during notifyStateMachineError", e);
    }
}