} else {
// By convention, if the solution engine encounters an exception while trying to execute and xaction,
// the engine will stick the caught exception in the runtime context messages. Here we're looking through
// the messages to see if an an action sequence exception was caught and stored with the messages.
// If so we'll format and return an exception message.
ActionSequenceException theFailureException = null;
List theMessages = context.getMessages();
for ( Object msg : theMessages ) {
if ( msg instanceof ActionSequenceException ) {
theFailureException = (ActionSequenceException) msg;
break;