Question
Vodafone UK Ltd
GB
Last activity: 15 Nov 2019 10:58 EST
Paramerising Function-Alias Causing Error
Hey,
I am trying to build a function-alias rule to take in paramertised inputs into an interval calculation to improve run time over the current Difference In Day/Min/Hour Function currently provided.
<%
String parameter2 = tools.getStepPage().getString(".pyParameters(2).pyParametersParamValue").replaceAll("\"","").replaceAll("'","");
%>
<p:choose>
<p:when java="<%= parameter2.equals("days") %>">
<p:choose>
now()::date - interval '{1} days'
</p:choose>
</p:when>
<p:otherwise>
ERROR : Unknown Interval Type
</p:otherwise>
</p:choose>
On Execution I am getting the error:
Hey,
I am trying to build a function-alias rule to take in paramertised inputs into an interval calculation to improve run time over the current Difference In Day/Min/Hour Function currently provided.
<%
String parameter2 = tools.getStepPage().getString(".pyParameters(2).pyParametersParamValue").replaceAll("\"","").replaceAll("'","");
%>
<p:choose>
<p:when java="<%= parameter2.equals("days") %>">
<p:choose>
now()::date - interval '{1} days'
</p:choose>
</p:when>
<p:otherwise>
ERROR : Unknown Interval Type
</p:otherwise>
</p:choose>
On Execution I am getting the error:
However hardcoding the value allows it to work sucessfully.
Any ideas how I can pass a parameter into a '' encapsulated string?
I have attached screenshots for reference.
Many Thanks In Advance