Copy element to other model

Is there any working example where I can copy model to clipboard and paste it to other model?

I think of this: GitHub - nikku/bpmn-js-copy-paste-example: An example how to copy and paste between multiple instances of bpmn-js

@Milan_Sakic What is your context? Do you copy within the same browser window? Across browser windows? Across applications?

I believe GitHub - nikku/bpmn-js-copy-paste-example: An example how to copy and paste between multiple instances of bpmn-js needs a refresh to work with current versions of bpmn-js, cf. copy&paste feature stops working in version 5.0 onwards · Issue #2 · nikku/bpmn-js-copy-paste-example · GitHub.

@nikku I would like to make it work within same browser window?

Making it work within the same browser window is supported out of the box, cf. bpmn-js#97e1ad14.

The trick is to share a clipboard module across multiple bpmn-js instances like so:

var clipboardModule = {
  'clipboard': [ 'value', new Clipboard() ]
};

m2 = new Modeler({
  additionalModules: [
    clipboardModule
  ]
});

m1 = new Modeler({
  additionalModules: [
    clipboardModule
  ]
});

@nikku Thanks for answer, but I still can’t implement it. Could you please provide any sandbox example?

Please share any concrete issues you have and I am happy to help.

I want to use this trick to copy element to other model, it works, but it will paste on all the models. So how to stop paste in not-active tab model?

Please do not necrobump old topics. Instead link to this thread from new topic.