I saw BPMN models with FEEL expressions using a predefined (ie, not introduced by the designer) var. “application”. FEEL expressions used fields of this var. to access, for instance, the id. of the current executing process instance.
It seems that “application” is legacy Camunda 7? Am I right?
Beyond, with Camunda 8, are there predefined var. that can be used within FEEL expressions? Thanks for any highlight.
Hi @Bab64,
You’re absolutely correct! The application variable you’ve seen in BPMN models is indeed legacy from Camunda 7.
Camunda 7 vs Camunda 8: Expression Language Differences
Camunda 7 used JUEL (Java Unified Expression Language), which had broad access to:
- Engine APIs and internals
- Application context (like Spring beans)
- Built-in variables like
applicationfor accessing process instance metadata
Camunda 8 uses FEEL (Friendly Enough Expression Language), which is intentionally more restricted:
- FEEL expressions can only access process instance data and variables
- No direct access to engine APIs or application context
- No built-in
applicationvariable
Predefined Variables in Camunda 8
Currently, Camunda 8 does not provide predefined variables like process instance ID/key directly accessible in FEEL expressions. This is actually a known limitation that’s being worked on.
Workaround: Store Metadata as Process Variables
If you need access to process metadata (like process instance key, BPMN process ID, etc.) in your FEEL expressions, you need to explicitly store them as process variables first. Here’s the common pattern:
// In your job worker
job.complete(
Map.of(
"processInstanceKey", job.getProcessInstanceKey(),
"bpmnProcessId", job.getBpmnProcessId(),
// other metadata you need
)
);
Once stored as variables, you can use them in FEEL expressions:
= processInstanceKey
= bpmnProcessId
References
- Conceptual Differences: Expression Language
- FEEL Variables Documentation
- Forum Discussion: Get Process Key in FEEL
Hope this clarifies the differences! Let me know if you have any other questions about FEEL expressions in Camunda 8.