bpmn-io / dmn-js

View and edit DMN diagrams in the browser.
https://bpmn.io/toolkit/dmn-js/
Other
294 stars 136 forks source link

Ease refactoring by supporting copy-paste into different tables (and different models) #384

Open dschulten opened 5 years ago

dschulten commented 5 years ago

Is your feature request related to a problem? Please describe. I want to factor out data from one decision table into another table, preferably into another model.

My immediate motivation: tenant-specific decision models depend on a decision which is the same for all tenants. I want to factor out the common decision. The common decision model could then be imported by the tenant-specific decisions according to DMN (dmn:import is part of DMN 1.1, the DMN 1.2 examples even contain such an import)

I cannot copy a decision table and paste it elsewhere, neither into the same model nor into a different model. I tried in the DRD and in the table itself.

Also I can copy/paste a column or row in the same table, but I cannot paste it into a different table, neither within the same model nor a different model.

Describe the solution you'd like

Copy/paste of decision tables and rows/columns within the same model and between separate models:

If I Ctrl-C on a decision in the DRD, Ctrl-V should create a new decision with the same content in the same or another model. If I click copy on a row or column in a decision table and go to a different table in the same or another model, right-click on a column or row header should allow me to paste.

In short:

Describe alternatives you've considered

I can copy the entire model and start refactoring from there if I want to factor out into a separate model, but I must assign all new ids in xml. For refactoring within the same model, I have to go into xml where I can copy and come up with many new internal ids for all the cell contents.

Instead of dmn:importing the model which contains the common decision on which subsequent decisions depend, I can model two business rule tasks in bpmn, let the first add data to the process and then let the second build upon that data.

Additional context

The idea to factor out common decisions into separate models would also require the decision engine to support the dmn:import element (will check that), and - while I would be happy if tenant-specific models could just import another model regardless of the current tenant - the question might arise if the import needs to be made tenant-aware, e.g. by means of a camunda extension.

nikku commented 5 years ago

Thanks for filing this issue and laying out the rationale.

I guess supporting copy and paste between tables and/or of entire decision nodes is a valuable feature without integrating with dmn:import.

Would you like to copy/paste between entirely different diagrams, too? That would be a feature to be provided by applications integrating the toolkit (i.e. the Camunda Modeler).

dschulten commented 5 years ago

Yes, that is what I meant by "another model". Copy in file1.dmn, paste in file2.dmn.