I tried to find the right place to intercept if a state transition could not be found. it seems to me like FlowExecutionStack.signalEvent is the right place.
I tried to add a try/catch around the onevent call:
Code:
ViewDescriptor viewDescriptor;
try {
viewDescriptor = state.onEvent(event, context);
} catch (NoMatchingTransitionException e) {
if (logger.isDebugEnabled()) {
logger.debug("Fallback to previous state");
}
viewDescriptor = state.enter(context);
}
This gives me a nice
Code:
Required attribute 'org.springframework.validation.BindException.#formObject' is not present in flow scope; attributes present are = map['#formObject' -> org.springframework.samples.birthdate.BirthDate@1b00766, 'txToken' -> '60C74F93-8F0E-EFEC-B100-76A98F8AC768', 'birthDate' -> org.springframework.samples.birthdate.BirthDate@1b00766]
RequestURI=/birthdate/birthDate.do
I'm not sure what I should do with this. Obvious there is an object (which must be the most recent one) in the flowscope but not binded?
Can I do this in the signalEvent? Yup, when this is added the whole thing would for sure look like a hack. But I really need the "go back to last page" functionality in my app as I can not kick the user back to the beginning of the flow if he had used the browser buttons (and I can not use continuations as I must prevent the user from "free" browsing in the flow)
Thanks,
Markus