Skip to content

Commit d412c26

Browse files
ChrisSchoeNiklas Kiefer
authored andcommitted
chore(README): update to reflect changes in new bpmn-moddle version
Closes #10 Signed-off-by: Christoph Schoennenbeck <christoph.schoennenbeck@viadee.de>
1 parent 2acb3bf commit d412c26

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,21 @@ loadModels(aXML, bXML, function(err, aDefinitions, bDefinitions) {
8787
// go ahead and use the models
8888
});
8989
```
90+
NB: Diagram loading has changed as of version 7.0.0 of bpmn-moddle. The method `fromXML` now returns a promise and no longer uses the callback structure.
91+
Thus, you can do the following to load a diagram that can then be supplied to `diff` as one of its argument:
9092

93+
```javascript
94+
import BpmnModdle from 'bpmn-moddle';
95+
96+
async function loadModel(diagramXML){
97+
try {
98+
var loadedResult = await new BpmnModdle().fromXML(diagramXML);
99+
return loadedResult.rootElement;
100+
} catch(err){
101+
console.log('something went wrong!');
102+
}
103+
}
104+
```
91105

92106
## Visual Diffing
93107

0 commit comments

Comments
 (0)