diff --git a/src/Model/Types/Workflow.hs b/src/Model/Types/Workflow.hs index 49fe82f81..aa1852773 100644 --- a/src/Model/Types/Workflow.hs +++ b/src/Model/Types/Workflow.hs @@ -15,12 +15,12 @@ data WorkflowGraphNodeStatus = WGNS } deriving (Eq, Ord, Show, Read, Data, Generic, Typeable) -deriveJSON defaultOptions ''WorkflowGraphNodeStatus - data WorkflowGraphNode userid authdnf fileid = WGN - { wgnStatus :: WorkflowGraphNodeStatus - , wgnOutgoing :: Set (WorkflowGraphEdge userid authdnf fileid) - } + { wgnStatus :: WorkflowGraphNodeStatus + , wgnOutgoing :: Set (WorkflowGraphEdge userid authdnf fileid) + } + +type WorkflowGraphNodeLabel = CI Text data WorkflowEdgePayload userid fileid (payload :: *) where @@ -67,14 +67,13 @@ data WorkflowPayload userid fileid = forall payload. Map WorkflowEdgePayloadLabe data WorkflowGraphEdge userid authdnf fileid = WGE { wgeActors :: Set (WorkflowRole userid authdnf) - , wgeTarget :: WorkflowGraphNode userid authdnf fileid + , wgeTarget :: WorkflowGraphNodeLabel , wgeForm :: Map WorkflowEdgePayloadLabel (NonNull (Set (WorkflowEdgePayloadSpecification fileid userid))) } -data WorkflowGraph userid authdnf fileid = WG - { wgNodes :: Set (WorkflowGraphNode userid authdnf fileid) - , wgEdges :: Set (WorkflowGraphEdge userid authdnf fileid) +data WorkflowGraph userid authdnf fileid = WorkflowGraph + { wgNodes :: Map WorkflowGraphNodeLabel (WorkflowGraphNode userid authdnf fileid, Set (WorkflowGraphEdge userid authdnf fileid)) } @@ -84,3 +83,6 @@ data WorkflowInstanceScope term school course = WISGlobal | WISTerm term | WISSc data WorkflowInstanceScope' = WISGlobal' | WISTerm' | WISSchool' | WISCourse' deriving (Eq, Ord, Enum, Read, Show, Data, Generic, Typeable) + + +deriveJSON defaultOptions ''WorkflowGraphNodeStatus