/** * Create a new transition that matches on the specified criteria, transitioning to the target state calculated by * the provided targetStateResolver. * @param matchingCriteria the criteria for matching this transition * @param targetStateResolver the resolver of the target state of this transition * @see #setExecutionCriteria(TransitionCriteria) */ public Transition(TransitionCriteria matchingCriteria, TargetStateResolver targetStateResolver) { setMatchingCriteria(matchingCriteria); setTargetStateResolver(targetStateResolver); }
/** * Factory method that creates a new transition, a path from one step in a flow to another. This method is an atomic * operation that returns a fully initialized transition. It encapsulates the selection of the transition * implementation as well as the transition assembly. * @param targetStateResolver the resolver of the target state of the transition (required) * @param matchingCriteria the criteria that matches the transition; may be null * @param executionCriteria the criteria that governs execution of the transition after match; may be null * @param attributes attributes to assign to the transition, which may also be used to affect transition * construction; may be null * @return the fully initialized transition instance */ public Transition createTransition(TargetStateResolver targetStateResolver, TransitionCriteria matchingCriteria, TransitionCriteria executionCriteria, AttributeMap<?> attributes) { Transition transition = new Transition(targetStateResolver); if (matchingCriteria != null) { transition.setMatchingCriteria(matchingCriteria); } if (executionCriteria != null) { transition.setExecutionCriteria(executionCriteria); } transition.getAttributes().putAll(attributes); return transition; }
/** * Create a new transition that matches on the specified criteria, transitioning to the target state calculated by * the provided targetStateResolver. * @param matchingCriteria the criteria for matching this transition * @param targetStateResolver the resolver of the target state of this transition * @see #setExecutionCriteria(TransitionCriteria) */ public Transition(TransitionCriteria matchingCriteria, TargetStateResolver targetStateResolver) { setMatchingCriteria(matchingCriteria); setTargetStateResolver(targetStateResolver); }
/** * Create a new transition that matches on the specified criteria, transitioning to the target state calculated by * the provided targetStateResolver. * @param matchingCriteria the criteria for matching this transition * @param targetStateResolver the resolver of the target state of this transition * @see #setExecutionCriteria(TransitionCriteria) */ public Transition(TransitionCriteria matchingCriteria, TargetStateResolver targetStateResolver) { setMatchingCriteria(matchingCriteria); setTargetStateResolver(targetStateResolver); }
/** * Create a new transition that matches on the specified criteria, transitioning to the target state calculated by * the provided targetStateResolver. * @param matchingCriteria the criteria for matching this transition * @param targetStateResolver the resolver of the target state of this transition * @see #setExecutionCriteria(TransitionCriteria) */ public Transition(TransitionCriteria matchingCriteria, TargetStateResolver targetStateResolver) { setMatchingCriteria(matchingCriteria); setTargetStateResolver(targetStateResolver); }
/** * Factory method that creates a new transition, a path from one step in a flow to another. This method is an atomic * operation that returns a fully initialized transition. It encapsulates the selection of the transition * implementation as well as the transition assembly. * @param targetStateResolver the resolver of the target state of the transition (required) * @param matchingCriteria the criteria that matches the transition; may be null * @param executionCriteria the criteria that governs execution of the transition after match; may be null * @param attributes attributes to assign to the transition, which may also be used to affect transition * construction; may be null * @return the fully initialized transition instance */ public Transition createTransition(TargetStateResolver targetStateResolver, TransitionCriteria matchingCriteria, TransitionCriteria executionCriteria, AttributeMap<?> attributes) { Transition transition = new Transition(targetStateResolver); if (matchingCriteria != null) { transition.setMatchingCriteria(matchingCriteria); } if (executionCriteria != null) { transition.setExecutionCriteria(executionCriteria); } transition.getAttributes().putAll(attributes); return transition; }
/** * Factory method that creates a new transition, a path from one step in a flow to another. This method is an atomic * operation that returns a fully initialized transition. It encapsulates the selection of the transition * implementation as well as the transition assembly. * @param targetStateResolver the resolver of the target state of the transition (required) * @param matchingCriteria the criteria that matches the transition; may be null * @param executionCriteria the criteria that governs execution of the transition after match; may be null * @param attributes attributes to assign to the transition, which may also be used to affect transition * construction; may be null * @return the fully initialized transition instance */ public Transition createTransition(TargetStateResolver targetStateResolver, TransitionCriteria matchingCriteria, TransitionCriteria executionCriteria, AttributeMap attributes) { Transition transition = new Transition(targetStateResolver); if (matchingCriteria != null) { transition.setMatchingCriteria(matchingCriteria); } if (executionCriteria != null) { transition.setExecutionCriteria(executionCriteria); } transition.getAttributes().putAll(attributes); return transition; }
/** * Factory method that creates a new transition, a path from one step in a flow to another. This method is an atomic * operation that returns a fully initialized transition. It encapsulates the selection of the transition * implementation as well as the transition assembly. * @param targetStateResolver the resolver of the target state of the transition (required) * @param matchingCriteria the criteria that matches the transition; may be null * @param executionCriteria the criteria that governs execution of the transition after match; may be null * @param attributes attributes to assign to the transition, which may also be used to affect transition * construction; may be null * @return the fully initialized transition instance * @throws FlowArtifactLookupException an exception occured creating the transition */ public Transition createTransition(TargetStateResolver targetStateResolver, TransitionCriteria matchingCriteria, TransitionCriteria executionCriteria, AttributeMap attributes) throws FlowArtifactLookupException { Transition transition = new Transition(targetStateResolver); if (matchingCriteria != null) { transition.setMatchingCriteria(matchingCriteria); } if (executionCriteria != null) { transition.setExecutionCriteria(executionCriteria); } transition.getAttributeMap().putAll(attributes); return transition; }
public void testSmartValidatorWithHintOnTransition() { Transition transition = new Transition(); transition.setMatchingCriteria(new DefaultTransitionCriteria(new StaticExpression(eventId))); transition.getAttributes().put("validationHints", new StaticExpression("State1")); ViewState state = new ViewState(requestContext.getRootFlow(), "state2", new StubViewFactory()); state.getTransitionSet().add(transition); requestContext.setCurrentState(state); LegacyModelValidator validator = new LegacyModelValidator(); ExtendedModel model = new ExtendedModel(); ValidationHelper helper = new ValidationHelper(model, requestContext, eventId, modelName, null, codesResolver, null); helper.setValidator(validator); helper.validate(); assertTrue(validator.fallbackInvoked); assertTrue(validator.hints.length > 0); assertEquals(Model.State1.class, validator.hints[0]); }