refactor(workflow): roles as initiators; fix instance scope type

This commit is contained in:
Sarah Vaupel 2020-04-01 13:03:14 +02:00 committed by Gregor Kleen
parent b19c1b31b7
commit 50b3fb8dcf
2 changed files with 11 additions and 11 deletions

View File

@ -1,14 +1,14 @@
WorkflowDefinition WorkflowDefinition
graph WorkflowGraph graph WorkflowGraph
initiator WorkflowInitiator initiator (WorkflowRole UserId AuthDNF)
WorkflowInitiator WorkflowInitiator
-- TODO descriptor of a "role" that can initiate an instance of a workflow in a specified scope -- TODO descriptor of a "role" that can initiate an instance of a workflow in a specified scope
WorkflowInstance WorkflowInstance
definition WorkflowDefinition definition WorkflowDefinition
initiator UserId initiator (WorkflowRole UserId AuthDNF)
Flow Workflow
instance WorkflowInstance instance WorkflowInstance
initiator UserId

View File

@ -40,15 +40,15 @@ data WorkflowGraph = WG
deriving (Eq, Ord, Show, Read, Data, Generic, Typeable) deriving (Eq, Ord, Show, Read, Data, Generic, Typeable)
deriveJSON defaultOptions ''WorkflowGraph deriveJSON defaultOptions ''WorkflowGraph
data WorkflowInstanceScope term school course = WISGlobal
{- | WISTerm term
data WorkflowInstanceScope = WISGlobal | WISSchool school
| WISTerm TermId | WISCourse course
| WISSchool SchoolId
| WISCourse CourseId
deriving (Eq, Ord, Show, Read, Data, Generic, Typeable) deriving (Eq, Ord, Show, Read, Data, Generic, Typeable)
deriveJSON defaultOptions deriveJSON defaultOptions
{ constructorTagModifier = camelToPathPiece' 3 { constructorTagModifier = camelToPathPiece' 3
} ''WorkflowInstanceScope } ''WorkflowInstanceScope
-}
data WorkflowRole user authdnf = WorkflowRoleUser user
| WorkflowRoleAuthorized authdnf