/** * Builds any transitions shared by all states of the flow. * @throws FlowBuilderException an exception occurred building the flow */ public void buildGlobalTransitions() throws FlowBuilderException { getFlow().getGlobalTransitionSet().addAll(parseTransitions(flowModel.getGlobalTransitions())); }
private void parseAndAddGlobalTransitions(Element element, Flow flow) { Element globalTransitionsElement = getChildElementByTagName(element, GLOBAL_TRANSITIONS_ELEMENT); if (globalTransitionsElement != null) { flow.getGlobalTransitionSet().addAll(parseTransitions(globalTransitionsElement)); } }
/** * Builds any transitions shared by all states of the flow. * @throws FlowBuilderException an exception occurred building the flow */ public void buildGlobalTransitions() throws FlowBuilderException { getFlow().getGlobalTransitionSet().addAll(parseTransitions(flowModel.getGlobalTransitions())); }
/** * Builds any transitions shared by all states of the flow. * @throws FlowBuilderException an exception occurred building the flow */ public void buildGlobalTransitions() throws FlowBuilderException { getFlow().getGlobalTransitionSet().addAll(parseTransitions(flowModel.getGlobalTransitions())); }
acts = StreamSupport.stream(def.getGlobalTransitionSet().spliterator(), false) .map(tr -> tr.getId() + " -> " + tr.getTargetStateId() + " @ " + tr.getExecutionCriteria().toString()) .collect(Collectors.toList());
public void testAddGlobalTransition() { Transition t = new Transition(to("myState2")); flow.getGlobalTransitionSet().add(t); assertSame(t, flow.getGlobalTransitionSet().toArray()[1]); }
public void testFlowSecuredTransition() { model.setStates(asList(new EndStateModel("end"))); TransitionModel transition = new TransitionModel(); transition.setTo("end"); transition.setSecured(new SecuredModel("ROLE_USER")); model.setGlobalTransitions(asList(transition)); Flow flow = getFlow(model); SecurityRule rule = (SecurityRule) flow.getGlobalTransitionSet().toArray()[0].getAttributes().get( SecurityRule.SECURITY_ATTRIBUTE_NAME); assertNotNull(rule); assertEquals(SecurityRule.COMPARISON_ANY, rule.getComparisonType()); assertEquals(1, rule.getAttributes().size()); assertTrue(rule.getAttributes().contains("ROLE_USER")); }
private Flow createSimpleFlow() { flow = new Flow("myFlow"); ViewState state1 = new ViewState(flow, "myState1", new StubViewFactory()); state1.getTransitionSet().add(new Transition(on("submit"), to("myState2"))); new EndState(flow, "myState2"); flow.getGlobalTransitionSet().add(new Transition(on("globalEvent"), to("myState2"))); return flow; }