Details
-
Type:
Task
-
Status: Closed
-
Priority:
L3 - Default
-
Resolution: Won't Do
-
Affects Version/s: None
-
Fix Version/s: None
-
Component/s: frontend
-
Labels:None
-
Epic Link:
Description
The diagram store should handle two scenarios: fetching and storing diagrams and additional data for (a) single instance view and (b) instances view.
(a) The instanceId is needed to fetch workflowXML for single instance view. The instanceId is currently stored in currentInstance store after the workflowInstance is fetched.
(b) The workflowId is needed to fetch workflowXML for instances view. The workflowId depends on the filters, which are currently still managed by InstancesContainer. So the filters probably need a refactoring first, before we can work on the diagram store. Because we need easy access to the current workflowId.
Diagram store should
- fetch workflowXML
- handle loading states
- store diagram model
- store metadata, selectable flow nodes, etc.
- reset when diagram component is unmounted
Challenges
We need to have a clear understanding about the chain of reactions. For example:
- Navigate to single instance view
- get workflowInstanceId from URL
- set workflowInstanceId in currentInstance store
- in currentInstance store: fetch workflowInstance for workflowInstanceId
- render diagram component (when is it safe to render this? after fetching workflowInstance?)
- in diagram store: fetch workflowXML for workflowInstanceId
- when diagram component unmounts, reset diagram store
If this is too confusing or if I'm wrong, please talk to me.