flowable / flowable-engine

A compact and highly efficient workflow and Business Process Management (BPM) platform for developers, system admins and business users.
https://www.flowable.org
Apache License 2.0
8.01k stars 2.63k forks source link

Conditions should support more than JUEL expressions #3884

Closed rasmusfaber closed 1 month ago

rasmusfaber commented 6 months ago

Is your feature request related to a problem? Please describe.

Conditions (and other places with FormalExpressions) currenly ignores the language attribute and always assumes that the content is JUEL. Some conditions are hard or impossible to write in JUEL (i.e. "is the country of one of the addresses in the US?"), so it would be great to be able to use i.e. Groovy instead.

Describe the solution you'd like

SequenceFlows (and BoundaryEvents etc.) should parse the language attribute of the bpmn:condition. ExpressionManager.createExpression() should use the language to load the ScriptEngine using javax.script.ScriptEngineManager, probably only accepting languages from a configurable whitelist.

It looks like a fairly straightforward task, and I will be happy to supply a PR, if I can get an indication that it is likely to be merged.