Use function on process variable before using it


#1

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”).


#2

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