
A util for bpmn-js to extract Camunda BPM process variables from a BPMN 2.0 diagram.
Installation
$ npm i --save @bpmn-io/extract-process-variables
Usage
Given this example diagram
import {
getProcessVariables,
getVariablesForScope,
} from '@bpmn-io/extract-process-variables';
const canvas = modeler.get('canvas');
const rootElement = canvas.getRootElement();
const allVariables = getProcessVariables(rootElement.businessObject);
const scopeVariables = getVariablesForScope('Process_1', rootElement.businessObject);
Note that origin
and scope
retrieves the full moddle element. The example outputs are reduced due to better readibility.
Note that camunda-bpmn-moddle descriptors have to be installed.
See also
License
MIT