Skip to content
A modeling DSL for bpmn-js
JavaScript
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
lib chore(project): simplify dependencies Dec 12, 2018
resources
test
.eslintrc
.gitignore
.npmignore
.travis.yml
CHANGELOG.md
LICENSE
README.md docs(README): syntax highlight code snippets Dec 12, 2018
index.js chore(project): migrate to ES modules Dec 12, 2018
karma.conf.js
package-lock.json
package.json

README.md

As of version 1.0.0 this library exposes ES modules. Use an ES module aware bundler such as Webpack or Rollup to bundle it for the browser.

bpmn-js-cli-modeling-dsl

Build Status

A modeling DSL (domain specific language) for bpmn-js, built on top of bpmn-js-cli.

Usage

Use the extension for bpmn-js-cli to quickly model simple processes.

To model this process:

example BPMN diagram

simply execute the following command

cli.model('StartEvent_1 -> and -> service -> user -> icatch -> xor -> or -> ithrow -> end');

You may use the full classified name of any BPMN element such as bpmn:ServiceTask, too to model it.

Shortcuts

A number of aliases are registered for most commonly modeled BPMN elements:

var aliases = {
  service:     'bpmn:ServiceTask',
  user:        'bpmn:UserTask',
  manual:      'bpmn:ManualTask',
  task:        'bpmn:Task',
  end:         'bpmn:EndEvent',
  transaction: 'bpmn:Transaction',
  sub:         'bpmn:SubProcess',
  call:        'bpmn:CallActivity',
  icatch:      'bpmn:IntermediateCatchEvent',
  ithrow:      'bpmn:IntermediateThrowEvent',
  xor:         'bpmn:ExclusiveGateway',
  or:          'bpmn:InclusiveGateway',
  and:         'bpmn:ParallelGateway'
};

Use any of the aliases instead of the full qualified BPMN name.

Setup

Deploy the cli-extension with bpmn-js:

import BpmnModeler from 'bpmn-js/lib/Modeler';
import ModelingDslModule from 'bpmn-js-cli-modeling-dsl';

var modeler = new BpmnModeler({
  additionalModules: [
    ModelingDslModule
  ],
  cli: {
    bindTo: 'cli'
  }
});

modeler.importXML('some-bpmn-xml');

Access the cli as cli in your developer console (open via F12 in most browsers).

Create a simple process from <start> via

cli.model('<start> -> and -> service -> user -> icatch -> xor -> or -> ithrow -> end');

License

MIT

You can’t perform that action at this time.