private SubflowStateModel parseSubflowState(Element element) { SubflowStateModel state = new SubflowStateModel(element.getAttribute("id"), element.getAttribute("subflow")); state.setParent(element.getAttribute("parent")); state.setSubflowAttributeMapper(element.getAttribute("subflow-attribute-mapper")); state.setInputs(parseInputs(element)); state.setOutputs(parseOutputs(element)); state.setAttributes(parseAttributes(element)); state.setSecured(parseSecured(element)); state.setOnEntryActions(parseOnEntryActions(element)); state.setExceptionHandlers(parseExceptionHandlers(element)); state.setTransitions(parseTransitions(element)); state.setOnExitActions(parseOnExitActions(element)); return state; }
public void merge(Model model) { SubflowStateModel state = (SubflowStateModel) model; setParent(null); setAttributes(merge(getAttributes(), state.getAttributes())); setSecured((SecuredModel) merge(getSecured(), state.getSecured())); setOnEntryActions(merge(getOnEntryActions(), state.getOnEntryActions(), false)); setExceptionHandlers(merge(getExceptionHandlers(), state.getExceptionHandlers())); setTransitions(merge(getTransitions(), state.getTransitions())); setOnExitActions(merge(getOnExitActions(), state.getOnExitActions(), false)); setSubflow(merge(getSubflow(), state.getSubflow())); setSubflowAttributeMapper(merge(getSubflowAttributeMapper(), state.getSubflowAttributeMapper())); setInputs(merge(getInputs(), state.getInputs())); setOutputs(merge(getOutputs(), state.getOutputs())); }
private void parseAndAddSubflowState(SubflowStateModel state, Flow flow) { MutableAttributeMap<Object> attributes = parseMetaAttributes(state.getAttributes()); parseAndPutSecured(state.getSecured(), attributes); getLocalContext().getFlowArtifactFactory().createSubflowState(state.getId(), flow, parseActions(state.getOnEntryActions()), parseSubflowExpression(state.getSubflow()), parseSubflowAttributeMapper(state), parseTransitions(state.getTransitions()), parseExceptionHandlers(state.getExceptionHandlers(), state.getTransitions()), parseActions(state.getOnExitActions()), attributes); }
public Model createCopy() { SubflowStateModel copy = new SubflowStateModel(getId(), subflow); super.fillCopy(copy); copy.setSubflowAttributeMapper(subflowAttributeMapper); copy.setInputs(copyList(inputs)); copy.setOutputs(copyList(outputs)); return copy; }
public void testMerge() { SubflowStateModel child = new SubflowStateModel("child", null); SubflowStateModel parent = new SubflowStateModel("child", "flow"); parent.setSecured(new SecuredModel("secured")); child.merge(parent); assertEquals("flow", child.getSubflow()); assertNotNull(child.getSecured()); }
private SubflowAttributeMapper parseSubflowAttributeMapper(SubflowStateModel state) { if (StringUtils.hasText(state.getSubflowAttributeMapper())) { String beanId = state.getSubflowAttributeMapper(); return getLocalContext().getApplicationContext().getBean(beanId, SubflowAttributeMapper.class); } else { Mapper inputMapper = parseSubflowInputMapper(state.getInputs()); Mapper outputMapper = parseSubflowOutputMapper(state.getOutputs()); return new GenericSubflowAttributeMapper(inputMapper, outputMapper); } }
public void testNotMergeable() { SubflowStateModel child = new SubflowStateModel("child", "flow"); SubflowStateModel parent = new SubflowStateModel("parent", "flow"); assertFalse(child.isMergeableWith(parent)); }
public Model createCopy() { SubflowStateModel copy = new SubflowStateModel(getId(), subflow); super.fillCopy(copy); copy.setSubflowAttributeMapper(subflowAttributeMapper); copy.setInputs(copyList(inputs)); copy.setOutputs(copyList(outputs)); return copy; }
private SubflowAttributeMapper parseSubflowAttributeMapper(SubflowStateModel state) { if (StringUtils.hasText(state.getSubflowAttributeMapper())) { String beanId = state.getSubflowAttributeMapper(); return getLocalContext().getApplicationContext().getBean(beanId, SubflowAttributeMapper.class); } else { Mapper inputMapper = parseSubflowInputMapper(state.getInputs()); Mapper outputMapper = parseSubflowOutputMapper(state.getOutputs()); return new GenericSubflowAttributeMapper(inputMapper, outputMapper); } }
public void testNotMergeableWithNull() { SubflowStateModel child = new SubflowStateModel("child", "flow"); assertFalse(child.isMergeableWith(null)); }
public void merge(Model model) { SubflowStateModel state = (SubflowStateModel) model; setParent(null); setAttributes(merge(getAttributes(), state.getAttributes())); setSecured((SecuredModel) merge(getSecured(), state.getSecured())); setOnEntryActions(merge(getOnEntryActions(), state.getOnEntryActions(), false)); setExceptionHandlers(merge(getExceptionHandlers(), state.getExceptionHandlers())); setTransitions(merge(getTransitions(), state.getTransitions())); setOnExitActions(merge(getOnExitActions(), state.getOnExitActions(), false)); setSubflow(merge(getSubflow(), state.getSubflow())); setSubflowAttributeMapper(merge(getSubflowAttributeMapper(), state.getSubflowAttributeMapper())); setInputs(merge(getInputs(), state.getInputs())); setOutputs(merge(getOutputs(), state.getOutputs())); }
private SubflowStateModel parseSubflowState(Element element) { SubflowStateModel state = new SubflowStateModel(element.getAttribute("id"), element.getAttribute("subflow")); state.setParent(element.getAttribute("parent")); state.setSubflowAttributeMapper(element.getAttribute("subflow-attribute-mapper")); state.setInputs(parseInputs(element)); state.setOutputs(parseOutputs(element)); state.setAttributes(parseAttributes(element)); state.setSecured(parseSecured(element)); state.setOnEntryActions(parseOnEntryActions(element)); state.setExceptionHandlers(parseExceptionHandlers(element)); state.setTransitions(parseTransitions(element)); state.setOnExitActions(parseOnExitActions(element)); return state; }
private void parseAndAddSubflowState(SubflowStateModel state, Flow flow) { MutableAttributeMap<Object> attributes = parseMetaAttributes(state.getAttributes()); parseAndPutSecured(state.getSecured(), attributes); getLocalContext().getFlowArtifactFactory().createSubflowState(state.getId(), flow, parseActions(state.getOnEntryActions()), parseSubflowExpression(state.getSubflow()), parseSubflowAttributeMapper(state), parseTransitions(state.getTransitions()), parseExceptionHandlers(state.getExceptionHandlers(), state.getTransitions()), parseActions(state.getOnExitActions()), attributes); }
private SubflowAttributeMapper parseSubflowAttributeMapper(SubflowStateModel state) { if (StringUtils.hasText(state.getSubflowAttributeMapper())) { String beanId = state.getSubflowAttributeMapper(); return (SubflowAttributeMapper) getLocalContext().getApplicationContext().getBean(beanId, SubflowAttributeMapper.class); } else { Mapper inputMapper = parseSubflowInputMapper(state.getInputs()); Mapper outputMapper = parseSubflowOutputMapper(state.getOutputs()); return new GenericSubflowAttributeMapper(inputMapper, outputMapper); } }
public void testMergeable() { SubflowStateModel child = new SubflowStateModel("child", "flow"); assertTrue(child.isMergeableWith(child)); }
public void merge(Model model) { SubflowStateModel state = (SubflowStateModel) model; setParent(null); setAttributes(merge(getAttributes(), state.getAttributes())); setSecured((SecuredModel) merge(getSecured(), state.getSecured())); setOnEntryActions(merge(getOnEntryActions(), state.getOnEntryActions(), false)); setExceptionHandlers(merge(getExceptionHandlers(), state.getExceptionHandlers())); setTransitions(merge(getTransitions(), state.getTransitions())); setOnExitActions(merge(getOnExitActions(), state.getOnExitActions(), false)); setSubflow(merge(getSubflow(), state.getSubflow())); setSubflowAttributeMapper(merge(getSubflowAttributeMapper(), state.getSubflowAttributeMapper())); setInputs(merge(getInputs(), state.getInputs())); setOutputs(merge(getOutputs(), state.getOutputs())); }
private SubflowStateModel parseSubflowState(Element element) { SubflowStateModel state = new SubflowStateModel(element.getAttribute("id"), element.getAttribute("subflow")); state.setParent(element.getAttribute("parent")); state.setSubflowAttributeMapper(element.getAttribute("subflow-attribute-mapper")); state.setInputs(parseInputs(element)); state.setOutputs(parseOutputs(element)); state.setAttributes(parseAttributes(element)); state.setSecured(parseSecured(element)); state.setOnEntryActions(parseOnEntryActions(element)); state.setExceptionHandlers(parseExceptionHandlers(element)); state.setTransitions(parseTransitions(element)); state.setOnExitActions(parseOnExitActions(element)); return state; }