iTasksBasicCombinators.icl 17.6 KB
Newer Older
Rinus Plasmeijer's avatar
Rinus Plasmeijer committed
1 2 3 4 5 6 7 8 9 10 11 12
implementation module iTasksBasicCombinators

// *********************************************************************************************************************************
// This module contains the basic iTasks combinators
// *********************************************************************************************************************************
// iTask & iData Concept and Implementation: (c) 2006,2007,2008 - Rinus Plasmeijer
// *********************************************************************************************************************************
//
import StdList, StdArray, StdTuple, StdFunc
import dynamic_string, graph_to_string_with_descriptors, graph_to_sapl_string
import DrupBasic
import iDataTrivial, iDataFormlib
13 14
import iTasksTypes, iTasksLiftingCombinators
import InternaliTasksThreadHandling
15
import GenBimap
Rinus Plasmeijer's avatar
Rinus Plasmeijer committed
16

17 18 19
derive gForm 	[], Time
derive gUpd 	[], Time
derive gPrint	Time
20
derive gParse	Time
Rinus Plasmeijer's avatar
Rinus Plasmeijer committed
21

22

Rinus Plasmeijer's avatar
Rinus Plasmeijer committed
23 24 25 26
// ******************************************************************************************************
// monads for combining iTasks

(=>>) infixl 1 :: !(Task a) !(a -> Task b) -> Task b | iCreateAndPrint b
27
(=>>) taska taskb = Task mybind
Rinus Plasmeijer's avatar
Rinus Plasmeijer committed
28 29
where
	mybind tst=:{options}
30 31 32
	# (a,tst=:{activated})	= appTaskTSt taska tst
	| activated				= appTaskTSt (taskb a) {tst & options = options}
							= (createDefault,tst)
Rinus Plasmeijer's avatar
Rinus Plasmeijer committed
33 34

return_V :: !a -> (Task a) | iCreateAndPrint a
35
return_V a  = mkTask "return_V" (Task dotask)
Rinus Plasmeijer's avatar
Rinus Plasmeijer committed
36 37 38 39 40 41 42 43
where
	dotask tst = (a,tst) 

	
// ******************************************************************************************************
// newTask needed for recursive task creation

newTask :: !String !(Task a) -> (Task a) 	| iData a 
44
newTask taskname mytask = mkTask taskname (Task newTask`)
Rinus Plasmeijer's avatar
Rinus Plasmeijer committed
45 46 47
where
	newTask` tst=:{tasknr,userId,options}		
	# taskId					= iTaskId userId tasknr taskname
48
	# (taskval,tst) 			= liftHst (mkStoreForm (Init,storageFormId options taskId (False,createDefault)) id) tst  // remember if the task has been done
49 50
	# (taskdone,taskvalue)		= taskval.Form.value											// select values
	| taskdone					= (taskvalue,tst)												// if rewritten return stored value
51
	# (val,tst=:{activated})	= appTaskTSt mytask {tst & tasknr = [-1:tasknr]} 				// do task, first shift tasknr
Rinus Plasmeijer's avatar
Rinus Plasmeijer committed
52
	| not activated				= (createDefault,{tst & tasknr = tasknr, options = options})	// subtask not ready, return value of subtasks
53
	# tst						= deleteSubTasksAndThreads tasknr tst							// task ready, garbage collect it
54
	# (_,tst) 					= liftHst (mkStoreForm (Init,storageFormId options taskId (False,createDefault)) (\_ -> (True,val))) tst  // remember if the task has been done
Rinus Plasmeijer's avatar
Rinus Plasmeijer committed
55 56 57 58
	= (val,{tst & tasknr = tasknr, options = options})


Once :: !String !(Task a) -> (Task a) | iData a
59
Once label task = mkTask label (Task doit)
Rinus Plasmeijer's avatar
Rinus Plasmeijer committed
60
where
61
	doit tst=:{activated,tasknr,hst,userId,options}
Rinus Plasmeijer's avatar
Rinus Plasmeijer committed
62 63
	# taskId			= iTaskId userId tasknr (label +++ "_")
	# (store,hst) 		= mkStoreForm (Init,storageFormId options taskId (False,createDefault)) id hst  			
64
	# (done,value)		= store.Form.value
65
	| done 				= (value,{tst & hst = hst})																		// if task has completed, don't do it again
66
	# (value,tst=:{hst})= appTaskTSt task {tst & hst = hst}
67
	# (store,hst) 		= mkStoreForm (Init,storageFormId options taskId (False,createDefault)) (\_ -> (True,value)) hst // remember task status for next time
68
	# (done,value)		= store.Form.value
69
	= (value,{tst & activated = done, hst = hst})																		// task is now completed, handle as previously
Rinus Plasmeijer's avatar
Rinus Plasmeijer committed
70

71
newTaskTrace :: !String !(Task a) -> (Task a) | iData a 			// used to insert a task trace later MJP BUG	 
Rinus Plasmeijer's avatar
Rinus Plasmeijer committed
72
newTaskTrace taskname mytask = /* newTask taskname */ mytask
73

Rinus Plasmeijer's avatar
Rinus Plasmeijer committed
74 75 76 77 78 79 80
// ******************************************************************************************************
// looping tasks

// when gc option set and task finished, it will throw away all subtasks and start all over
// otherwise, when task finshed it will remember the new tasknr to prevent checking of previously finished tasks

foreverTask :: !(Task a) -> Task a | iData a
81
foreverTask task = mkTask "foreverTask" (Task foreverTask`)
Rinus Plasmeijer's avatar
Rinus Plasmeijer committed
82 83
where
	foreverTask` tst=:{tasknr,activated,userId,options,html} 
84 85 86
	| options.gc == Collect																								// garbace collect everything when task finsihed
		# (val,tst=:{activated})= appTaskTSt task {tst & tasknr = [-1:tasknr]}											// shift tasknr
		| activated 			= foreverTask` (deleteSubTasksAndThreads tasknr {tst & tasknr = tasknr, options = options/*, html = html*/}) 			// loop
Rinus Plasmeijer's avatar
Rinus Plasmeijer committed
87
		= (val,tst)					
88 89
	# taskId					= iTaskId userId tasknr "ForSt"															// create store id
	# (currtasknr,tst)			= liftHst (mkStoreForm (Init,storageFormId options taskId tasknr) id) tst				// fetch actual tasknr
90
	# (val,tst=:{activated})	= appTaskTSt task {tst & tasknr = [-1:currtasknr.Form.value]}
91 92 93 94
	| activated 																										// task is completed	
		# ntasknr				= incNr currtasknr.Form.value															// incr tasknr
		# (currtasknr,tst)		= liftHst (mkStoreForm (Init,storageFormId options taskId tasknr) (\_ -> ntasknr)) tst 	// store next task nr
		= foreverTask` {tst & tasknr = tasknr, options = options/*, html = html*/}											// initialize new task
Rinus Plasmeijer's avatar
Rinus Plasmeijer committed
95 96 97
	= (val,tst)					

(<!) infixl 6 :: !(Task a) !(a -> .Bool) -> Task a | iCreateAndPrint a
98
(<!) taska pred = mkTask "less!" (Task doTask)
Rinus Plasmeijer's avatar
Rinus Plasmeijer committed
99 100
where
	doTask tst=:{activated, tasknr}
101
	# (a,tst=:{activated}) 	= appTaskTSt taska {tst & tasknr = [-1:tasknr]}
Rinus Plasmeijer's avatar
Rinus Plasmeijer committed
102 103
	| not activated 		= (a,tst)
	| not (pred a)			
Rinus Plasmeijer's avatar
Rinus Plasmeijer committed
104 105 106
		# tst = deleteSubTasksAndThreads [0:tasknr] tst
		= doTask {tst & tasknr = tasknr}
//		= (a,{tst & activated = False})
Rinus Plasmeijer's avatar
Rinus Plasmeijer committed
107 108 109 110 111
	= (a,tst)

// ******************************************************************************************************
// Assigning tasks to users, each user has to be identified by an unique number >= 0

112
assignTaskTo :: !UserId !(LabeledTask a) -> Task a | iData a	
Rinus Plasmeijer's avatar
Rinus Plasmeijer committed
113
assignTaskTo nuserId (taskname,taska) = newTask "assignTaskTo" (mkTask taskname (Task assignTaskTo`))
Rinus Plasmeijer's avatar
Rinus Plasmeijer committed
114
where
Rinus Plasmeijer's avatar
Rinus Plasmeijer committed
115
	assignTaskTo` tst=:{tasknr,activated,userId,workflowLink=(_,(_,processNr,workflowLabel))}
Rinus Plasmeijer's avatar
Rinus Plasmeijer committed
116
	| not activated						= (createDefault,tst)
Rinus Plasmeijer's avatar
Rinus Plasmeijer committed
117
	# (currtime,tst=:{html=ohtml})		= appTaskTSt (appWorldOnce ("Task " +++ taskname +++ " for " +++ toString nuserId) time) tst
Rinus Plasmeijer's avatar
Rinus Plasmeijer committed
118
	# tst								= IF_Ajax (administrateNewThread userId tst) tst 
Rinus Plasmeijer's avatar
Rinus Plasmeijer committed
119
	# (a,tst=:{html=nhtml,activated})	= appTaskTSt (IF_Ajax (UseAjax @>> taska) taska) {tst & html = BT [] [],userId = nuserId}	// activate task of indicated user NEWTRACE
120 121
	| activated 						= (a,{tst & activated = True													// work is done	
												  ,	userId = userId														// restore previous user id						
122
												  ,	html = ohtml +|+ (taskDescriptor currtime activated @@: nhtml)})									// plus new one tagged
123
	= (a,{tst & userId = userId																							// restore user Id
124
			  , html = 	ohtml +|+ (taskDescriptor currtime activated @@: nhtml)
Rinus Plasmeijer's avatar
Rinus Plasmeijer committed
125
		 })												
126 127 128 129 130 131 132 133 134 135 136 137 138
	where
		taskDescriptor currtime activated
		= 	{ delegatorId 	= userId
			, taskWorkerId	= nuserId
			, taskNrId		= toStringTaskNr tasknr
			, processNr		= processNr
			, worflowLabel	= workflowLabel
			, taskPriority	= NormalPriority
			, taskLabel		= taskname
			, timeCreated	= currtime
	 		, curStatus		= activated
	 		} 

Rinus Plasmeijer's avatar
Rinus Plasmeijer committed
139 140 141 142 143

// ******************************************************************************************************
// sequencingtasks

seqTasks :: ![LabeledTask a] -> (Task [a])| iCreateAndPrint a
144
seqTasks [(label,task)] = task =>> \na -> return_V [na]
145
seqTasks options = mkTask "seqTasks" (Task seqTasks`)
Rinus Plasmeijer's avatar
Rinus Plasmeijer committed
146 147 148 149 150 151 152 153
where
	seqTasks` tst=:{tasknr}
	# (val,tst)	 = doseqTasks options [] {tst & tasknr = [-1:tasknr]}
	= (val,{tst & tasknr = tasknr})

	doseqTasks [] accu tst 		= (reverse accu,{tst & activated = True})
	doseqTasks [(taskname,task):ts] accu tst=:{html,options} 
	# (a,tst=:{activated=adone,html=ahtml}) 
154
									= appTaskTSt task {tst & activated = True, html = BT [] []}
155
	| not adone						= (reverse accu,{tst & html = html +|+ BT [showLabel taskname,BrTag [] ,BrTag []] [] +|+ ahtml})
Rinus Plasmeijer's avatar
Rinus Plasmeijer committed
156 157 158
	= doseqTasks ts [a:accu] {tst & html = html +|+ ahtml, options = options}

// ******************************************************************************************************
159
// Select the tasks to do from a list with help of another task for selecting them:
Rinus Plasmeijer's avatar
Rinus Plasmeijer committed
160

161
selectTasks 	:: !(SelectingTask a) !(OrderingTask a) ![LabeledTask a] -> Task [a] | iData a
162
selectTasks chooser executer ltasks = newTask "selectTask" selectTasks`
Rinus Plasmeijer's avatar
Rinus Plasmeijer committed
163
where
164
	selectTasks`
165 166 167 168
	=						chooser ltasks
			=>> \chosen -> 	executer [ltasks!!i \\ i <- chosen | i >=0 && i < lengthltask]
			
	lengthltask = length ltasks
Rinus Plasmeijer's avatar
Rinus Plasmeijer committed
169

170 171
allTasksCond 	:: !String !DisplaySubTasks !(FinishPred a) ![LabeledTask a] -> Task [a] | iData a 
allTasksCond label displayOption pred taskCollection 
172
= 					mkTask label (Task (doandTasks taskCollection))
173 174
where
	doandTasks [] tst	= return [] tst
175 176 177
	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
178
	= (alist,{tst 	& activated = False
179
					, html 		= html +|+ displayOption label tasknr acode				// show all subtasks using the displayOption function
180 181 182
								
			})
	where
183 184 185
		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
186 187 188
		# (taskname,task)		= taskCollection!!ctasknr
		# (a,tst=:{activated = adone,html=html})	
								= appTaskTSt (mkParSubTask traceid ctasknr task) {tst & tasknr = tasknr, activated = True, html = BT [] []} // check tasks
189
		= checkAllTasks traceid taskCollection (inc ctasknr) (if adone [a:alist] alist,[(adone,html):acode]) {tst & tasknr = tasknr}
190

191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212
displayAsTab :: DisplaySubTasks
displayAsTab = displayAsTab`
where
	displayAsTab` label tasknr htmls 
		= CondAnd label nrSubTasks [({ caTaskNrId	= toStringTaskNr [0,i:tasknr]
									  , caIndex		= nrSubTasks
									  , caStatus	= finished	
									  },html) \\ (finished,html) <- htmls & i <- [0..]
									]
	where
		nrSubTasks = length htmls
	

displayAll :: DisplaySubTasks
displayAll = displayAll`
where
	displayAll` label tasknr htmls 
		= foldl (+|+) (BT [] []) (map snd htmls) 


	
	
213
/*
214 215
allTasksCond 	:: !String !(TasksToShow a) !(FinishPred a) ![LabeledTask a] -> Task [a] | iData a 
allTasksCond label chooser pred taskCollection 
216
= 					mkTask "andTasksCond" (Task (doandTasks chooser taskCollection))
217 218 219 220 221 222
where
	lengthltask = length taskCollection 

	doandTasks chooser [] tst	= return [] tst
	doandTasks chooser taskCollection tst=:{tasknr,html,options,userId}
	# ((alist,acode),tst=:{activated=finished,html=allhtml})		
223
						= checkAllTasks label taskCollection 0 True ([],[]) {tst & html = BT [] [],activated = True} 
224 225 226
	| 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"
227 228
	# ((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}		
229 230
	= (alist,{tst 	& activated = finished
					, html = 	html +|+ 									// show previous code
231 232
								((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								
233 234 235 236 237
			})
	where
		showtasks :: !String ![(!Int,!LabeledTask a)] !*TSt -> *(![a],!*TSt) | iCreateAndPrint a
		showtasks _ [] tst			= ([],tst)
		showtasks label [(chosen,(name,chosenTask)):tasks] tst=:{html=html}
238
		# (a,tst=:{html=ahtml}) 	= appTaskTSt (mkParSubTask label chosen chosenTask) {tst & tasknr = tasknr, activated = True, html = BT [] []}
239
		# (as,tst=:{html=ashtml})	= showtasks label tasks {tst & html = BT [] []}
240 241 242 243 244 245 246 247
		= ([a:as],{tst & html = html +|+ ahtml +|+ ashtml})			


		checkAllTasks :: !String ![LabeledTask a] !Int !Bool !(![a],![HtmlTree]) !*TSt -> *(!(![a],![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
		# (taskname,task)		= taskCollection!!ctasknr
		# (a,tst=:{activated = adone,html=html})	
248
								= appTaskTSt (mkParSubTask traceid ctasknr task) {tst & tasknr = tasknr, activated = True, html = BT [] []} // check tasks
249 250
		| 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}
Rinus Plasmeijer's avatar
Rinus Plasmeijer committed
251

252 253 254 255 256

*/



Rinus Plasmeijer's avatar
Rinus Plasmeijer committed
257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275
// ******************************************************************************************************
// Higher order tasks ! Experimental
/* Experimental department:

   May not work when the tasks are garbage collected !!

-!>				:: a task, either finished or interrupted (by completion of the first task) is returned in the closure
				   if interrupted, the work done so far is returned (!) which can be continued somewhere else
channel			:: splits a task in respectively a sender task closure and receiver taskclosure; 
				   when the sender is evaluated, the original task is evaluated as usual;
				   when the receiver task is evaluated, it will wait upon completeion of the sender and then get's its result;
				   Important: Notice that a receiver will never finish if you don't activate the corresponding receiver somewhere.
closureTask		:: The task is executed as usual, but a receiver closure is returned immediately.
				   When the closure is evaluated somewhere, one has to wait until the task is finished.
				   Handy for passing a result to several interested parties.
closureLZTask	:: Same, but now the original task will not be done unless someone is asking for the result somewhere.
*/

(-!>) infix 4  :: (Task s) (Task a) -> (Task (Maybe s,TCl a)) | iCreateAndPrint s & iCreateAndPrint a
276
(-!>)  stoptask task =  mkTask "-!>" (Task stop`)
Rinus Plasmeijer's avatar
Rinus Plasmeijer committed
277 278
where
	stop` tst=:{tasknr,html,options,userId}
279 280 281 282 283
	# (val,tst=:{activated = taskdone,html = taskhtml}) = appTaskTSt task     {tst & activated = True, html = BT [] [], tasknr = normalTaskId,options = options}
	# (s,  tst=:{activated = stopped, html = stophtml})	= appTaskTSt stoptask {tst & activated = True, html = BT [] [], tasknr = stopTaskId,  options = options}
	| stopped	= appTaskTSt (return_V (Just s, TCl (Task (close task))))   {tst & html = html, activated = True}
	| taskdone	= appTaskTSt (return_V (Nothing,TCl (return_V val))) {tst & html = html +|+ taskhtml, activated = True}
	= appTaskTSt (return_V (Nothing,TCl (return_V val))) {tst & html = html +|+ taskhtml +|+ stophtml, activated = False}
Rinus Plasmeijer's avatar
Rinus Plasmeijer committed
284
	where
285
		close t = \tst -> appTaskTSt t {tst & tasknr = normalTaskId, options = options, userId = userId} // reset userId because it influences the task id
Rinus Plasmeijer's avatar
Rinus Plasmeijer committed
286 287 288 289 290

		stopTaskId 		= [-1,0:tasknr]
		normalTaskId  	= [-1,1:tasknr]

channel  :: String (Task a) -> (Task (TCl a,TCl a)) | iCreateAndPrint a
291
channel name task =  mkTask "channel" (Task (doSplit name task))
Rinus Plasmeijer's avatar
Rinus Plasmeijer committed
292 293

doSplit name task tst=:{tasknr,options,userId}
294
= appTaskTSt (return_V (TCl (Task (sender (Task myTask))),TCl (Task (receiver (Task myTask))))) tst
Rinus Plasmeijer's avatar
Rinus Plasmeijer committed
295
where
296
	myTask tst = appTaskTSt task {tst & tasknr = [-1:tasknr], options = options, userId = userId}
Rinus Plasmeijer's avatar
Rinus Plasmeijer committed
297 298 299

	sender task tst=:{activated,tasknr}
	| not activated				= (createDefault,tst)
300
	# (val,tst) 				= appTaskTSt task tst
Rinus Plasmeijer's avatar
Rinus Plasmeijer committed
301 302 303 304
	= (val,{tst & tasknr = tasknr})

	receiver task  tst=:{activated,tasknr,html}
	| not activated			 	= (createDefault,tst)
305
	# (val,tst=:{activated}) 	= appTaskTSt task tst
Rinus Plasmeijer's avatar
Rinus Plasmeijer committed
306 307 308
	| activated	= (val,{tst & html = html, activated = True , tasknr = tasknr})
	= (val,{tst & html = html /*+|+ BT [showText ("Waiting for completion of "<+++ name)]*/, tasknr = tasknr})

Rinus Plasmeijer's avatar
Rinus Plasmeijer committed
309
closureTask  ::  (LabeledTask a) -> (Task (TCl a)) | iCreateAndPrint a
310
closureTask (name, task) = mkTask ("closure " +++ name) (Task mkClosure)
Rinus Plasmeijer's avatar
Rinus Plasmeijer committed
311 312 313
where
	mkClosure tst=:{tasknr,options,userId}
	# ((TCl sa,ra),tst) 	= doSplit name task tst
314
	# (_,tst)     			= appTaskTSt sa {tst & activated = True}
Rinus Plasmeijer's avatar
Rinus Plasmeijer committed
315 316
	= (ra, {tst & activated = True})

Rinus Plasmeijer's avatar
Rinus Plasmeijer committed
317
closureLzTask  :: (LabeledTask a) -> (Task (TCl a)) | iCreateAndPrint a
318
closureLzTask (name, task) = mkTask ("lazy closure " +++ name) (Task mkClosure)
Rinus Plasmeijer's avatar
Rinus Plasmeijer committed
319 320 321
where
	mkClosure tst=:{tasknr,options,userId}
	# ((TCl sa,ra),tst) 	= doSplit name task tst
322
	# (_,tst)     			= appTaskTSt sa tst
Rinus Plasmeijer's avatar
Rinus Plasmeijer committed
323 324 325
	= (ra, {tst & activated = True})

	doSplit name task tst=:{tasknr,options,userId}
326
		= appTaskTSt (return_V (TCl (Task (sender (Task myTask))),TCl (Task (receiver (Task myTask))))) tst
Rinus Plasmeijer's avatar
Rinus Plasmeijer committed
327
	where
328
		myTask tst = appTaskTSt task {tst & tasknr = [-1:tasknr], options = options, userId = userId}
Rinus Plasmeijer's avatar
Rinus Plasmeijer committed
329 330 331 332
	
		sender task tst=:{activated,tasknr}
		| not activated				= (createDefault,tst)
		# (requested,tst)			= (sharedMem id) tst  // is this task demanded ?
333
		| not requested.Form.value	= (createDefault,tst)
334
		# (val,tst) 				= appTaskTSt task tst
Rinus Plasmeijer's avatar
Rinus Plasmeijer committed
335 336
		= (val,{tst & tasknr = tasknr})
	
337
		receiver task tst=:{activated,tasknr,html}
Rinus Plasmeijer's avatar
Rinus Plasmeijer committed
338 339
		| not activated			 	= (createDefault,tst)
		# (requested,tst)			= (sharedMem (\_ -> True)) tst  // this task is now demanded !
340
		# (val,tst=:{activated}) 	= appTaskTSt task tst
Rinus Plasmeijer's avatar
Rinus Plasmeijer committed
341 342 343 344
		| activated	= (val,{tst & html = html, activated = True , tasknr = tasknr})
		= (val,{tst & html = html /*+|+ BT [showText ("Waiting for completion of "<+++ name)]*/, tasknr = tasknr})

		sharedStoreId	= iTaskId userId tasknr "Shared_Store"
345
		sharedMem fun	= liftHst (mkStoreForm (Init,storageFormId options sharedStoreId False) fun)
Rinus Plasmeijer's avatar
Rinus Plasmeijer committed
346 347 348