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

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

Introduction

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

Prototype

void publishStateMachineStart(Object source, StateMachine<?, ?> stateMachine);

Source Link

Document

Publish a statemachine start event.

Usage

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

protected void notifyStateMachineStarted(StateContext<S, E> stateContext) {
    try {//from w ww.j a va2 s . c o  m
        stateMachineHandlerCallHelper.callOnStateMachineStart(getBeanName(), stateContext);
        stateListener.stateMachineStarted(stateContext.getStateMachine());
        stateListener.stateContext(stateContext);
        if (contextEventsEnabled) {
            StateMachineEventPublisher eventPublisher = getStateMachineEventPublisher();
            if (eventPublisher != null) {
                eventPublisher.publishStateMachineStart(this, stateContext.getStateMachine());
            }
        }
    } catch (Throwable e) {
        log.warn("Error during notifyStateMachineStarted", e);
    }
}