/** * Handle an exception that occurred in this state during the context of the current flow execution request. * @param exception the exception that occurred * @param context the flow execution control context */ public boolean handleException(FlowExecutionException exception, RequestControlContext context) { return getExceptionHandlerSet().handleException(exception, context); }
/** * Configure common properties for a state. */ private void configureCommonProperties(State state, Action[] entryActions, FlowExecutionExceptionHandler[] exceptionHandlers, AttributeMap<?> attributes) { state.getEntryActionList().addAll(entryActions); state.getExceptionHandlerSet().addAll(exceptionHandlers); state.getAttributes().putAll(attributes); } }
/** * Handle an exception that occurred in this state during the context of the current flow execution request. * @param exception the exception that occurred * @param context the flow execution control context */ public boolean handleException(FlowExecutionException exception, RequestControlContext context) { return getExceptionHandlerSet().handleException(exception, context); }
/** * Handle an exception that occurred in this state during the context of the current flow execution request. * @param exception the exception that occurred * @param context the flow execution control context */ public boolean handleException(FlowExecutionException exception, RequestControlContext context) { return getExceptionHandlerSet().handleException(exception, context); }
/** * Handle an exception that occured in this state during the context of the current flow execution request. * @param exception the exception that occured * @param context the flow execution control context * @return the selected error view, or <code>null</code> if no handler matched or returned a non-null view * selection */ public ViewSelection handleException(FlowExecutionException exception, RequestControlContext context) { return getExceptionHandlerSet().handleException(exception, context); }
/** * Configure common properties for a state. */ private void configureCommonProperties(State state, Action[] entryActions, FlowExecutionExceptionHandler[] exceptionHandlers, AttributeMap attributes) { state.getEntryActionList().addAll(entryActions); state.getExceptionHandlerSet().addAll(exceptionHandlers); state.getAttributes().putAll(attributes); } }
/** * Configure common properties for a state. */ private void configureCommonProperties(State state, Action[] entryActions, FlowExecutionExceptionHandler[] exceptionHandlers, AttributeMap<?> attributes) { state.getEntryActionList().addAll(entryActions); state.getExceptionHandlerSet().addAll(exceptionHandlers); state.getAttributes().putAll(attributes); } }
/** * Configure common properties for a state. */ private void configureCommonProperties(State state, Action[] entryActions, FlowExecutionExceptionHandler[] exceptionHandlers, AttributeMap attributes) { state.getEntryActionList().addAll(entryActions); state.getExceptionHandlerSet().addAll(exceptionHandlers); state.getAttributes().putAll(attributes); } }
/** * Configure common properties for a state. */ private void configureCommonProperties(State state, Action[] entryActions, FlowExecutionExceptionHandler[] exceptionHandlers, AttributeMap attributes) { state.getEntryActionList().addAll(entryActions); state.getExceptionHandlerSet().addAll(exceptionHandlers); state.getAttributeMap().putAll(attributes); } }
public void testHandledException() { state.getExceptionHandlerSet().add(new FlowExecutionExceptionHandler() { public boolean canHandle(FlowExecutionException exception) { return true; } public void handle(FlowExecutionException exception, RequestControlContext context) { handled = true; } }); FlowExecutionException e = new FlowExecutionException(flow.getId(), state.getId(), "Whatev"); MockRequestControlContext context = new MockRequestControlContext(flow); assertTrue(state.handleException(e, context)); assertTrue(handled); }
public void testStartExceptionThrownByStateHandledByStateExceptionHandler() { Flow flow = new Flow("flow"); flow.getExceptionHandlerSet().add(new StubFlowExecutionExceptionHandler()); final FlowExecutionException e = new FlowExecutionException("flow", "state", "Oops"); State s = new State(flow, "state") { protected void doEnter(RequestControlContext context) throws FlowExecutionException { throw e; } }; StubFlowExecutionExceptionHandler exceptionHandler = new StubFlowExecutionExceptionHandler(); s.getExceptionHandlerSet().add(exceptionHandler); FlowExecutionImpl execution = new FlowExecutionImpl(flow); MockExternalContext context = new MockExternalContext(); assertFalse(execution.hasStarted()); execution.start(null, context); assertTrue(exceptionHandler.getHandled()); }