Commit 30f2aafe authored by Bas Lijnse's avatar Bas Lijnse

Updated task service to provide tui definitions.

git-svn-id: https://svn.cs.ru.nl/repos/iTask-system/trunk@1102 63da3aa8-80fd-4f01-9db8-e6ea747a3da2
parent 8d8a1b02
......@@ -74,14 +74,19 @@ taskService url html path req tst
= (notFoundResponse req, tst)
Just proc
# task = taskItem proc
# menu = proc.Process.menus
//The menusChanged parameter is a global flag that is set when any task in the tree has
//changed the menu and thus the menu needs to be replaced
# (tree,tst=:{TSt|menusChanged})
= calculateTaskTree taskId [] tst //TODO Add update events as parameter
# tui = buildTaskPanel tree menu menusChanged session.Session.user
# json = JSONObject [("success",JSONBool True),("task",toJSON task),("menu",toJSON menu),("tui",toJSON tui)]
= (serviceResponse html "task user interface" url tuiParams json, {TSt|tst & menusChanged = menusChanged})
= case tree of
(TTMainTask ti properties menus _ content)
# tui = buildTaskPanel content menus menusChanged session.Session.user
# json = JSONObject [("success",JSONBool True),("task",toJSON task),("menu",toJSON menus),("tui",toJSON tui)]
= (serviceResponse html "task user interface" url tuiParams json, {TSt|tst & menusChanged = menusChanged})
_
# json = JSONObject [("success",JSONBool True),("task",toJSON task),("menu",JSONNull),("tui",JSONNull)]
= (serviceResponse html "task user interface" url tuiParams json, {TSt|tst & menusChanged = menusChanged})
//Show / update Manager properties
[taskId,"managerProperties"]
......
......@@ -215,6 +215,13 @@ loadThread processId tst=:{TSt|iworld = iworld =:{IWorld|store,world}}
//Computes a workflow (sub) process
evaluateTaskInstance :: !Process ![TaskUpdate] !(Maybe ChangeInjection) !Bool !Bool !*TSt-> (!TaskResult Dynamic, !TaskTree, !*TSt)
evaluateTaskInstance process=:{Process | taskId, properties, menus, changeCount, inParallelType} updates newChange isTop firstRun tst=:{TSt|currentChange,pendingChanges,updates=parentUpdates,properties=parentProperties,menus=parentMenus}
// Update access timestamps in properties
# (now,tst) = accWorldTSt time tst
# properties = {properties & systemProperties = {properties.systemProperties
& latestEvent = Just now
, firstEvent = case properties.systemProperties.firstEvent of
Nothing = Just now
Just t = Just t }}
// Reset the task state
# tst = resetTSt taskId updates properties inParallelType tst
// Queue all stored persistent changes (only when run as top node)
......
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