From c9afb4ffd604a182afa6f561e1faaf08077121fd Mon Sep 17 00:00:00 2001 From: chathurangaj Date: Fri, 3 Jan 2025 23:30:30 +0530 Subject: [PATCH] add synapse expression support for templates --- .../apache/synapse/mediators/template/TemplateContext.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/core/src/main/java/org/apache/synapse/mediators/template/TemplateContext.java b/modules/core/src/main/java/org/apache/synapse/mediators/template/TemplateContext.java index 9a7b73d24e..054139465f 100644 --- a/modules/core/src/main/java/org/apache/synapse/mediators/template/TemplateContext.java +++ b/modules/core/src/main/java/org/apache/synapse/mediators/template/TemplateContext.java @@ -28,6 +28,7 @@ import org.apache.synapse.mediators.eip.EIPUtils; import org.apache.synapse.transport.util.MessageHandlerProvider; import org.apache.synapse.transport.passthru.PassThroughConstants; +import org.apache.synapse.util.xpath.SynapseExpression; import org.apache.synapse.util.xpath.SynapseJsonPath; import javax.xml.stream.XMLStreamException; @@ -147,7 +148,8 @@ private Object getEvaluatedParamValue(MessageContext synCtx, String parameter, V MessageHandlerProvider.getMessageHandler(axis2MsgCtx).buildMessage(axis2MsgCtx); } - if (expression.getExpression() instanceof SynapseJsonPath) { + if (expression.getExpression() instanceof SynapseJsonPath || + expression.getExpression() instanceof SynapseExpression) { return expression.evaluateValue(synCtx); } else { return resolveExpressionValue(synCtx, expression);