bpmn-moddle 9.0.3 → 10.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE CHANGED
@@ -1,21 +1,21 @@
1
- The MIT License (MIT)
2
-
3
- Copyright (c) 2014 camunda Services GmbH
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in
13
- all copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2014 camunda Services GmbH
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
21
  THE SOFTWARE.
package/README.md CHANGED
@@ -1,72 +1,72 @@
1
- # bpmn-moddle
2
-
3
- [![CI](https://github.com/bpmn-io/bpmn-moddle/workflows/CI/badge.svg)](https://github.com/bpmn-io/bpmn-moddle/actions?query=workflow%3ACI)
4
-
5
- Read and write BPMN 2.0 diagram files in NodeJS and the browser.
6
-
7
- __bpmn-moddle__ uses the [BPMN 2.0 meta-model](http://www.omg.org/spec/BPMN/2.0/) to validate the input and produce correct BPMN 2.0 XML.
8
-
9
-
10
- ## Usage
11
-
12
- Get the library via [npm package](https://www.npmjs.org/package/bpmn-moddle). Consume it in NodeJS, via UMD or bundle it using your favorite build tool.
13
-
14
- ```javascript
15
- import BpmnModdle from 'bpmn-moddle';
16
-
17
- const moddle = new BpmnModdle();
18
-
19
- const xmlStr =
20
- '<?xml version="1.0" encoding="UTF-8"?>' +
21
- '<bpmn2:definitions xmlns:bpmn2="http://www.omg.org/spec/BPMN/20100524/MODEL" ' +
22
- 'id="empty-definitions" ' +
23
- 'targetNamespace="http://bpmn.io/schema/bpmn">' +
24
- '</bpmn2:definitions>';
25
-
26
-
27
- const {
28
- rootElement: definitions
29
- } = await moddle.fromXML(xmlStr);
30
-
31
- // update id attribute
32
- definitions.set('id', 'NEW ID');
33
-
34
- // add a root element
35
- const bpmnProcess = moddle.create('bpmn:Process', { id: 'MyProcess_1' });
36
- definitions.get('rootElements').push(bpmnProcess);
37
-
38
- // xmlStrUpdated contains new id and the added process
39
- const {
40
- xml: xmlStrUpdated
41
- } = await moddle.toXML(definitions);
42
- ```
43
-
44
-
45
- ## Resources
46
-
47
- * [Issues](https://github.com/bpmn-io/bpmn-moddle/issues)
48
- * [Examples](https://github.com/bpmn-io/bpmn-moddle/tree/master/test/spec/xml)
49
- * [Changelog](./CHANGELOG.md)
50
-
51
-
52
- ## Building the Project
53
-
54
- The tests include XSD schema validation. They required you to have a Java SDK installed and exposed through the `JAVA_HOME` variable.
55
-
56
- ```bash
57
- # execute the test
58
- npm test
59
-
60
- # perform a full build
61
- npm run all
62
- ```
63
-
64
-
65
- ## Related
66
-
67
- The library is built on top of [moddle](https://github.com/bpmn-io/moddle) and [moddle-xml](https://github.com/bpmn-io/moddle-xml).
68
-
69
-
70
- ## License
71
-
72
- Use under the terms of the [MIT license](http://opensource.org/licenses/MIT).
1
+ # bpmn-moddle
2
+
3
+ [![CI](https://github.com/bpmn-io/bpmn-moddle/workflows/CI/badge.svg)](https://github.com/bpmn-io/bpmn-moddle/actions?query=workflow%3ACI)
4
+
5
+ Read and write BPMN 2.0 diagram files in NodeJS and the browser.
6
+
7
+ __bpmn-moddle__ uses the [BPMN 2.0 meta-model](http://www.omg.org/spec/BPMN/2.0/) to validate the input and produce correct BPMN 2.0 XML.
8
+
9
+
10
+ ## Usage
11
+
12
+ Get the library via [npm package](https://www.npmjs.org/package/bpmn-moddle). Consume it in NodeJS or bundle it using your favorite build tool.
13
+
14
+ ```javascript
15
+ import { BpmnModdle } from 'bpmn-moddle';
16
+
17
+ const moddle = new BpmnModdle();
18
+
19
+ const xmlStr =
20
+ '<?xml version="1.0" encoding="UTF-8"?>' +
21
+ '<bpmn2:definitions xmlns:bpmn2="http://www.omg.org/spec/BPMN/20100524/MODEL" ' +
22
+ 'id="empty-definitions" ' +
23
+ 'targetNamespace="http://bpmn.io/schema/bpmn">' +
24
+ '</bpmn2:definitions>';
25
+
26
+
27
+ const {
28
+ rootElement: definitions
29
+ } = await moddle.fromXML(xmlStr);
30
+
31
+ // update id attribute
32
+ definitions.set('id', 'NEW ID');
33
+
34
+ // add a root element
35
+ const bpmnProcess = moddle.create('bpmn:Process', { id: 'MyProcess_1' });
36
+ definitions.get('rootElements').push(bpmnProcess);
37
+
38
+ // xmlStrUpdated contains new id and the added process
39
+ const {
40
+ xml: xmlStrUpdated
41
+ } = await moddle.toXML(definitions);
42
+ ```
43
+
44
+
45
+ ## Resources
46
+
47
+ * [Issues](https://github.com/bpmn-io/bpmn-moddle/issues)
48
+ * [Examples](https://github.com/bpmn-io/bpmn-moddle/tree/master/test/spec/xml)
49
+ * [Changelog](./CHANGELOG.md)
50
+
51
+
52
+ ## Building the Project
53
+
54
+ The tests include XSD schema validation. They required you to have a Java SDK installed and exposed through the `JAVA_HOME` variable.
55
+
56
+ ```bash
57
+ # execute the test
58
+ npm test
59
+
60
+ # perform a full build
61
+ npm run all
62
+ ```
63
+
64
+
65
+ ## Related
66
+
67
+ The library is built on top of [moddle](https://github.com/bpmn-io/moddle) and [moddle-xml](https://github.com/bpmn-io/moddle-xml).
68
+
69
+
70
+ ## License
71
+
72
+ Use under the terms of the [MIT license](http://opensource.org/licenses/MIT).