Async utilities properly propagate _all_ errors to the
specified _done_ callback. Failing in _done_ does not
re-invoke it.
Adjustments made in
* Viewer#importXML
* Viewer#saveSVG
* Importer#importBpmnDiagram
Tests cleaned up to remove un-necessary `if (err) { ...` snippets.
This improves the import and export of BPMN 2.0 XML documents
+ improves di prefix collision handling
+ proper deconflicting of prefixes during export
+ validate and detect non-BPMN root elements
+ replace underlying XML parser for higher speed and smaller
bundle size
+ pass parse warnings with errors
NOTE:
* some error messages on broken XML may have changed
due to changes in the underlying XML parser
Closes#655
BREAKING CHANGE:
* Viewer / Modeler do not attach to `body` anymore per
default. Use `new Viewer({ container: 'body' })` to
restore the old behavior.
This commit adds more life-cycle events users can
plug into during xml parsing and rendering:
* import.parse.start
* import.parse.complete
* import.render.start
* import.render.complete
* import.done
Some other events had to go because of that, namely
* import.start
* import.(success|error)
BREAKING CHANGE:
* the event import.start got renamed to import.render.start
* the events import.success and import.error got removed
in favour of import.render.complete (passing err, warnings)
* simplifies event handling
* relies on Diagram#clear to reset the diagram before
successive imports
* allows diagram services to be re-used across imports
* allows diagram services to be injected (or retrieved)
before import
Closes#237
This may have unwanted side-effects, i.e. when using id
validation and caching.
We must ensure the meta-model element is actually instance stateless in
order to safely cache it.
This commit replaces the test helper #bootstrapBpmnJS with either
This ensures we can have different Modeler/Viewer specific bootstrap
code being called based on whether we test modeling or viewing only
features.
This enables users to instantiate Viewers/Modelers via
```
new Viewer({
additionalModules: [ ... ]
});
```
to bootstrap their own modules with the viewer without overriding the
existing ones.
This commit cleans up reminders of the node-js test suite removal
by removing the test/node folder.
The test structure has been aligned by moving all tests from
* test/spec/browser to test/spec
* test/spec/integration to test/integration