Skip to content

Commit

Permalink
Merge pull request #2244 from SanojPunchihewa/var-update
Browse files Browse the repository at this point in the history
Update variable mediator with Synapse expression evaluation changes
  • Loading branch information
SanojPunchihewa authored Dec 2, 2024
2 parents 80e83df + ce786b3 commit 6f7c715
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 6f7c715

Please sign in to comment.