In our Use case , we are using 2+ JavaScript policies at different places in the proxy flow.Wherein we are using context.getVariable() in all the Js ploicy to get the extracted variables.
Use a library Js where we can define the function which has all the getVariables and then call that function in all the JS
Example: library Js
function getVariables(){ var Var1 = context.getVariable("Variable1"); var Var2 = context.getVariable("Variable2"); }
Thanks @Anil Sagar for the info.
It worked !
we can reuse context.getVariable() too without defining it inside a separate function.
Example : library Js
var Var1 = context.getVariable("Variable1"); var Var2 = context.getVariable("Variable2"); function function1() { }
The variable Var1,Var2 and Function function1() can be reused in any Js within the Proxy.
Hope i am correct!
@maivizhi , Awesome, Glad it worked 🙂