Following scenario:
- Goto Cockpit Process Definition View
- Diagram is loaded, parsed and displayed
- Select an instance
- Diagram is loaded, parsed and displayed again
This unnecessary loading occurs when switching between definition and instance view as well as when switching between runtime and history view. We should cache the loaded diagram so that we do not need to load it again.
Ideally, we can also cache the bpmn-js viewer instance of the parsed diagram to speed it up even more. We might get a problem with view-specific overlays then, though.