Use function on process variable before using it

Hi,

what’s the best way to use a function on a variable in Modeler before using it?

I’ve created a simple form to pass in Email, Subject and Text for an Email to send. I like to send this mail with the HTTP task (Mailgun API) and therefore need to URL-Encode the variables (otherwise it results in an “invalid url encoding exception”).

Hey Heurazio,

What you can do is to write your own FlowableFunctionDelegate with the encode function and register it with the engine. Then during modeling you can do ${encode(variable)}.

Have a look at the FlowableDateFunctionDelegate as an example.

Cheers,
Filip

Hi @filiphr,

I need to implement the encode function. Can you please help, I am not sure how FlowableDateFunctionDelegate can be called within the modeler.

Please let me know if there is any more documentation on how to build it and use it. How this date format method will be called in EL?

Thanks,
Vaibhav