Hi @chirag! Great question about implementing a Camunda 8.8 exporter. Let me break down how you can access the different pieces of information you need:
Getting Variables (correlationKey)
Variables are available through variable records in your exporter. When variables are created, updated, or deleted, your exporter will receive variable records that contain:
processInstanceKey- Variable name and value (as JSON)
- Scope key and other metadata
You can filter for variable records and extract your correlationKey variable from these records.
Getting BPMN XML Details (Element Name & Documentation)
This is more complex because exporter records don’t contain the full BPMN XML or element metadata directly. Here are your options:
Option 1: Use Operate API (Recommended)
If you’re using Operate, you can retrieve the BPMN XML using the process definition key:
GET /v1/process-definitions/{processDefinitionKey}/xml
Option 2: Parse BPMN at Deployment Time
In your exporter, listen for deployment records which contain the process definition key and metadata. However, the deployment record itself doesn’t include the raw BPMN XML in the exporter stream.
Option 3: External BPMN Management
Store and manage the BPMN XML externally (e.g., in your application or database) when processes are deployed, then reference it in your exporter.
Implementation Strategy
Here’s a recommended approach:
-
Cache BPMN Metadata: When you receive deployment records, use the process definition key to fetch the BPMN XML (via Operate API or external storage)
-
Parse XML: Extract element names, documentation, and other static metadata from the BPMN XML and store them in a lookup map keyed by
processDefinitionKey + elementId -
Correlate in Exporter: When processing process instance events, use the
processDefinitionKeyandelementIdfrom the record to lookup the cached element metadata -
Handle Variables: Process variable records separately to extract your correlation key and other variables
Key Points
- Exporter records provide
processDefinitionKey,elementId, andprocessInstanceKeybut not element names or documentation - Variables come through separate variable records in the exporter stream
- BPMN XML must be retrieved separately (not included in exporter records)
- Element metadata is static per BPMN version, so caching is effective
References
- Exporters Documentation
- Variables Documentation
- Forum: Camunda Exporter Record Documentation
- Forum: How to obtain process details?
Would you like me to elaborate on any of these approaches or help with specific implementation details?