camunda / camunda-modeler

An integrated modeling solution for BPMN, DMN and Forms based on bpmn.io.
https://camunda.com/products/modeler
MIT License
1.49k stars 479 forks source link

Open new tab with BPMN XML file Content within a Plugin #3893

Open HKhanBHS opened 1 year ago

HKhanBHS commented 1 year ago

Problem you would like to solve

I am replicating the Autosave Plugin, as described here, Use Case: Instead of Auto saving the files. The user will open the list of files from a certain BPMN project in this plugin, and its BPMN XML files will be listed there in overlay of the plugin. Now the files are already accessible using ‘window.showDirectoryPicker()’ but if the user clicks on any BPMN XML files inside the plugin where it is listed . It should be opened in a new tab of Camunda Modeler. And the diagram of the respective BPMN file should be displayed in a new tab. I tried triggerAction already mentioned in Autosave plugin but it has no such feature of opening xml files directly instead it has feature of open diagram, save xml, or create bpmn diagram.

Proposed solution

The solution to such an implementation would be adding additional feature to 'triggerAction' of handling the file content within a plugin for example (xml BPMN, DMN or others), and render the content in the new tab of the camunda modeler, if the user clicks on the file within a plugin.

Alternatives considered

Alternative solution to such implementation would be to have access to new tab in Camunda modeler in the plugin and developers can render diagram directly in it.

Additional context

No response

nikku commented 1 year ago

@HKhanBHS If I understand you you want to introduce a new tab, and allow users to open diagrams inside that new tab? Or would you like to open an existing diagram, but in the XML view?

HKhanBHS commented 1 year ago

The user will open existing diagrams. For example. The user opens project folder consisting of many BPMN/DMN files. Now the user wants to open some of the files of the folder by just clicking on the files, and by clicking the files should open in a new tab of the camunda modeler. So, technically, I want to introduce new tab along with the diagram rendered inside it from the plugin.

Please find a screenshot of the plugin, where files are navigated and clickable inside the plugin. These files are BPMN files, and it should be opened in a new tab if user clicks on it.

Basic functionality require is the diagram rendering, but if XML view can be added then it will be plus.

Capture

barmac commented 11 months ago

If I understand the issue correctly, the missing API is an action to open a specific file or optionally a new file with given contents. Currently, the only actions related to opening files are "create-*" and "open file picker". I think this is a valid feature request.