A command line interface for bpmn-js. BPMN 2.0 modeling that just works!
JavaScript
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
docs docs(README): update commands + demo Aug 4, 2014
lib fix(commands/move): use Modeling#moveElements Oct 22, 2015
resources
test
.gitignore feat(plug-in): initial implementation Jul 31, 2014
.jshintrc test(project): replace jasmine with mocha Jul 16, 2015
.travis.yml chore(project): integrate travis Feb 19, 2015
.wiredeps
Gruntfile.js fix(Gruntfile): explicitly include brfs for tests Aug 8, 2014
LICENSE feat(plug-in): initial implementation Jul 31, 2014
README.md docs(README): add a line break Aug 10, 2015
index.js
package.json chore(project): release v0.15.0 Sep 6, 2016

README.md

bpmn-js-cli

Build Status

An extensible command line interface for bpmn-js.

Demo

The demo uses the following transcript:

cli.elements();
var gateway = cli.append('StartEvent_1', 'bpmn:ExclusiveGateway', '150,0');
var serviceTask = cli.append(gateway, 'bpmn:ServiceTask', '150,0');
var callActivity = cli.append(gateway, 'bpmn:CallActivity', '150,90');
cli.undo();
callActivity = cli.append(gateway, 'bpmn:CallActivity', '150,120');
var endEvent = cli.append(serviceTask, 'bpmn:EndEvent', '150, 0');
cli.connect(callActivity, endEvent, 'bpmn:SequenceFlow');
cli.setLabel(callActivity, 'CallActivity');
var gatewayShape = cli.element(gateway);
var textAnnotation = cli.create('bpmn:TextAnnotation', {
  x: gatewayShape.x - 50, y: gatewayShape.y + 150
}, gatewayShape.parent);
cli.setLabel(textAnnotation, 'i-am-text')
cli.setLabel(gateway, 'ExclusiveGateway');
cli.move(callActivity, {x: 20, y: 30});
cli.undo();
cli.undo();
cli.undo();
cli.redo();
cli.redo();
cli.redo();
cli.save('bpmn');

Features

  • Model BPMN 2.0 diagrams in the browser, without a mouse
  • Full undo and redo functionality
  • Extensible through your own commands
  • Numerous built-in commands:

    • append source type [deltaPos]
    • connect source target type
    • create type position parent
    • element id
    • elements
    • move shape delta [newParentId]
    • undo
    • redo
    • save svg|bpmn
    • setLabel element label
    • removeShape shape|elementId
    • removeConnection connection|connectionId

Quickstart

Get the list of available commands:

cli.help();

Get the list of shapes:

cli.shapes();

Export SVG or BPMN 2.0 xml

cli.save('svg' || 'bpmn');

Usage

Deploy the cli with bpmn-js:

var BpmnModeler = require('bpmn-js/lib/Modeler'),
    CliModule = require('bpmn-js-cli');

var modeler = new BpmnModeler({
  container: document.body,
  additionalModules: [ CliModule ],
  cli: { bindTo: 'cli' }
});

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

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

Use the cli to model BPMN 2.0 diagrams in your browser. Pain free.

License

MIT