Skip to content

Commit

Permalink
Fix #1
Browse files Browse the repository at this point in the history
  • Loading branch information
Asvin Goel committed Jan 19, 2024
1 parent 13080b5 commit 5e3ff16
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 2 deletions.
19 changes: 19 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,25 @@ const modeler = new BpmnModeler({
});
```

To also copy custom model extensions, you need to provide the respective `moddleExtensions`:

```javascript
import BpmnModeler from 'bpmn-js/lib/Modeler';

import SubProcessImporterModule from 'bpmn-js-subprocess-importer';

var myModdleExtensions = { /* add your moddle extensions here */ };

const modeler = new BpmnModeler({
additionalModules: [
SubProcessImporterModule
],
moddleExtensions: myModdleExtensions
});
```
modeler.get('subProcessImporter').setModdleExtensions(myModdleExtensions);


## License

MIT licensed
Expand Down
5 changes: 4 additions & 1 deletion SubProcessImporter.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,13 @@ export default class SubProcessImporter {
constructor(popupMenu, bpmnReplace, bpmnjs) {
popupMenu.registerProvider("bpmn-replace", this);
this.bpmnjs = bpmnjs;
// TODO: this should be provided as module parameter or automatically determined from bpmnjs
this.moddleExtensions = {};
}

setModdleExtensions(moddleExtensions) {
this.moddleExtensions = moddleExtensions;
}

getPopupMenuEntries(element) {
if ( is(element, 'bpmn:SubProcess') && !isExpanded(element) && !hasChildren(element) ) {
return{
Expand Down
6 changes: 5 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "bpmn-js-subprocess-importer",
"description": "A bpmn-js module allowing to populate the subprocesses with contents loaded from external BPMN model files",
"version": "0.1.0",
"version": "0.2.0",
"keywords": [
"bpmn-js",
"bpmn"
Expand All @@ -11,6 +11,10 @@
"url": "https://github.com/bpmn-os"
},
"license": "MIT",
"repository": {
"type": "git",
"url": "https://github.com/bpmn-os/bpmn-js-subprocess-importer"
},
"dependencies": {},
"devDependencies": {}
}

0 comments on commit 5e3ff16

Please sign in to comment.