diff --git a/iTasks Examples/test examples/coffeemachine/coffeemachine.prj b/iTasks Examples/test examples/coffeemachine/coffeemachine.prj index 38fbff3e9157ab6f985f47d191afe419c06cb80c..87deb720836ba75ea3bcf57073987aea4fc3062d 100644 --- a/iTasks Examples/test examples/coffeemachine/coffeemachine.prj +++ b/iTasks Examples/test examples/coffeemachine/coffeemachine.prj @@ -3544,8 +3544,8 @@ OtherModules DclOpen: False Icl WindowPosition - X: 43 - Y: 129 + X: 41 + Y: -3 SizeX: 1485 SizeY: 768 IclOpen: True diff --git a/iTasks/Framework/Handlers/WorkListHandler.icl b/iTasks/Framework/Handlers/WorkListHandler.icl index 767ec9c1d22a35bd58aa5333bd4edc0f54925bb1..73ddd636988c24f7c89397e0f3afd346ca651e7e 100644 --- a/iTasks/Framework/Handlers/WorkListHandler.icl +++ b/iTasks/Framework/Handlers/WorkListHandler.icl @@ -23,7 +23,9 @@ import TaskTree, TaskTreeFilters, InternaliTasksCommon , tree_last :: Bool // Is this item the last of a set of siblings , tree_icon :: String // An icon name. The actual icon image is defined in the css. // Current possible values: editTask, orTask, andTask, conditionTask, timeTask, systemTask, finishedTask - } + } // And also: andTaskMU, maybeTask + + derive JSONEncode WorkList, WorkListItem, TaskPriority diff --git a/iTasks/TaskCombinators/iTasksBasicCombinators.icl b/iTasks/TaskCombinators/iTasksBasicCombinators.icl index 17f994393d990f3173a238ea63e643efb16dcc19..5239276458f3b2bc0fd0472e32761b67c35904da 100644 --- a/iTasks/TaskCombinators/iTasksBasicCombinators.icl +++ b/iTasks/TaskCombinators/iTasksBasicCombinators.icl @@ -173,26 +173,22 @@ allTasksCond :: !String !DisplaySubTasks !(FinishPred a) ![LabeledTask a] -> Ta allTasksCond label displayOption pred taskCollection = mkTask "andTasksCond" (Task (doandTasks taskCollection)) where - lengthltask = length taskCollection - doandTasks [] tst = return [] tst - doandTasks taskCollection tst=:{tasknr,html,options,userId} - # ((alist,acode),tst=:{activated=finished,html=allhtml}) - = checkAllTasks label taskCollection 0 True ([],[]) {tst & html = BT [] [],activated = True} - | finished || pred alist = (alist,{tst & html = html, activated = True}) // stop, all work done so far satisfies predicate + doandTasks taskCollection tst=:{tasknr,html} + # ((alist,acode),tst) = checkAllTasks label taskCollection 0 ([],[]) {tst & html = BT [] [],activated = True} + | and (map fst acode) || pred alist = (alist,{tst & html = html, activated = True}) // stop, all work done so far satisfies predicate = (alist,{tst & activated = False - , html = html +|+ displayOption label tasknr acode // show previous code + , html = html +|+ displayOption label tasknr acode // show all subtasks using the displayOption function }) where - - checkAllTasks :: !String ![LabeledTask a] !Int !Bool !(![a],![(Bool,HtmlTree)]) !*TSt -> *(!(![a],![(Bool,HtmlTree)]),!*TSt) | iCreateAndPrint a - checkAllTasks traceid taskCollection ctasknr bool (alist,acode) tst=:{tasknr} - | ctasknr == length taskCollection = ((reverse alist,reverse acode),{tst & activated = bool}) // all tasks tested + checkAllTasks :: !String ![LabeledTask a] !Int !(![a],![(Bool,HtmlTree)]) !*TSt -> *(!(![a],![(Bool,HtmlTree)]),!*TSt) | iCreateAndPrint a + checkAllTasks traceid taskCollection ctasknr (alist,acode) tst=:{tasknr} + | ctasknr == length taskCollection = ((reverse alist,reverse acode),tst) // all tasks tested # (taskname,task) = taskCollection!!ctasknr # (a,tst=:{activated = adone,html=html}) = appTaskTSt (mkParSubTask traceid ctasknr task) {tst & tasknr = tasknr, activated = True, html = BT [] []} // check tasks - = checkAllTasks traceid taskCollection (inc ctasknr) False (if adone [a:alist] alist,[(adone,html):acode]) {tst & tasknr = tasknr} + = checkAllTasks traceid taskCollection (inc ctasknr) (if adone [a:alist] alist,[(adone,html):acode]) {tst & tasknr = tasknr} displayAsTab :: DisplaySubTasks displayAsTab = displayAsTab` diff --git a/iTasks/TaskCombinators/iTasksCombinators.icl b/iTasks/TaskCombinators/iTasksCombinators.icl index f59d5e2c36e9c325902b12f58c1de913ae7ce68a..ba1044c164cb2c495359c0325a330aa2fa091642 100644 --- a/iTasks/TaskCombinators/iTasksCombinators.icl +++ b/iTasks/TaskCombinators/iTasksCombinators.icl @@ -220,21 +220,21 @@ where orTasks :: ![LabeledTask a] -> (Task a) | iData a orTasks [] = Task (return createDefault) -orTasks taskCollection = newTask "orTasks" (andTasksCond "or Tasks" (\list -> length list >= 1) taskCollection) +orTasks taskCollection = newTask "orTasks" (andTasksCond "orTask" (\list -> length list >= 1) taskCollection) =>> \list -> (Task (return (hd list))) orTask2 :: !(Task a,Task b) -> Task (EITHER a b) | iData a & iData b orTask2 (taska,taskb) -= allTasksCond "orTask2" displayAll (\list -> length list > 0) [("orTask.0",taska =>> \a -> return_V (LEFT a)),("orTask.0",taskb =>> \b -> return_V (RIGHT b))] += allTasksCond "orTask" displayAll (\list -> length list > 0) [("orTask.0",taska =>> \a -> return_V (LEFT a)),("orTask.0",taskb =>> \b -> return_V (RIGHT b))] =>> \res -> return_V (hd res) andTasks :: ![LabeledTask a] -> (Task [a]) | iData a -andTasks taskCollection = newTask "andTasks" (andTasksCond "and Tasks" (\_ -> False) taskCollection) +andTasks taskCollection = newTask "andTasks" (andTasksCond "andTask" (\_ -> False) taskCollection) (-&&-?) infixr 4 :: !(Task (Maybe a)) !(Task (Maybe b)) -> Task (Maybe (a,b)) | iData a & iData b (-&&-?) t1 t2 -= andTasksCond "Maybe Task" noNothing [("Maybe 1",left),("Maybe 2",right)] += andTasksCond "maybeTask" noNothing [("Maybe 1",left),("Maybe 2",right)] =>> combineResult where left = t1 =>> \tres -> return_V (LEFT tres) @@ -250,11 +250,11 @@ where andTask2 :: !(Task a,Task b) -> Task (a,b) | iData a & iData b andTask2 (taska,taskb) -= allTasksCond "andTask2" displayAll (\l -> False) [("andTask.0",taska =>> \a -> return_V (LEFT a)),("andTask.0",taskb =>> \b -> return_V (RIGHT b))] += allTasksCond "andTask" displayAll (\l -> False) [("andTask.0",taska =>> \a -> return_V (LEFT a)),("andTask.0",taskb =>> \b -> return_V (RIGHT b))] =>> \[LEFT a, RIGHT b] -> return_V (a,b) 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 "andTaskMU" (domu_andTasks tasks) where domu_andTasks list = andTasks [(label <+++ " " <+++ i, i @:: task) \\ (i,task) <- list] diff --git a/iTasks/TaskTree/TaskTreeFilters.icl b/iTasks/TaskTree/TaskTreeFilters.icl index d7fc174689f8ff8dbad9fb258ef27d38a8eff082..cb2f11a398949d8e1c0ffc4133954bdc6c8c32fa 100644 --- a/iTasks/TaskTree/TaskTreeFilters.icl +++ b/iTasks/TaskTree/TaskTreeFilters.icl @@ -25,7 +25,7 @@ where determineTaskList` thisuser (CondAnd label nr [t=:(condAndDescr,htmlTree):ts]) taskDescr # collection = determineTaskList` thisuser htmlTree taskDescr # collections = determineTaskList` thisuser (CondAnd label nr ts) taskDescr - = [{taskDescr & taskNrId = condAndDescr.caTaskNrId, taskLabel = label <+++ condAndDescr.caIndex, curStatus = condAndDescr.caStatus}] ++ collection ++ collections + = [{taskDescr & taskNrId = condAndDescr.caTaskNrId, taskLabel = label, curStatus = condAndDescr.caStatus}] ++ collection ++ collections determineTaskList` thisuser (tree1 +|+ tree2)taskDescr # collection1 = determineTaskList` thisuser tree1 taskDescr # collection2 = determineTaskList` thisuser tree2 taskDescr