Commit 3e9ec615 authored by Bas Lijnse's avatar Bas Lijnse
Browse files

Added the inputs list to the BT constructor of the HtmlTree type to store the...

Added the inputs list to the BT constructor of the HtmlTree type to store the event handler definitions of inputs in the html forms

git-svn-id: https://svn.cs.ru.nl/repos/iTask-system/branches/fancyTasks@247 63da3aa8-80fd-4f01-9db8-e6ea747a3da2
parent 44ce9dcb
......@@ -27,12 +27,12 @@ editTask` prompt a tst=:{tasknr,html,hst,userId}
# (taskdone,hst) = mkStoreForm (Init,storageFormId tst.options taskId False) id hst // remember if the task has been done
| taskdone.value // test if task has completed
# (editor,hst) = (mkEditForm (Init,cFormId tst.options editId a <@ Display) hst) // yes, read out current value, make editor passive
= (editor.value,{tst & activated = True, html = html +|+ BT editor.form, hst = hst}) // return result task
= (editor.value,{tst & activated = True, html = html +|+ BT editor.form editor.inputs, hst = hst}) // return result task
# (editor,hst) = mkEditForm (Init,cFormId tst.options editId a) hst // no, read out current value from active editor
# (finbut,hst) = mySimpleButton tst.options buttonId prompt (\_ -> True) hst // add button for marking task as done
# (taskdone,hst) = mkStoreForm (Init,storageFormId tst.options taskId False) finbut.value hst // remember task status for next time
| taskdone.value = editTask` prompt a {tst & hst = hst} // task is now completed, handle as previously
= (editor.value,{tst & activated = taskdone.value, html = html +|+ BT (editor.form ++ finbut.form), hst = hst})
= (editor.value,{tst & activated = taskdone.value, html = html +|+ BT (editor.form ++ finbut.form) (editor.inputs ++ finbut.inputs), hst = hst})
editTaskPred :: !a !(a -> (Bool, [HtmlTag]))-> (Task a) | iData a
editTaskPred a pred = mkTask "editTask" (editTaskPred` a)
......@@ -43,14 +43,14 @@ where
# (taskdone,hst) = mkStoreForm (Init,storageFormId tst.options taskId False) id hst // remember if the task has been done
| taskdone.value // test if task has completed
# (editor,hst) = (mkEditForm (Init,cFormId tst.options editId a <@ Display) hst) // yes, read out current value, make editor passive
= (editor.value,{tst & activated = True, html = html +|+ BT editor.form, hst = hst}) // return result task
= (editor.value,{tst & activated = True, html = html +|+ BT editor.form editor.inputs, hst = hst}) // return result task
# (editor,hst) = mkEditForm (Init,cFormId tst.options editId a <@ Submit) hst // no, read out current value from active editor
| editor.changed
| fst (pred editor.value)
# (taskdone,hst) = mkStoreForm (Init,storageFormId tst.options taskId False) (\_ -> True) hst // remember task status for next time
= editTaskPred` a {tst & hst = hst, html = html} // task is now completed, handle as previously
= (editor.value,{tst & activated = taskdone.value, html = html +|+ BT (editor.form ++ snd (pred editor.value)), hst = hst})
= (editor.value,{tst & activated = taskdone.value, html = html +|+ BT editor.form, hst = hst})
= (editor.value,{tst & activated = taskdone.value, html = html +|+ BT (editor.form ++ snd (pred editor.value)) editor.inputs, hst = hst})
= (editor.value,{tst & activated = taskdone.value, html = html +|+ BT editor.form editor.inputs, hst = hst})
mySimpleButton :: !Options !String !String !(a -> a) !*HSt -> (Form (a -> a),!*HSt)
mySimpleButton options id label fun hst
......
......@@ -48,7 +48,7 @@ derive write TCl
:: GarbageCollect
= Collect // garbage collect iTask administration
| NoCollect // no garbage collection
:: HtmlTree = BT [HtmlTag] // simple code
:: HtmlTree = BT [HtmlTag] [InputId] // simple code with possible event handler definitions
| (@@:) infix 0 !TaskDescription !HtmlTree // code with id of user attached to it
| (-@:) infix 0 !UserId !HtmlTree // skip code with this id if it is the id of the user
| (+-+) infixl 1 !HtmlTree !HtmlTree // code to be placed next to each other
......
......@@ -113,7 +113,7 @@ calculateTasks thisUser pversion doTrace maintask tst=:{hst}
= ((IF_Ajax
(startAjaxApplication thisUser pversion)
startMainTask
) maintask) {tst & hst = hst, trace = if doTrace (Just []) Nothing, activated = True, html = BT []}
) maintask) {tst & hst = hst, trace = if doTrace (Just []) Nothing, activated = True, html = BT [] []}
where
startMainTask :: !(Task a) !*TSt -> ((!Bool,!Int,!TaskNr,!String,![TaskNr]),*TSt) // No threads, always start from scratch
startMainTask task tst
......@@ -161,22 +161,22 @@ startAjaxApplication thisUser versioninfo maintask tst=:{tasknr,options,html,tra
// ok, we have found a matching thread
# (_,tst=:{activated}) = evalTaskThread thread {tst & html = BT []} // evaluate the thread
# (_,tst=:{activated}) = evalTaskThread thread {tst & html = BT [] []} // evaluate the thread
| not activated // thread / task not yet finished
# tst = copyThreadTableToClient tst // copy thread table to client
= ((False,thisUser,event,"",[thread.thrTaskNr]),tst) // no further evaluation, aks user for more input
# (mbthread,tst) = findParentThread (tl thread.thrTaskNr) tst // look for thread to evaluate
= doParent mbthread maintask event [thread.thrTaskNr] {tst & html = BT [], options = options} // more to evaluate, call thread one level higher
= doParent mbthread maintask event [thread.thrTaskNr] {tst & html = BT [] [], options = options} // more to evaluate, call thread one level higher
where
doParent [] maintask event accu tst // no more parents of current event, do main task
= startFromRoot versioninfo event [tasknr:accu] "No more threads, page refreshed" maintask {tst & html = BT []}
= startFromRoot versioninfo event [tasknr:accu] "No more threads, page refreshed" maintask {tst & html = BT [] []}
doParent [parent:next] maintask event accu tst // do parent of current thread
| parent.thrUserId <> thisUser // updating becomes too complicated
= startFromRoot versioninfo event [tasknr:accu] ("Parent thread of user " <+++ parent.thrUserId <+++ ", page refreshed") maintask {tst & html = BT []}
= startFromRoot versioninfo event [tasknr:accu] ("Parent thread of user " <+++ parent.thrUserId <+++ ", page refreshed") maintask {tst & html = BT [] []}
# (_,tst=:{activated}) = evalTaskThread parent {tst & html = BT []} // start parent
# (_,tst=:{activated}) = evalTaskThread parent {tst & html = BT [] []} // start parent
| not activated // parent thread not yet finished
# tst = copyThreadTableToClient tst // copy thread table to client
= ((False,thisUser,event, "",[parent.thrTaskNr:accu]),tst) // no further evaluation, aks user for more input
......@@ -333,7 +333,7 @@ where
ServerThread = deserializeThread thrCallback
else = abort "Thread administration error in evalTaskThread"
)
{tst & tasknr = thrTaskNr, options = newThrOptions, userId = thrUserId,html = BT []}
{tst & tasknr = thrTaskNr, options = newThrOptions, userId = thrUserId,html = BT [] []}
| activated // thread is finished, delete the entry...
# tst = deleteThreads thrTaskNr {tst & html = html +|+ nhtml} // remove thread from administration
= (a,{tst & tasknr = tasknr, options = options, userId = userId}) // remove entry from table
......
......@@ -35,7 +35,7 @@ initTst thisUser itaskstorage threadstorage hst
, staticInfo = initStaticInfo thisUser threadstorage
, userId = if (thisUser >= 0) defaultUser thisUser
, workflowLink = (0,(defaultUser,0,defaultWorkflowName))
, html = BT []
, html = BT [] []
, trace = Nothing
, hst = hst
, options = initialOptions thisUser itaskstorage
......@@ -266,7 +266,7 @@ startTstTask thisUser multiuser (userchanged,multiuserform) useroptions=:{traceO
// Here the iTasks are evaluated ...
# ((toServer,thrOwner,event,thrinfo,threads),tst=:{html,hst,trace,activated})
= calculateTasks thisUser pversion doTrace maintask {tst & hst = hst, trace = if doTrace (Just []) Nothing, activated = True, html = BT []}
= calculateTasks thisUser pversion doTrace maintask {tst & hst = hst, trace = if doTrace (Just []) Nothing, activated = True, html = BT [] []}
// epilogue
......
......@@ -113,7 +113,7 @@ where
| not activated = (createDefault,tst)
# (currtime,tst) = appWorldOnce "time" time tst
# tst = IF_Ajax (administrateNewThread userId tst) tst
# (a,tst=:{html=nhtml,activated}) = IF_Ajax (UseAjax @>> taska) taska {tst & html = BT [],userId = nuserId} // activate task of indicated user
# (a,tst=:{html=nhtml,activated}) = IF_Ajax (UseAjax @>> taska) taska {tst & html = BT [] [],userId = nuserId} // activate task of indicated user
| activated = (a,{tst & activated = True // work is done
, userId = userId // restore previous user id
, html = ohtml }) // plus new one tagged
......@@ -143,8 +143,8 @@ where
doseqTasks [] accu tst = (reverse accu,{tst & activated = True})
doseqTasks [(taskname,task):ts] accu tst=:{html,options}
# (a,tst=:{activated=adone,html=ahtml})
= task {tst & activated = True, html = BT []}
| not adone = (reverse accu,{tst & html = html +|+ BT [showLabel taskname,BrTag [] ,BrTag []] +|+ ahtml})
= task {tst & activated = True, html = BT [] []}
| not adone = (reverse accu,{tst & html = html +|+ BT [showLabel taskname,BrTag [] ,BrTag []] [] +|+ ahtml})
= doseqTasks ts [a:accu] {tst & html = html +|+ ahtml, options = options}
// ******************************************************************************************************
......@@ -170,23 +170,23 @@ where
doandTasks chooser [] tst = return [] tst
doandTasks chooser taskCollection tst=:{tasknr,html,options,userId}
# ((alist,acode),tst=:{activated=finished,html=allhtml})
= checkAllTasks label taskCollection 0 True ([],[]) {tst & html = BT [],activated = True}
= checkAllTasks label taskCollection 0 True ([],[]) {tst & html = BT [] [],activated = True}
| finished = (alist,{tst & html = html}) // stop, all andTasks are finished
| pred alist = (alist,{tst & html = html, activated = True}) // stop, all work done so far satisfies predicate
# selectId = iTaskId userId tasknr "anTaskSelect"
# ((selected,shtml),tst) = chooser selectId taskCollection {tst & html = BT []}
# (_,tst=:{html=ashtml}) = showtasks label [(i,taskCollection!!i) \\ i <- selected | i >= 0 && i < lengthltask] {tst & html = BT [], activated = True}
# ((selected,shtml),tst) = chooser selectId taskCollection {tst & html = BT [] []}
# (_,tst=:{html=ashtml}) = showtasks label [(i,taskCollection!!i) \\ i <- selected | i >= 0 && i < lengthltask] {tst & html = BT [] [], activated = True}
= (alist,{tst & activated = finished
, html = html +|+ // show previous code
((BT shtml) +-+ ashtml) +|+ // show selection button + selected itasks
(userId -@: foldl (+|+) (BT []) [htmlcode \\ htmlcode <- acode & i <- [0..] | not (isMember i selected)]) // dont show non selected itasks, but scan them for task tree info
((BT shtml []) +-+ ashtml) +|+ // show selection button + selected itasks
(userId -@: foldl (+|+) (BT [] []) [htmlcode \\ htmlcode <- acode & i <- [0..] | not (isMember i selected)]) // dont show non selected itasks, but scan them for task tree info
})
where
showtasks :: !String ![(!Int,!LabeledTask a)] !*TSt -> *(![a],!*TSt) | iCreateAndPrint a
showtasks _ [] tst = ([],tst)
showtasks label [(chosen,(name,chosenTask)):tasks] tst=:{html=html}
# (a,tst=:{html=ahtml}) = mkParSubTask label chosen chosenTask {tst & tasknr = tasknr, activated = True, html = BT []}
# (as,tst=:{html=ashtml}) = showtasks label tasks {tst & html = BT []}
# (a,tst=:{html=ahtml}) = mkParSubTask label chosen chosenTask {tst & tasknr = tasknr, activated = True, html = BT [] []}
# (as,tst=:{html=ashtml}) = showtasks label tasks {tst & html = BT [] []}
= ([a:as],{tst & html = html +|+ ahtml +|+ ashtml})
......@@ -195,7 +195,7 @@ where
| ctasknr == length taskCollection = ((reverse alist,reverse acode),{tst & activated = bool}) // all tasks tested
# (taskname,task) = taskCollection!!ctasknr
# (a,tst=:{activated = adone,html=html})
= mkParSubTask traceid ctasknr task {tst & tasknr = tasknr, activated = True, html = BT []} // check tasks
= mkParSubTask traceid ctasknr task {tst & tasknr = tasknr, activated = True, html = BT [] []} // check tasks
| adone = checkAllTasks traceid taskCollection (inc ctasknr) bool ([a:alist],[html:acode]) {tst & tasknr = tasknr, activated = True}
= checkAllTasks traceid taskCollection (inc ctasknr) False (alist,[html:acode]) {tst & tasknr = tasknr, activated = True}
......@@ -221,8 +221,8 @@ closureLZTask :: Same, but now the original task will not be done unless someone
(-!>) stoptask task = mkTask "-!>" stop`
where
stop` tst=:{tasknr,html,options,userId}
# (val,tst=:{activated = taskdone,html = taskhtml}) = task {tst & activated = True, html = BT [], tasknr = normalTaskId,options = options}
# (s, tst=:{activated = stopped, html = stophtml}) = stoptask {tst & activated = True, html = BT [], tasknr = stopTaskId, options = options}
# (val,tst=:{activated = taskdone,html = taskhtml}) = task {tst & activated = True, html = BT [] [], tasknr = normalTaskId,options = options}
# (s, tst=:{activated = stopped, html = stophtml}) = stoptask {tst & activated = True, html = BT [] [], tasknr = stopTaskId, options = options}
| stopped = return_V (Just s, TCl (close task)) {tst & html = html, activated = True}
| taskdone = return_V (Nothing,TCl (return_V val)) {tst & html = html +|+ taskhtml, activated = True}
= return_V (Nothing,TCl (return_V val)) {tst & html = html +|+ taskhtml +|+ stophtml, activated = False}
......
......@@ -105,7 +105,7 @@ where
[[(iTaskButton txt,\_ -> n)] \\ txt <- map fst taskOptions & n <- [0..]]
# (choice,tst) = liftHst (TableFuncBut (Init,pageFormId options buttonId allButtons)) tst
# (chosen,tst) = liftHst (mkStoreForm (Init,storageFormId options taskId -1) choice.value) tst
| chosen.value == -1 = ([],{tst & activated = False,html = html +|+ BT choice.form})
| chosen.value == -1 = ([],{tst & activated = False,html = html +|+ BT choice.form choice.inputs})
= ([chosen.value],{tst & activated = True})
= ([chosen.value],{tst & activated = True})
......@@ -125,8 +125,8 @@ where
# taskPdMenuId = iTaskId userId tasknr ("ChoPdm" <+++ numberOfItems)
# (choice,tst) = liftHst (FuncMenu (Init,sessionFormId options taskPdMenuId (defaultOn,[(txt,id) \\ txt <- map fst taskOptions]))) tst
# (_,tst=:{activated=adone,html=ahtml})
= editTaskLabel "" "Done" Void {tst & activated = True, html = BT [], tasknr = [-1:tasknr]}
| not adone = ([],{tst & activated = False, html = html +|+ BT prompt +|+ BT choice.form +|+ ahtml, tasknr = tasknr})
= editTaskLabel "" "Done" Void {tst & activated = True, html = BT [] [], tasknr = [-1:tasknr]}
| not adone = ([],{tst & activated = False, html = html +|+ BT prompt [] +|+ BT choice.form choice.inputs +|+ ahtml, tasknr = tasknr})
# chosenIdx = snd choice.value
# chosenTask = snd (taskOptions!!chosenIdx)
# (chosen,tst) = liftHst (mkStoreForm (Init,storageFormId options taskId -1) (\_ -> chosenIdx)) tst
......@@ -151,11 +151,11 @@ where
# choice = if nradio.changed (snd nradio.value) chosen.value
# (nradio,tst) = liftHst (ListFuncRadio (Set, sessionFormId options taskRadioMenuId (choice,[\i a -> i \\ j <- [0 .. numberOfButtons - 1]]))) tst
# (_,tst=:{activated=adone,html=ahtml})
= editTaskLabel "" "Done" Void {tst & activated = True, html = BT [], tasknr = [-1:tasknr]}
= editTaskLabel "" "Done" Void {tst & activated = True, html = BT [] [], tasknr = [-1:tasknr]}
| not adone
# (chosen,tst) = liftHst (mkStoreForm (Set,storageFormId options taskId choice) id) {tst & activated = adone, html = BT []}
# (chosen,tst) = liftHst (mkStoreForm (Set,storageFormId options taskId choice) id) {tst & activated = adone, html = BT [] []}
# radioform = nradio.form <=|> [[showLabel label] <||> htmlcode \\ htmlcode <- htmlcodes & (label,_) <- taskOptions]
= (createDefault,{tst & activated = False, html = html +|+ BT [radioform] +|+ ahtml, tasknr = tasknr})
= (createDefault,{tst & activated = False, html = html +|+ BT [radioform] nradio.inputs +|+ ahtml, tasknr = tasknr})
= ([choice],{tst & activated = True, html = html, tasknr = tasknr})
chooseTask_cbox :: !([LabeledTask a] -> Task [a]) ![HtmlTag] ![((!Bool,!ChoiceUpdate,![HtmlTag]),LabeledTask a)] -> Task [a] | iData a
......@@ -177,10 +177,10 @@ where
# (done,tst) = liftHst (mkStoreForm (Init,storageFormId options donetaskId False) id) tst
# (_,tst=:{html=ahtml,activated = adone})
= (editTaskLabel "" "OK" Void) {tst & activated = True, html = BT [], tasknr = [-1:tasknr]}
= (editTaskLabel "" "OK" Void) {tst & activated = True, html = BT [] [], tasknr = [-1:tasknr]}
| not adone
# optionsform = cboxes.form <=|> [[showLabel label] <||> htmlcode \\ (_,_,htmlcode) <- htmlcodes & (label,_) <- taskOptions]
= ([],{tst & html = html +|+ BT [optionsform] +|+ ahtml})
= ([],{tst & html = html +|+ BT [optionsform] cboxes.inputs +|+ ahtml})
# (_,tst) = liftHst (mkStoreForm (Init,storageFormId options donetaskId False) (\_ -> True)) tst
= ([i \\ True <- snd cboxes.value & i <- [0..]],{tst & tasknr = tasknr, html = html, options = options, userId =userId, activated = True}) // choose one subtask out of the list
......
......@@ -27,40 +27,40 @@ addHtml :: add html code
where
doTask tst=:{html=ohtml,activated}
| not activated = (createDefault,tst)
# (a,tst=:{activated,html=nhtml}) = task {tst & html = BT []}
# (a,tst=:{activated,html=nhtml}) = task {tst & html = BT [] []}
| activated = (a,{tst & html = ohtml})
= (a,{tst & html = ohtml +|+ BT prompt +|+ nhtml})
= (a,{tst & html = ohtml +|+ BT prompt [] +|+ nhtml})
(<<?) infixl 5 :: !(Task a) ![HtmlTag] -> Task a | iCreate a
(<<?) task prompt = doTask
where
doTask tst=:{html=ohtml,activated}
| not activated = (createDefault,tst)
# (a,tst=:{activated,html=nhtml}) = task {tst & html = BT []}
# (a,tst=:{activated,html=nhtml}) = task {tst & html = BT [] []}
| activated = (a,{tst & html = ohtml})
= (a,{tst & html = ohtml +|+ nhtml +|+ BT prompt})
= (a,{tst & html = ohtml +|+ nhtml +|+ BT prompt []})
(!>>) infixr 5 :: ![HtmlTag] !(Task a) -> (Task a) | iCreate a
(!>>) prompt task = doTask
where
doTask tst=:{html=ohtml,activated=myturn}
| not myturn = (createDefault,tst)
# (a,tst=:{html=nhtml}) = task {tst & html = BT []}
= (a,{tst & html = ohtml +|+ BT prompt +|+ nhtml})
# (a,tst=:{html=nhtml}) = task {tst & html = BT [] []}
= (a,{tst & html = ohtml +|+ BT prompt [] +|+ nhtml})
(<<!) infixl 5 :: !(Task a) ![HtmlTag] -> (Task a) | iCreate a
(<<!) task prompt = doTask
where
doTask tst=:{html=ohtml,activated=myturn}
| not myturn = (createDefault,tst)
# (a,tst=:{html=nhtml}) = task {tst & html = BT []}
= (a,{tst & html = ohtml +|+ nhtml +|+ BT prompt})
# (a,tst=:{html=nhtml}) = task {tst & html = BT [] []}
= (a,{tst & html = ohtml +|+ nhtml +|+ BT prompt []})
addHtml :: ![HtmlTag] !*TSt -> *TSt
addHtml bodytag tst=:{activated, html}
| not activated = tst // not active, return default value
= {tst & html = html +|+ BT bodytag} // active, so perform task or get its result
= {tst & html = html +|+ BT bodytag []} // active, so perform task or get its result
iTaskButton :: !String -> Button
iTaskButton label = LButton defpixel label
......
......@@ -27,9 +27,9 @@ appIData idatafun = \tst -> mkTask "appIData" (appIData` idatafun) tst
where
appIData` idata tst=:{tasknr,html,hst}
# (idata,hst) = idatafun hst
# (_,{tasknr,activated,html=ahtml,hst}) = editTaskLabel "appIDataDone" "Done" Void {tst & activated = True, html = BT [],hst = hst}
# (_,{tasknr,activated,html=ahtml,hst}) = editTaskLabel "appIDataDone" "Done" Void {tst & activated = True, html = BT [] [],hst = hst}
= (idata.value,{tst & tasknr = tasknr,activated = activated, html = html +|+
(if activated (BT idata.form) (BT idata.form +|+ ahtml)), hst = hst})
(if activated (BT idata.form idata.inputs) (BT idata.form idata.inputs +|+ ahtml)), hst = hst})
appIData2 :: !(String *HSt -> *(!Form a,!*HSt)) -> (Task a) | iData a
appIData2 idatafun = \tst -> mkTask "appIData" (appIData` idatafun) tst
......@@ -37,9 +37,9 @@ where
appIData` idata tst=:{tasknr,html,hst,userId}
# taskId = iTaskId userId tasknr "iData"
# (idata,hst) = idatafun taskId hst
# (_,{tasknr,activated,html=ahtml,hst}) = editTaskLabel "appIDataDone" "Done" Void {tst & activated = True, html = BT [],hst = hst}
# (_,{tasknr,activated,html=ahtml,hst}) = editTaskLabel "appIDataDone" "Done" Void {tst & activated = True, html = BT [] [],hst = hst}
= (idata.value,{tst & tasknr = tasknr,activated = activated, html = html +|+
(if activated (BT idata.form) (BT idata.form +|+ ahtml)), hst = hst})
(if activated (BT idata.form idata.inputs) (BT idata.form idata.inputs +|+ ahtml)), hst = hst})
appHStOnce :: !String !(HSt -> (!a,!HSt)) -> (Task a) | iData a
appHStOnce label fun = Once label (liftHst fun)
......
......@@ -16,7 +16,7 @@ calculateTaskTree thisUser mainTask hst
# (pversion,hst) = setPUserNr thisUser id hst // fetch global settings of this user
# (sversion,hst) = setSVersionNr thisUser id hst // fetch version number of session (not needed in new set up?)
# versionconflict = sversion > 0 && sversion < pversion.versionNr //&& not noNewVersion // test if there is a version conflict
| versionconflict = (True,BT [],Just "Version conflict detected!",hst) // Yes, return error message
| versionconflict = (True,BT [] [],Just "Version conflict detected!",hst) // Yes, return error message
# ((toServer,thrOwner,event,thrinfo,threads),tst=:{html,hst,trace,activated})
= calculateTasks thisUser pversion False mainTask (initTst thisUser TxtFile TxtFile hst)
......@@ -35,7 +35,7 @@ where
, staticInfo = initStaticInfo thisUser threadstorage
, userId = if (thisUser >= 0) defaultUser thisUser
, workflowLink = (0,(defaultUser,0,defaultWorkflowName))
, html = BT []
, html = BT [] []
, trace = Nothing
, hst = hst
, options = initialOptions thisUser itaskstorage
......
......@@ -25,7 +25,7 @@ collectTaskList pred (tree1 +-+ tree2)
# collection1 = collectTaskList pred tree1
# collection2 = collectTaskList pred tree2
= collection1 ++ collection2
collectTaskList pred (BT bdtg)
collectTaskList pred (BT bdtg [])
= []
collectTaskList pred (DivCode id tree)
= collectTaskList pred tree
......@@ -55,13 +55,13 @@ determineTaskTree thisuser thistaskid (tree1 +-+ tree2)
# ntree1 = determineTaskTree thisuser thistaskid tree1
| isJust ntree1 = ntree1
= determineTaskTree thisuser thistaskid tree2
determineTaskTree thisuser thistaskid (BT bdtg)
determineTaskTree thisuser thistaskid (BT bdtg [])
= Nothing
determineTaskTree thisuser thistaskid (DivCode id tree)
= determineTaskTree thisuser thistaskid tree
noFilter :: !HtmlTree -> [HtmlTag]
noFilter (BT body) = body
noFilter (BT body inputs) = body
noFilter (_ @@: html) = noFilter html
noFilter (_ -@: html) = noFilter html
noFilter (htmlL +-+ htmlR) = [noFilter htmlL <=> noFilter htmlR]
......@@ -133,7 +133,7 @@ collect thisuser taskuser accu (tree1 +-+ tree2)
# (lhtml,accu) = collect thisuser taskuser accu tree1
# (rhtml,accu) = collect thisuser taskuser accu tree2
= ([lhtml <=> rhtml],accu)
collect thisuser taskuser accu (BT bdtg)
collect thisuser taskuser accu (BT bdtg [])
| thisuser == taskuser = (bdtg,accu)
| otherwise = ([],accu)
collect thisuser taskuser accu (DivCode id tree)
......
......@@ -69,7 +69,7 @@ where
&& not (isMember thread.thrTaskNr version.deletedThreads) // and not deleted by some global actions
]
| isEmpty mbthread = abort ("\nException raised, but no handler installed or activa anymore\n") // no handler installed
= evalException (hd mbthread) dynamicValue {tst & html = BT [], hst = hst} // yes, *finally*, we heave found an handler
= evalException (hd mbthread) dynamicValue {tst & html = BT [] [], hst = hst} // yes, *finally*, we heave found an handler
evalException :: !TaskThread !Dynamic -> Task a // execute the thread !!!!
evalException entry=:{thrTaskNr,thrUserId,thrOptions,thrCallback,thrCallbackClient} dynval = evalException`
......@@ -79,4 +79,4 @@ where
| doClient && noThread = abort "Cannot execute thread on Client\n"
= IF_ClientTasks
(abort "exception handling not implemeneted") //(deserializeThreadClient thrCallbackClient)
(deserializeExceptionHandler thrCallback dynval {tst & tasknr = thrTaskNr, options = thrOptions, userId = thrUserId,html = BT []})
(deserializeExceptionHandler thrCallback dynval {tst & tasknr = thrTaskNr, options = thrOptions, userId = thrUserId,html = BT [] []})
......@@ -266,7 +266,7 @@ where
| isDeletedWorkflow wfl = (True,tst) // already deleted
# nwfls = updateAt (entry - 1) (DeletedWorkflow ids) wfls // delete entry in table
# (wfls,tst=:{html}) = workflowProcessStore (\_ -> (maxid,nwfls)) tst // update workflow process administration
# (_,tst) = (getTask wfl) {tst & html = BT []} // calculate workflow to delete for the last time to obtain all its itasks in the task tree
# (_,tst) = (getTask wfl) {tst & html = BT [] []} // calculate workflow to delete for the last time to obtain all its itasks in the task tree
# tst = deleteSubTasksAndThreads [entry] tst // delete all iTask storage of this process ...
= (True,{tst & html = html, activated = True}) // 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