@Override public void processMatch(String matchedValue) { message.setOutboundProperty(matchedValue, message.getInboundProperty(matchedValue), message.getPropertyDataType(matchedValue, PropertyScope.INBOUND)); } });
protected void renameInScope(String oldKey, String newKey, PropertyScope propertyScope, MuleMessage message) { Object propValue = message.getProperty(oldKey, propertyScope); DataType<?> propertyDataType = message.getPropertyDataType(oldKey, propertyScope); message.removeProperty(oldKey, propertyScope); message.setProperty(newKey, propValue, propertyScope, propertyDataType); }
public static TypedValue getTypedProperty(String expression, MuleMessage msg, PropertyScope scope) { boolean required = true; if (expression.endsWith(OPTIONAL_ARGUMENT)) { expression = expression.substring(0, expression.length() - OPTIONAL_ARGUMENT.length()); required = false; } final String propertyName = expression.trim(); Object result = msg.getProperty(propertyName, scope); if (result == null && required) { throw new RequiredValueException(CoreMessages.expressionEvaluatorReturnedNull("header", scope.getScopeName() + ":" + expression)); } DataType<?> propertyDataType = msg.getPropertyDataType(propertyName, scope); if (propertyDataType == null) { propertyDataType = DataTypeFactory.create(Object.class, null); } return new TypedValue(result, propertyDataType); }
@Override protected DataType getDataType(MuleMessage message, ASTNode node) { if (node.isIdentifier() && message.getPropertyNames(INVOCATION).contains(node.getName())) { return message.getPropertyDataType(node.getName(), INVOCATION); } else if (node.isIdentifier() && message.getPropertyNames(SESSION).contains(node.getName())) { return message.getPropertyDataType(node.getName(), SESSION); } else { return null; } } }
if (propertyValue != null) message.setOutboundProperty(propertyName, propertyValue, message.getPropertyDataType(propertyName, PropertyScope.INBOUND));
return message.getPropertyDataType(propertyName, scope);