New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@bpmn-io/extract-process-variables

Package Overview
Dependencies
Maintainers
0
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@bpmn-io/extract-process-variables

A util for bpmn-js to extract Camunda BPM process variables from a BPMN 2.0 diagram.

  • 1.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
14K
decreased by-43.49%
Maintainers
0
Weekly downloads
 
Created
Source

extract-process-variables

CI

An 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

Camunda Platform 7

Given this example diagram

import {
  getProcessVariables,
  getVariablesForScope,
} from '@bpmn-io/extract-process-variables';

// For Camunda Platform 8 diagrams, use the /zeebe submodule
// import {
//   getProcessVariables,
//   getVariablesForScope,
// } from '@bpmn-io/extract-process-variables/zeebe';

const canvas = modeler.get('canvas');

const rootElement = canvas.getRootElement();

const allVariables = getProcessVariables(rootElement.businessObject);
/*
  [
    {
      "name": "variable1",
      "origin": [ "Task_1" ],
      "scope": "Process_1"
    },
    {
      "name": "variable2",
      "origin": [ "Task_1" ],
      "scope": "Process_1"
    },
    {
      "name": "variable3",
      "origin": [ "Task_2" ],
      "scope": "SubProcess_1"
    }
  ]
*/

const scopeVariables = getVariablesForScope('Process_1', rootElement.businessObject);
/*
  [
    {
      "name": "variable1",
      "origin": [ "Task_1" ],
      "scope": "Process_1"
    },
    {
      "name": "variable2",
      "origin": [ "Task_1" ],
      "scope": "Process_1"
    }
  ]
*/

Note that origin and scope retrieves the full moddle element. The example outputs are reduced due to better readibility.

Note that camunda-bpmn-moddle or zeebe-bpmn-moddle descriptors have to be installed.

Properties support

Camunda Platform 7

We are currently extracting process variables from the following diagram properties

  • camunda:formField
  • camunda:outputParameter
  • camunda:out
  • camunda:resultVariable
  • camunda:errorCodeVariable
  • camunda:errorMessageVariable
  • camunda:escalationCodeVariable

Camunda Platform 8

We are currently extracting process variables from the following diagram properties

  • zeebe:input
  • zeebe:output
  • zeebe:loopCharacteristics > inputElement
  • zeebe:loopCharacteristics > outputCollection
  • zeebe:calledDecision > resultVariable
  • zeebe:script > resultVariable

See also

License

MIT

FAQs

Package last updated on 02 Jan 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc