bpmn-visualization-js icon indicating copy to clipboard operation
bpmn-visualization-js copied to clipboard

[REFACTOR] Keep the loaded BpmnModel into memory

Open tbouffard opened this issue 4 years ago • 0 comments

Current situation For #929, we need to get BPMN information: currently we used data from the mxgraph model, which implies parsing and make us very adherent to the rendering lib, whereas we may have to remove mxgraph (see #917) We need search capabilities on top of the diagram, at least for #927 and #942: for now, at least by id and by bpmn kind (shape or edge).

In version 0.9.0 and earlier, the model is created on BPMN diagram load and only used for the rendering. Once this is done, we drop it and so it is not possible to use it afterwards. We also have a DisplayedModel which is a view of the part of the diagram that is actually rendered. This DisplayedModel is ephemeral. As of 0.12.2, we have a RenderedModel that is partially stored in memory as SearchableModel for elements search. See #1115

Proposal overview Keep the BpmnModel into memory and add it search capabilities, directly or to an implementation allowing to search it. Then uses it as replacement of mxGraph for BPMN info retrieval and of some CSS selectors.

Keeping the BpmnModel into memory would provide other opportunities:

  • apply rendering options without having to reload the diagram: ignore label styles (#2468), ignore activity label bounds of tasks (in poc #869, we had to reload the diagram when ignoring label settings, see also #2469), change L&F
  • switch from to another diagram (see #729) or pool (see #592)
  • will also help to add overlays (see #955 or #429) on top of the diagram
  • provide a way to style BPMN traces/paths (see #930)

Implementation proposals TO be discussed

tbouffard avatar Dec 15 '20 13:12 tbouffard