Skip to content

Commit

Permalink
Update variable mediator with Synapse expression evaluation changes
Browse files Browse the repository at this point in the history
  • Loading branch information
SanojPunchihewa committed Dec 2, 2024
1 parent c17a92f commit ce786b3
Showing 1 changed file with 15 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -169,12 +169,27 @@ private Object getResultValue(MessageContext synCtx) {
return value;
} else {
if (expression != null) {
if (isOMType(type)) {
return buildOMElement(expression.stringValueOf(synCtx));
} else if (isStringType(type)) {
return expression.stringValueOf(synCtx);
}
return convertExpressionResult(expression.objectValueOf(synCtx), type);
}
}
return null;
}

private boolean isOMType(String type) {

return type != null && XMLConfigConstants.DATA_TYPES.OM.equals(XMLConfigConstants.DATA_TYPES.valueOf(type));
}

private boolean isStringType(String type) {

return type != null && XMLConfigConstants.DATA_TYPES.STRING.equals(XMLConfigConstants.DATA_TYPES.valueOf(type));
}

private Object convertValue(String value, String type) {

if (type == null) {
Expand Down

0 comments on commit ce786b3

Please sign in to comment.