Commit be7d443f authored by Rinus Plasmeijer's avatar Rinus Plasmeijer

*** empty log message ***


git-svn-id: https://svn.cs.ru.nl/repos/iTask-system/trunk@139 63da3aa8-80fd-4f01-9db8-e6ea747a3da2
parent 4a18f002
...@@ -20,8 +20,10 @@ derive write Void, Wid, TCl ...@@ -20,8 +20,10 @@ derive write Void, Wid, TCl
// iTask types // iTask types
:: Task a :== *TSt -> *(!a,!*TSt) // an iTask is state stransition :: Task a :== *TSt -> *(!a,!*TSt) // an iTask is state stransition
:: *TSt // TSt is abstract task state
:: LabeledTask a :== !(!TaskLabel,!Task a) // a Task with a label used for labeling buttons, pull down menu, and the like :: LabeledTask a :== !(!TaskLabel,!Task a) // a Task with a label used for labeling buttons, pull down menu, and the like
:: TCl a = TCl !.(Task a) // task closure, container for a task used for higher order tasks (task which deliver a task)
:: *TSt // TSt is abstract task state
:: TaskLabel :== !String // label name :: TaskLabel :== !String // label name
:: UserId :== !Int // a user id of an iTask user must be a unique integer value :: UserId :== !Int // a user id of an iTask user must be a unique integer value
...@@ -35,7 +37,7 @@ derive write Void, Wid, TCl ...@@ -35,7 +37,7 @@ derive write Void, Wid, TCl
// general types // general types
:: HtmlCode :== [BodyTag] // most programmers will only write bodytags :: HtmlCode :== ![BodyTag] // most programmers will only write bodytags
:: Void = Void // for tasks returning non interesting results, won't show up in editors either :: Void = Void // for tasks returning non interesting results, won't show up in editors either
...@@ -201,7 +203,6 @@ closureTask :: The task is executed as usual, but a receiver closure is returne ...@@ -201,7 +203,6 @@ closureTask :: The task is executed as usual, but a receiver closure is returne
Handy for passing a result to several interested parties. Handy for passing a result to several interested parties.
closureLZTask :: Same, but now the original task will not be done unless someone is asking for the result somewhere. closureLZTask :: Same, but now the original task will not be done unless someone is asking for the result somewhere.
*/ */
:: TCl a = TCl .(Task a)
(-!>) infix 4 :: (Task stop) (Task a) -> Task (Maybe stop,TCl a) | iCreateAndPrint stop & iCreateAndPrint a (-!>) infix 4 :: (Task stop) (Task a) -> Task (Maybe stop,TCl a) | iCreateAndPrint stop & iCreateAndPrint a
channel :: String (Task a) -> Task (TCl a,TCl a) | iCreateAndPrint a channel :: String (Task a) -> Task (TCl a,TCl a) | iCreateAndPrint a
......
...@@ -81,10 +81,10 @@ derive write Void, Options, Lifespan, Mode, StorageFormat, GarbageCollect, Glob ...@@ -81,10 +81,10 @@ derive write Void, Options, Lifespan, Mode, StorageFormat, GarbageCollect, Glob
, testModeOn :: !Bool , testModeOn :: !Bool
} }
:: Wid a = Wid WorkflowName // id of workflow process :: Wid a = Wid WorkflowName // id of workflow process
:: WorflowProcess = ActiveWorkflow !WorkflowLabel !(TCl Dynamic) :: WorflowProcess = ActiveWorkflow !(!UserId,!WorkflowLabel) !(TCl Dynamic)
| SuspendedWorkflow !WorkflowLabel !(TCl Dynamic) | SuspendedWorkflow !(!UserId,!WorkflowLabel) !(TCl Dynamic)
| FinishedWorkflow !WorkflowLabel !Dynamic !(TCl Dynamic) | FinishedWorkflow !(!UserId,!WorkflowLabel) !Dynamic !(TCl Dynamic)
| DeletedWorkflow !WorkflowLabel | DeletedWorkflow !(!UserId,!WorkflowLabel)
// Initial values // Initial values
...@@ -335,8 +335,8 @@ startTstTask thisUser multiuser (userchanged,multiuserform) {traceOn, threadStor ...@@ -335,8 +335,8 @@ startTstTask thisUser multiuser (userchanged,multiuserform) {traceOn, threadStor
iTaskInfo ++ iTaskInfo ++
if (doTrace && traceOn) if (doTrace && traceOn)
iTaskTraceInfo iTaskTraceInfo
[ [[BodyTag taskname, Br] <||> mainbuts] <=> [ leftright taskname subbuts,Hr []
[BodyTag subbuts,Br,Br, BodyTag seltask] , mainbuts <=> seltask
] ]
)] )]
] ]
...@@ -355,6 +355,11 @@ where ...@@ -355,6 +355,11 @@ where
// # world = if testModeOn deleteAllStateFiles id world // # world = if testModeOn deleteAllStateFiles id world
// = (Void,{hst & world = world}) // = (Void,{hst & world = world})
leftright left right
= Table [Tbl_Width (Percent 100)]
[Tr [] [ Td [] left
, Td [Td_Align Aln_Right] right]
]
nilTable tst = ([],tst) nilTable tst = ([],tst)
...@@ -401,7 +406,7 @@ where ...@@ -401,7 +406,7 @@ where
# (subtasksnames,tcode) = unzipsubtasks (subtasks!!mainSelected) # (subtasksnames,tcode) = unzipsubtasks (subtasks!!mainSelected)
# ((taskSelected,subButtons,chosenTask),hst) = mkTaskButtons False ("User " <+++ thisUser <+++ "subtask" <+++ mainSelected) # ((taskSelected,subButtons,chosenTask),hst) = mkTaskButtons False ("User " <+++ thisUser <+++ "subtask" <+++ mainSelected)
thisUser [] initialOptions subtasksnames hst thisUser [] initialOptions subtasksnames hst
# subButtons = if (length subButtons > 1) subButtons [] # subButtons = if (length subtasksnames > 1) subButtons []
= (threadcode,[showMainLabel chosenMain, showTrace " / ", showLabel chosenTask],mainButtons,subButtons,tcode!!taskSelected,hst) = (threadcode,[showMainLabel chosenMain, showTrace " / ", showLabel chosenTask],mainButtons,subButtons,tcode!!taskSelected,hst)
where where
unziptasks [] = ([],[]) unziptasks [] = ([],[])
...@@ -659,12 +664,12 @@ where ...@@ -659,12 +664,12 @@ where
# (wfls,hst) = workflowProcessStore id hst // read workflow process administration # (wfls,hst) = workflowProcessStore id hst // read workflow process administration
# processid = length wfls + 1 // process id currently given by length list, used as offset in list # processid = length wfls + 1 // process id currently given by length list, used as offset in list
# wfl = mkdyntask options processid task // convert user task in a dynamic task # wfl = mkdyntask options processid task // convert user task in a dynamic task
# nwfls = wfls ++ [if active ActiveWorkflow SuspendedWorkflow label wfl] // turn task into a dynamic task # nwfls = wfls ++ [if active ActiveWorkflow SuspendedWorkflow (userid,label) wfl] // turn task into a dynamic task
# (wfls,hst) = workflowProcessStore (\_ -> nwfls) hst // write workflow process administration # (wfls,hst) = workflowProcessStore (\_ -> nwfls) hst // write workflow process administration
= (Wid (processid,label),{tst & hst = hst, activated = True}) = (Wid (processid,label),{tst & hst = hst, activated = True})
mkdyntask options processid task = TCl (\tst -> convertTask processid label task mkdyntask options processid task = TCl (\tst -> convertTask processid label task
{tst & tasknr = [processid - 1],activated = True,options = options,workflowName = (processid,label)}) {tst & tasknr = [processid - 1],activated = active,userId = userid, options = options,workflowName = (processid,label)})
convertTask processid label task tst convertTask processid label task tst
# (a,tst=:{hst,activated}) = newTask label (assignTaskTo False userid ("main",task)) tst//newTask label task tst # (a,tst=:{hst,activated}) = newTask label (assignTaskTo False userid ("main",task)) tst//newTask label task tst
...@@ -672,7 +677,7 @@ where ...@@ -672,7 +677,7 @@ where
| not activated = (dyn,tst) // not finished, return | not activated = (dyn,tst) // not finished, return
# (wfls,hst) = workflowProcessStore id hst // read workflow process administration # (wfls,hst) = workflowProcessStore id hst // read workflow process administration
# wfls = case (wfls!!(processid - 1)) of // update process administration # wfls = case (wfls!!(processid - 1)) of // update process administration
(ActiveWorkflow _ entry) -> updateAt (processid - 1) (FinishedWorkflow label dyn entry) wfls (ActiveWorkflow _ entry) -> updateAt (processid - 1) (FinishedWorkflow (userid,label) dyn entry) wfls
_ -> wfls _ -> wfls
# (wfls,hst) = workflowProcessStore (\_ -> wfls) hst // write workflow process administration # (wfls,hst) = workflowProcessStore (\_ -> wfls) hst // write workflow process administration
= (dyn,{tst & hst = hst}) = (dyn,{tst & hst = hst})
...@@ -692,7 +697,7 @@ deleteWorkflow (Wid (processid,label)) = newTask ("delete " +++ label) deleteWor ...@@ -692,7 +697,7 @@ deleteWorkflow (Wid (processid,label)) = newTask ("delete " +++ label) deleteWor
where where
deleteWorkflow` tst=:{hst} deleteWorkflow` tst=:{hst}
# (wfls,hst) = workflowProcessStore id hst // read workflow process administration # (wfls,hst) = workflowProcessStore id hst // read workflow process administration
# nwfls = updateAt (processid - 1) (DeletedWorkflow label) wfls // delete entry in table # nwfls = updateAt (processid - 1) (DeletedWorkflow (-1,label)) wfls // delete entry in table
# (wfls,hst) = workflowProcessStore (\_ -> nwfls) hst // update workflow process administration # (wfls,hst) = workflowProcessStore (\_ -> nwfls) hst // update workflow process administration
# tst = deleteSubTasksAndThreads [processid] {tst & hst = hst} // delete all iTask storage of this process ... # tst = deleteSubTasksAndThreads [processid] {tst & hst = hst} // delete all iTask storage of this process ...
= (True,{tst & activated = True}) // if everything is fine it should always succeed = (True,{tst & activated = True}) // if everything is fine it should always succeed
...@@ -744,17 +749,17 @@ showWorkflows alldone hst ...@@ -744,17 +749,17 @@ showWorkflows alldone hst
where where
mkTable [] = [] mkTable [] = []
mkTable wfls = [showLabel ("Workflow Process Table:"), mkTable wfls = [showLabel ("Workflow Process Table:"),
STable [] ( [ [showTrace "Id:", showTrace "Name:", showTrace "Status:"] STable [] ( [ [showTrace "Workflow Id:", showTrace "User Id:", showTrace "Task Name:", showTrace "Status:"]
, [Txt "0" , Txt defaultWorkflowName, if alldone (Txt "Finished") (Txt "Active")] , [Txt "0" , Txt "0", Txt defaultWorkflowName, if alldone (Txt "Finished") (Txt "Active")]
: [[Txt (toString i)] ++ showStatus wfl \\ wfl <- wfls & i <- [1..]] : [[Txt (toString i)] ++ showStatus wfl \\ wfl <- wfls & i <- [1..]]
] ]
), ),
Hr [] Hr []
] ]
showStatus (ActiveWorkflow label dyntask) = [Txt label, Txt "Active"] showStatus (ActiveWorkflow (userid,label) dyntask) = [Txt (toString userid), Txt label, Txt "Active"]
showStatus (SuspendedWorkflow label dyntask) = [Txt label, Txt "Suspended"] showStatus (SuspendedWorkflow (userid,label) dyntask) = [Txt (toString userid), Txt label, Txt "Suspended"]
showStatus (FinishedWorkflow label dyn dyntask) = [Txt label, Txt "Finished"] showStatus (FinishedWorkflow (userid,label) dyn dyntask) = [Txt (toString userid), Txt label, Txt "Finished"]
showStatus (DeletedWorkflow label) = [Txt label, Txt "Deleted"] showStatus (DeletedWorkflow (userid,label)) = [Txt (toString userid), Txt label, Txt "Deleted"]
// ****************************************************************************************************** // ******************************************************************************************************
// Thread Creation and Deletion // Thread Creation and Deletion
......
...@@ -71,14 +71,12 @@ mchoiceAndTasks3 :: !HtmlCode ![((!Bool,!ChoiceUpdate,!HtmlCode),LabeledTask a)] ...@@ -71,14 +71,12 @@ mchoiceAndTasks3 :: !HtmlCode ![((!Bool,!ChoiceUpdate,!HtmlCode),LabeledTask a)]
(-&&-) :: do both iTasks in any order (interleaved), task completed when both done (-&&-) :: do both iTasks in any order (interleaved), task completed when both done
orTasks :: do all iTasks in any order (interleaved), task completed as soon as any subtask is done orTasks :: do all iTasks in any order (interleaved), task completed as soon as any subtask is done
andTasks :: do all iTasks in any order (interleaved), task completed when all done andTasks :: do all iTasks in any order (interleaved), task completed when all done
multiAndTask :: start a new instance of the task on demand and do them in any order, task never completes /* not optimized yet */
andTasks_mu :: assign task to indicated users, task completed when all done andTasks_mu :: assign task to indicated users, task completed when all done
*/ */
(-||-) infixr 3 :: !(Task a) !(Task a) -> Task a | iData a (-||-) infixr 3 :: !(Task a) !(Task a) -> Task a | iData a
(-&&-) infixr 4 :: !(Task a) !(Task b) -> Task (a,b) | iData a & iData b (-&&-) infixr 4 :: !(Task a) !(Task b) -> Task (a,b) | iData a & iData b
orTasks :: ![LabeledTask a] -> (Task a) | iData a orTasks :: ![LabeledTask a] -> (Task a) | iData a
andTasks :: ![LabeledTask a] -> Task [a] | iData a andTasks :: ![LabeledTask a] -> Task [a] | iData a
multiAndTask :: !(LabeledTask a) -> Task Void | iData a
andTasks_mu :: !String ![(Int,Task a)] -> Task [a] | iData a andTasks_mu :: !String ![(Int,Task a)] -> Task [a] | iData a
/* convenient combinators for tasks that maybe return a result: /* convenient combinators for tasks that maybe return a result:
......
...@@ -153,16 +153,6 @@ where ...@@ -153,16 +153,6 @@ where
noNothing [RIGHT Nothing:xs] = True noNothing [RIGHT Nothing:xs] = True
noNothing [x:xs] = noNothing xs noNothing [x:xs] = noNothing xs
multiAndTask :: !(LabeledTask a) -> Task Void | iData a
multiAndTask (label,task)
= taskId
*=> \id -> addNewTask` id 0
where
addNewTask` id cnt
= id @:> ("New " <+++ label, editTask ("Start " <+++ label) Void)
=>> \_ -> (addNewTask` id (inc cnt) -&&- (id @:> (label <+++ " " <+++ cnt,task))
#>> return_V Void)
andTasks_mu :: !String ![(Int,Task a)] -> (Task [a]) | iData a andTasks_mu :: !String ![(Int,Task a)] -> (Task [a]) | iData a
andTasks_mu label tasks = newTask "andTasks_mu" (domu_andTasks tasks) andTasks_mu label tasks = newTask "andTasks_mu" (domu_andTasks tasks)
where where
......
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