Commit db39c7f9 authored by Rinus Plasmeijer's avatar Rinus Plasmeijer

moved trace from options to tst state

git-svn-id: https://svn.cs.ru.nl/repos/iTask-system/branches/fancyTasks@302 63da3aa8-80fd-4f01-9db8-e6ea747a3da2
parent 0bbaeb16
......@@ -61,11 +61,11 @@ mkTask taskname mytask = Task (appTaskTSt (mkTaskNoInc taskname mytask) o incTas
mkTaskNoInc :: !String !(Task a) -> (Task a) | iCreateAndPrint a // common second part of task wrappers
mkTaskNoInc taskname mytask = Task mkTaskNoInc`
where
mkTaskNoInc` tst=:{activated,tasknr,userId,options}
mkTaskNoInc` tst=:{activated,tasknr,userId,options,trace}
| not activated = (createDefault,tst) // not active, don't call task, return default value
# (val,tst=:{activated,html}) = appTaskTSt mytask tst // active, so perform task and get its result
# tst = {tst & tasknr = tasknr, options = options, userId = userId}
| options.trace || taskname == "" = (val,tst) // no trace, just return value
| trace || taskname == "" = (val,tst) // no trace, just return value
# tst = {tst & html = TaskTrace {trTaskNr = tasknr, trTaskName = taskname, trActivated = activated, trUserId = userId, trValue = printToString val, trOptions = options} html}
= (val,tst)
......
......@@ -377,26 +377,25 @@ where
ServerThreadTableStorage:: !(ThreadTable -> ThreadTable) -> (Task ThreadTable) // used to store Tasknr of callbackfunctions / threads
ServerThreadTableStorage fun = Task handleTable
where
handleTable tst=:{staticInfo,options} = appTaskTSt (ThreadTableStorageGen serverThreadTableId staticInfo.threadTableLoc options.trace fun) tst
handleTable tst=:{staticInfo,options} = appTaskTSt (ThreadTableStorageGen serverThreadTableId staticInfo.threadTableLoc fun) tst
serverThreadTableId = "Application" +++ "-ThreadTable"
ClientThreadTableStorage:: !(ThreadTable -> ThreadTable) -> (Task ThreadTable) // used to store Tasknr of callbackfunctions / threads
ClientThreadTableStorage fun = Task handleTable
where
handleTable tst=:{staticInfo,options} = appTaskTSt (ThreadTableStorageGen (clientThreadTableId staticInfo.currentUserId) LSClient options.trace fun) tst
handleTable tst=:{staticInfo,options} = appTaskTSt (ThreadTableStorageGen (clientThreadTableId staticInfo.currentUserId) LSClient fun) tst
clientThreadTableId userid = "User" <+++ userid <+++ "-ThreadTable"
ThreadTableStorageGen :: !String !Lifespan !Bool !(ThreadTable -> ThreadTable) -> (Task ThreadTable) // used to store Tasknr of callbackfunctions / threads
ThreadTableStorageGen tableid lifespan trace fun = Task handleTable // to handle the table on server as well as on client
ThreadTableStorageGen :: !String !Lifespan !(ThreadTable -> ThreadTable) -> (Task ThreadTable) // used to store Tasknr of callbackfunctions / threads
ThreadTableStorageGen tableid lifespan fun = Task handleTable // to handle the table on server as well as on client
where
handleTable tst
# (table,tst) = liftHst (mkStoreForm (Init,storageFormId
{ tasklife = lifespan
, taskstorage = PlainString
, taskmode = NoForm
, trace = trace
, gc = Collect} tableid []) fun) tst
= (table.Form.value,tst)
......
......@@ -15,6 +15,7 @@ import HSt
, staticInfo :: !StaticInfo // info which does not change during a run
, html :: !HtmlTree // accumulator for html code
, options :: !Options // iData lifespan and storage format
, trace :: !Bool // default: False
, hst :: !HSt // iData state
}
......@@ -32,7 +33,6 @@ import HSt
, taskstorage :: !StorageFormat // default: PlainString
, taskmode :: !Mode // default: Edit
, gc :: !GarbageCollect // default: Collect
, trace :: !Bool // default: False
}
:: GarbageCollect
= Collect // garbage collect iTask administration
......
......@@ -13,6 +13,7 @@ mkTst thisUser itaskstorage threadstorage hst
, workflowLink = (0,(defaultUser,0,defaultWorkflowName))
, html = BT [] []
, hst = hst
, trace = False
, options = initialOptions thisUser itaskstorage
}
......@@ -28,7 +29,6 @@ initialOptions thisUser location
, taskstorage = PlainString
, taskmode = Edit
, gc = Collect
, trace = False
}
......
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