Example usage for org.springframework.statemachine StateContext getEvent

List of usage examples for org.springframework.statemachine StateContext getEvent

Introduction

In this page you can find the example usage for org.springframework.statemachine StateContext getEvent.

Prototype

E getEvent();

Source Link

Document

Gets the event associated with a context.

Usage

From source file:org.springframework.statemachine.processor.StateMachineHandlerCallHelper.java

public void callOnEventNotAccepted(String stateMachineId, StateContext<S, E> stateContext) {
    List<StateMachineHandler<? extends Annotation, S, E>> handlersList = new ArrayList<StateMachineHandler<? extends Annotation, S, E>>();
    String cacheKey = OnEventNotAccepted.class.getName() + stateMachineId;
    List<CacheEntry> list = getCacheEntries(cacheKey);
    if (list == null) {
        return;//  w w w  .  j ava 2 s . com
    }
    for (CacheEntry entry : list) {
        E event = stateContext.getEvent();
        if (event != null) {
            if (annotationHandlerEventVariableMatch(entry.metaAnnotation, new String[] { event.toString() })) {
                handlersList.add(entry.handler);
            }
        } else {
            handlersList.add(entry.handler);
        }
    }
    getStateMachineHandlerResults(handlersList, stateContext);
}