Commit b57c94f8 authored by Rinus Plasmeijer's avatar Rinus Plasmeijer

*** empty log message ***


git-svn-id: https://svn.cs.ru.nl/repos/iTask-system/trunk@164 63da3aa8-80fd-4f01-9db8-e6ea747a3da2
parent f1a9cddc
......@@ -20,15 +20,14 @@ derive write Wid
:: Wid a // reference to a workflow process
:: WorkflowStatus = WflActive // iTask workflow process is still being processed
| WflSuspended // it is (temporally) suspended
:: WorkflowStatus = WflActive UserId // iTask workflow process is still being processed by indicated user
| WflSuspended UserId // it is assigned to indicated user but it is (temporally) suspended
| WflFinished // it is finshed
| WflDeleted // it does not exist anymore because it is deleted
instance == WorkflowStatus
/* iTask Workflow process management:
spawnWorkflow :: spawn an iTask workflow as a new separate process, Wid is a handle to that process, bool indicates whether it is active or suspended
waitForWorkflow :: wait until the indicated process is finished and obtain the resulting value; returns Nothing when process is deleted
getWorkflowStatus :: get status of workflow
......
......@@ -28,8 +28,8 @@ derive write Wid, WorkflowStatus
instance == WorkflowStatus
where
(==) WflActive WflActive = True
(==) WflSuspended WflSuspended = True
(==) (WflActive _) (WflActive _) = True
(==) (WflSuspended _) (WflSuspended _)= True
(==) WflFinished WflFinished = True
(==) WflDeleted WflDeleted = True
(==) _ _ = False
......@@ -171,6 +171,8 @@ where
# (wfls,tst) = workflowProcessStore (\_ -> (maxid,nwfls)) tst // update workflow process administration
= (True,tst) // if everything is fine it should always succeed
waitForWorkflow :: !(Wid a) -> Task (Maybe a) | iData a
waitForWorkflow (Wid (entry,ids=:(_,_,label))) = newTask ("waiting for " +++ label) waitForResult`
where
......@@ -264,8 +266,8 @@ where
# refok = isValidWorkflowReference wfl ids
| not refok = (WflDeleted,tst) // wid does not refer to the correct entry anymore
# status = case wfl of
(ActiveWorkflow _ _) -> WflActive
(SuspendedWorkflow _ _) -> WflSuspended
(ActiveWorkflow (user,_,_) _) -> WflActive user
(SuspendedWorkflow (user,_,_) _) -> WflSuspended user
(FinishedWorkflow _ _ _) -> WflFinished
(DeletedWorkflow _) -> WflDeleted
= (status,tst) // if everything is fine it should always succeed
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment