Commit bc5f0535 authored by Rinus Plasmeijer's avatar Rinus Plasmeijer

new process now start counting by 0 instead of -1

git-svn-id: https://svn.cs.ru.nl/repos/iTask-system/branches/fancyTasks@325 63da3aa8-80fd-4f01-9db8-e6ea747a3da2
parent e9d0d2fa
......@@ -27,7 +27,7 @@ derive JSONDecode HtmlState, StorageFormat, Lifespan
// *** Server / Client startup
// ******************************************************************************************************
startTaskEngine :: !(Task a) !*World -> *World | iData a
startTaskEngine maintask world = doHtmlServer maintask world
startTaskEngine maintask world = doHtmlServer maintask world
doHtmlServer :: (Task a) !*World -> *World | iData a
doHtmlServer mainTask world
......
......@@ -116,28 +116,23 @@ where
# (a,tst=:{html=nhtml,activated}) = appTaskTSt (IF_Ajax (UseAjax @>> taska) taska) {tst & html = BT [] [],userId = nuserId} // activate task of indicated user NEWTRACE
| activated = (a,{tst & activated = True // work is done
, userId = userId // restore previous user id
, html = ohtml +|+ ( { delegatorId = userId
, taskWorkerId = nuserId
, taskNrId = toStringTaskNr tasknr
, processNr = processNr
, worflowLabel = workflowLabel
, taskPriority = NormalPriority
, taskLabel = taskname
, timeCreated = currtime
, curStatus = activated
} @@: nhtml)}) // plus new one tagged
, html = ohtml +|+ (taskDescriptor currtime activated @@: nhtml)}) // plus new one tagged
= (a,{tst & userId = userId // restore user Id
, html = ohtml +|+ ( { delegatorId = userId
, taskWorkerId = nuserId
, taskNrId = toStringTaskNr tasknr
, processNr = processNr
, worflowLabel = workflowLabel
, taskPriority = NormalPriority
, taskLabel = taskname
, timeCreated = currtime
, curStatus = activated
} @@: nhtml)
, html = ohtml +|+ (taskDescriptor currtime activated @@: nhtml)
})
where
taskDescriptor currtime activated
= { delegatorId = userId
, taskWorkerId = nuserId
, taskNrId = toStringTaskNr tasknr
, processNr = processNr
, worflowLabel = workflowLabel
, taskPriority = NormalPriority
, taskLabel = taskname
, timeCreated = currtime
, curStatus = activated
}
// ******************************************************************************************************
// sequencingtasks
......@@ -171,7 +166,7 @@ where
allTasksCond :: !String !DisplaySubTasks !(FinishPred a) ![LabeledTask a] -> Task [a] | iData a
allTasksCond label displayOption pred taskCollection
= mkTask "andTasksCond" (Task (doandTasks taskCollection))
= mkTask label (Task (doandTasks taskCollection))
where
doandTasks [] tst = return [] tst
doandTasks taskCollection tst=:{tasknr,html}
......
......@@ -9,12 +9,12 @@ mkTst thisUser itaskstorage threadstorage hst
= { tasknr = [-1]
, activated = True
, staticInfo = initStaticInfo thisUser threadstorage
, userId = if (thisUser >= 0) defaultUser thisUser
, userId = defaultUser
, workflowLink = (0,(defaultUser,0,defaultWorkflowName))
, html = BT [] []
, hst = hst
, trace = False
, options = initialOptions thisUser itaskstorage
, options = initialOptions itaskstorage
}
initStaticInfo :: UserId !Lifespan -> StaticInfo
......@@ -23,14 +23,13 @@ initStaticInfo thisUser location
, threadTableLoc= location
}
initialOptions :: !UserId !Lifespan -> Options
initialOptions thisUser location
= { tasklife = if (thisUser >= 0) location LSSession
initialOptions :: !Lifespan -> Options
initialOptions location
= { tasklife = location
, taskstorage = PlainString
, taskmode = Edit
, gc = Collect
}
appTaskTSt :: !(Task a) !*TSt -> (!a,!*TSt)
appTaskTSt (Task fn) tst = fn tst
\ No newline at end of file
......@@ -20,8 +20,7 @@ calculateTaskTree thisUser traceOn showProcessTable showCurrThreadTable mainTask
# ((toServer,thrOwner,event,thrinfo,threads),tst=:{activated})
= calculateTasks thisUser pversion mainTask (mkTst thisUser LSTxtFile LSTxtFile hst)
# (processTable,tst)
= if showProcessTable (showWorkflows activated {tst & activated = activated}) ([],{tst & activated = activated})
# (processTable,tst) = if showProcessTable (showWorkflows activated {tst & activated = activated}) ([],{tst & activated = activated})
# (threadTable,tst=:{html,hst,activated})
= if showCurrThreadTable (showThreadTable {tst & activated = activated}) ([],{tst & activated = activated})
# showCompletePage = IF_Ajax (hd threads == [-1]) True
......
......@@ -121,7 +121,7 @@ where
scheduleWorkflows :: !(Task a) -> (Task a) | iData a
scheduleWorkflows maintask
# nmaintask = newTask defaultWorkflowName (assignTaskTo 0 ("main",maintask))
# nmaintask = newTask defaultWorkflowName (mkTask "StartMain" (assignTaskTo 0 ("main",maintask)))
= IF_Ajax
(IF_ClientServer // we running both client and server
(IF_ClientTasks
......@@ -180,7 +180,7 @@ where
# ((processid,wfls),tst) = workflowProcessStore id tst // read workflow process administration
# wfl = wfls!!(entry - 1) // fetch entry
# currentWorker = getWorkflowUser wfl // such that worker can be changed dynamically !
# (a,tst=:{activated}) = appTaskTSt (newTask label (assignTaskTo currentWorker ("main",task))) tst
# (a,tst=:{activated}) = appTaskTSt (newTask label (mkTask "StartMain" (assignTaskTo currentWorker ("main",task)))) tst
# dyn = dynamic a
| not activated = (dyn,tst) // not finished, return
......
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