public static Event validateEventIdForMatchingTransitionInContext ( final String eventId , final Optional < RequestContext > context , final Map < String , Object > attributes ) { val attributesMap = new LocalAttributeMap < Object > ( attributes ) ; val event = new Event ( eventId , eventId , attributesMap ) ; return context . map ( ctx -> { val def = ctx . getMatchingTransition ( event . getId ( ) ) ; if ( def == null ) { throw new AuthenticationException ( "Transition definition cannot be found for event " + event . getId ( ) ) ; } return event ; } ) . orElse ( event ) ; }
Validate event id for matching transition in context event .