Flowable 6.8 Community edition and Mail Task - How get enviroment properties using expression

I have a simple BPMN diagram with just a Start → Mail Task → End

In the Mail Task I want set the “to”, “from” and “Subject” using “expression” (UEL expressions)

my goal for example is to make the “to” (recipient of the mail), dynamic… where the email address should be taken from the “application properties” and if missed as fixed

conceptually I want write similar to

${env.getProperty(“mypropemailto”) ? {env.getProperty(“mypropemailto”) : “flowable@flowable.org”}

but I don’t know “function” to be used. It is not a task/process variable

Reading Back End Expressions | Flowable Enterprise Documentation

it seems I must use propertyConfigurationService so… what was my idea of before should be

${propertyConfigurationService.getProperty(“mypropemailto”, “flowable@flowable.org”)}

but it is not working with the “to” attributes. Checking java src code seems this is not implemented on this field

there is a way to implement it ? or an alternative ?

So the idea I want add into the “application.properties” or into “flowable-default.properties” a key “mypropemailto” and I neet to get this value from JUEL expression

Reason: I have QA and PROD env… and if both are deploying the same BPMN (becasue QA is a backup of PROD), really I don’t want sent mail to real recipient but to a “specific one” and the expression will help to to “force” and “override” BPMN

I cannot use process/task variable because it is not set

This is why it is very important to use overridable properties on “to”… I want avoid in QA/TEST to send mail to real recipient (that maybe are real customer/supplier)

Is this feature available in Community Edition of Flowable? Can you suggest something ?

Thanks

1 Like

The correct bean name is environment. So your expression will look like ${environment.containsProperty(“mypropemailto”) ? {environment.getProperty(“mypropemailto”) : “flowable@flowable.org”}

Thanks for the solution and it worked.