/** * Adds an output mapping that maps a single subflow output attribute into the <i>flow scope</i> of the resuming * parent flow. For instance: "y" will result in the "y" attribute of the subflow output map being mapped into the * flowscope of the resuming parent flow as "y". * @param attributeName the subflow output attribute to map into the parent flow scope * @return this, to support call chaining */ public ConfigurableFlowAttributeMapper addOutputAttribute(String attributeName) { Expression attribute = expressionParser.parseExpression(attributeName); SettableExpression scope = new AttributeExpression(attribute, ScopeType.FLOW); addOutputMapping(new Mapping(attribute, scope, null)); return this; }
/** * Adds an input mapping that maps a single attribute in parent <i>flow scope</i> into the subflow input map. For * instance: "x" will result in the "x" attribute in parent flow scope being mapped into the subflow input map as * "x". * @param attributeName the attribute in flow scope to map into the subflow * @return this, to support call chaining */ public ConfigurableFlowAttributeMapper addInputAttribute(String attributeName) { SettableExpression attribute = expressionParser.parseSettableExpression(attributeName); Expression scope = new AttributeExpression(attribute, ScopeType.FLOW); addInputMapping(new Mapping(scope, attribute, null)); return this; }
private void parseSimpleAttributeMappings(DefaultAttributeMapper mapper, List elements) { ExpressionParser parser = getLocalFlowServiceLocator().getExpressionParser(); for (Iterator it = elements.iterator(); it.hasNext();) { Element element = (Element) it.next(); SettableExpression attribute = parser.parseSettableExpression(element.getAttribute(NAME_ATTRIBUTE)); SettableExpression expression = new AttributeExpression(attribute, parseScope(element, ScopeType.FLOW)); if (getRequired(element, false)) { mapper.addMapping(new RequiredMapping(expression, expression, null)); } else { mapper.addMapping(new Mapping(expression, expression, null)); } } }