1 | # bpmn-js - BPMN 2.0 for the web
|
2 |
|
3 | [![Build Status](https://travis-ci.org/bpmn-io/bpmn-js.svg?branch=develop)](https://travis-ci.org/bpmn-io/bpmn-js)
|
4 |
|
5 | View and edit BPMN 2.0 diagrams in the browser.
|
6 |
|
7 | [![bpmn-js screencast](./resources/screencast.gif "bpmn-js in action")](http://demo.bpmn.io/s/start)
|
8 |
|
9 |
|
10 | ## Installation
|
11 |
|
12 | Use the library [pre-packaged](https://github.com/bpmn-io/bpmn-js-examples/tree/master/pre-packaged)
|
13 | or include it [via npm](https://github.com/bpmn-io/bpmn-js-examples/tree/master/bundling)
|
14 | into your node-style web-application.
|
15 |
|
16 | ## Usage
|
17 |
|
18 | To get started, create a [bpmn-js](https://github.com/bpmn-io/bpmn-js) instance
|
19 | and render [BPMN 2.0 diagrams](https://www.omg.org/spec/BPMN/2.0.2/) in the browser:
|
20 |
|
21 | ```javascript
|
22 | var xml; // my BPMN 2.0 xml
|
23 | var viewer = new BpmnJS({
|
24 | container: 'body'
|
25 | });
|
26 |
|
27 | viewer.importXML(xml, function(err) {
|
28 |
|
29 | if (err) {
|
30 | console.log('error rendering', err);
|
31 | } else {
|
32 | console.log('rendered');
|
33 | }
|
34 | });
|
35 | ```
|
36 |
|
37 | Checkout our [examples](https://github.com/bpmn-io/bpmn-js-examples) for many
|
38 | more supported usage scenarios.
|
39 |
|
40 |
|
41 | ### Dynamic Attach/Detach
|
42 |
|
43 | You may attach or detach the viewer dynamically to any element on the page, too:
|
44 |
|
45 | ```javascript
|
46 | var viewer = new BpmnJS();
|
47 |
|
48 | // attach it to some element
|
49 | viewer.attachTo('#container');
|
50 |
|
51 | // detach the panel
|
52 | viewer.detach();
|
53 | ```
|
54 |
|
55 |
|
56 | ## Resources
|
57 |
|
58 | * [Demo](http://demo.bpmn.io)
|
59 | * [Issues](https://github.com/bpmn-io/bpmn-js/issues)
|
60 | * [Examples](https://github.com/bpmn-io/bpmn-js-examples)
|
61 | * [Forum](https://forum.bpmn.io)
|
62 | * [Changelog](./CHANGELOG.md)
|
63 |
|
64 |
|
65 | ## Building the Project
|
66 |
|
67 | Perform the following steps to build the library, including running all tests:
|
68 |
|
69 | ```
|
70 | cd bpmn-js
|
71 | npm install
|
72 | npm run all
|
73 | ```
|
74 |
|
75 | You may need to perform [additional project setup](./docs/project/SETUP.md) when
|
76 | building the latest development snapshot.
|
77 |
|
78 | Please checkout our [contributing guidelines](./.github/CONTRIBUTING.md) if you plan to
|
79 | file an issue or pull request.
|
80 |
|
81 |
|
82 | ## Related
|
83 |
|
84 | bpmn-js builds on top of a few powerful tools:
|
85 |
|
86 | * [bpmn-moddle](https://github.com/bpmn-io/bpmn-moddle): Read / write support for BPMN 2.0 XML in the browsers
|
87 | * [diagram-js](https://github.com/bpmn-io/diagram-js): Diagram rendering and editing toolkit
|
88 |
|
89 |
|
90 | ## License
|
91 |
|
92 | Use under the terms of the [bpmn.io license](http://bpmn.io/license).
|