try {
Provider<? extends Saga> sagaProvider = providers.get(sagaToStart);
createdSaga = sagaProvider.get();
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;