private Saga startNewSaga ( final Class < ? extends Saga > sagaToStart ) { Saga createdSaga = null ; try { createdSaga = createNewSagaInstance ( sagaToStart ) ; createdSaga . createNewState ( ) ; SagaState newState = createdSaga . state ( ) ; newState . setSagaId ( UUID . randomUUID ( ) . toString ( ) ) ; newState . setType ( sagaToStart . getName ( ) ) ; } catch ( Exception ex ) { LOG . error ( "Unable to create new instance of saga type {}." , sagaToStart , ex ) ; } return createdSaga ; }
Starts a new saga by creating an instance and attaching a new saga state .