01: /*
02: * Copyright 2004-2007 the original author or authors.
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.apache.org/licenses/LICENSE-2.0
09: *
10: * Unless required by applicable law or agreed to in writing, software
11: * distributed under the License is distributed on an "AS IS" BASIS,
12: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13: * See the License for the specific language governing permissions and
14: * limitations under the License.
15: */
16: package org.springframework.webflow.engine;
17:
18: import org.springframework.webflow.execution.Event;
19: import org.springframework.webflow.execution.FlowExecutionException;
20:
21: /**
22: * Thrown when no transition can be matched given the occurence of an event in
23: * the context of a flow execution request.
24: * <p>
25: * Typically this happens because there is no "handler" transition for the last
26: * event that occured.
27: *
28: * @author Keith Donald
29: * @author Erwin Vervaet
30: */
31: public class NoMatchingTransitionException extends
32: FlowExecutionException {
33:
34: /**
35: * The event that occured that could not be matched to a Transition.
36: */
37: private Event event;
38:
39: /**
40: * Create a new no matching transition exception.
41: * @param flowId the current flow
42: * @param stateId the state that could not be transitioned out of
43: * @param event the event that occured that could not be matched to a
44: * transition
45: * @param message the message
46: */
47: public NoMatchingTransitionException(String flowId, String stateId,
48: Event event, String message) {
49: super (flowId, stateId, message);
50: this .event = event;
51: }
52:
53: /**
54: * Create a new no matching transition exception.
55: * @param flowId the current flow
56: * @param stateId the state that could not be transitioned out of
57: * @param event the event that occured that could not be matched to a
58: * transition
59: * @param message the message
60: * @param cause the underlying cause
61: */
62: public NoMatchingTransitionException(String flowId, String stateId,
63: Event event, String message, Throwable cause) {
64: super (flowId, stateId, message, cause);
65: this .event = event;
66: }
67:
68: /**
69: * Returns the event for the current request that did not trigger any
70: * supported transition.
71: */
72: public Event getEvent() {
73: return event;
74: }
75: }
|