/** * Get the state model for an identifier * @param id the state identifier to find * @return the state or null if the identifier was not found */ public AbstractStateModel getStateById(String id) { if (states != null) { for (AbstractStateModel state : states) { if (id.equals(state.getId())) { return state; } } } return null; }
protected void fillCopy(AbstractStateModel copy) { copy.setParent(parent); copy.setAttributes(copyList(attributes)); copy.setSecured((SecuredModel) copy(secured)); copy.setOnEntryActions(copyList(onEntryActions)); copy.setExceptionHandlers(copyList(exceptionHandlers)); }
protected void fillCopy(final AbstractTransitionableStateModel copy) { super.fillCopy(copy); copy.setTransitions(copyList(transitions)); copy.setOnExitActions(copyList(onExitActions)); }
public AbstractStateModel(String id) { setId(id); }
public Model createCopy() { EndStateModel copy = new EndStateModel(getId()); super.fillCopy(copy); copy.setView(view); copy.setCommit(commit); copy.setOutputs(outputs); return copy; }
public AbstractStateModel(String id) { setId(id); }
protected void fillCopy(AbstractStateModel copy) { copy.setParent(parent); copy.setAttributes(copyList(attributes)); copy.setSecured((SecuredModel) copy(secured)); copy.setOnEntryActions(copyList(onEntryActions)); copy.setExceptionHandlers(copyList(exceptionHandlers)); }
/** * Get the state model for an identifier * @param id the state identifier to find * @return the state or null if the identifier was not found */ public AbstractStateModel getStateById(String id) { if (states != null) { for (AbstractStateModel state : states) { if (id.equals(state.getId())) { return state; } } } return null; }
public Model createCopy() { DecisionStateModel copy = new DecisionStateModel(getId()); super.fillCopy(copy); copy.setIfs(copyList(ifs)); copy.setOnExitActions(copyList(onExitActions)); return copy; }
/** * Get the state model for an identifier * @param id the state identifier to find * @return the state or null if the identifier was not found */ public AbstractStateModel getStateById(String id) { if (states != null) { for (Iterator it = states.iterator(); it.hasNext();) { AbstractStateModel state = (AbstractStateModel) it.next(); if (id.equals(state.getId())) { return state; } } } return null; }
protected void fillCopy(final AbstractTransitionableStateModel copy) { super.fillCopy(copy); copy.setTransitions(copyList(transitions)); copy.setOnExitActions(copyList(onExitActions)); }
public void testGetFlowDefinition() { FlowModel flow = holder.getFlowModel(); assertNull(flow.getStartStateId()); assertEquals("end", flow.getStates().get(0).getId()); }
public Model createCopy() { EndStateModel copy = new EndStateModel(getId()); super.fillCopy(copy); copy.setView(view); copy.setCommit(commit); copy.setOutputs(outputs); return copy; }
public void testBuildFlowWithDefaultStartState() { ClassPathResource resource = new ClassPathResource("flow-startstate-default.xml", getClass()); FlowModelBuilder builder = new XmlFlowModelBuilder(resource, registry); builder.init(); builder.build(); FlowModel flow = builder.getFlowModel(); assertNull(flow.getStartStateId()); assertEquals("end", flow.getStates().get(0).getId()); }
public Model createCopy() { DecisionStateModel copy = new DecisionStateModel(getId()); super.fillCopy(copy); copy.setIfs(copyList(ifs)); copy.setOnExitActions(copyList(onExitActions)); return copy; }
public void testBuildFlowWithEndState() { ClassPathResource resource = new ClassPathResource("flow-endstate.xml", getClass()); FlowModelBuilder builder = new XmlFlowModelBuilder(resource, registry); builder.init(); builder.build(); FlowModel flow = builder.getFlowModel(); assertNull(flow.getStartStateId()); assertEquals("end", flow.getStates().get(0).getId()); }
public void testMerge() { ClassPathResource resourceChild = new ClassPathResource("flow-inheritance-child.xml", getClass()); ClassPathResource resourceParent = new ClassPathResource("flow-inheritance-parent.xml", getClass()); registry.registerFlowModel("child", new DefaultFlowModelHolder(new XmlFlowModelBuilder(resourceChild, registry))); registry.registerFlowModel("parent", new DefaultFlowModelHolder(new XmlFlowModelBuilder(resourceParent, registry))); FlowModel flow = registry.getFlowModel("child"); assertEquals(1, flow.getGlobalTransitions().size()); assertEquals(2, flow.getStates().size()); assertEquals("view", flow.getStates().get(0).getId()); }