logger.debug("Handling state="+stateName);
status = state.handle(executor);
stepExecution = executor.getStepExecution();
}
catch (FlowExecutionException e) {
executor.close(new FlowExecution(stateName, status));
throw e;
}
catch (Exception e) {
executor.close(new FlowExecution(stateName, status));
throw new FlowExecutionException(String.format("Ended flow=%s at state=%s with exception", name,
stateName), e);
}
logger.debug("Completed state="+stateName+" with status="+status);
state = nextState(stateName, status, stepExecution);
}
FlowExecution result = new FlowExecution(stateName, status);
executor.close(result);
return result;
}