test.icl 1.3 KB
Newer Older
1 2
module test

3
import StdEnv, StdiTasks, iData
4 5

// Test program to experiment with the new ExtJS based Web-GUI
6 7
derive gForm []
derive gUpd []
8

9 10


11
Start :: *World -> *World
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
Start world = startTaskEngine ("My mian example", StartUp simples) 0 world

StartUp :: [Task a] -> Task Void | iData a
StartUp tasks = foreverTask selectOne
where
	selectOne
	=			chooseTask [Text "Startup a new task"] 
					[ ("Start Task " <+++ i, startProcess ("Start Task " <+++ i, task)) \\ task <- tasks & i <- [0..]]
		#>>		return_V Void



startProcess (label, task)
	=			spawnWorkflow 0 True (label, mytask)
		#>>		return_V Void
where
	mytask 
	=			task
//		#>>		deleteMe
//		#>> 	return_V Void


simples = [editTask "OK 0" 0, editTask "OK 1" 1, editTask "OK 2" 2]

36

Rinus Plasmeijer's avatar
Rinus Plasmeijer committed
37
myTask5
38
= andTasks  
Rinus Plasmeijer's avatar
Rinus Plasmeijer committed
39 40 41 42
	[("Coffee: 100",    editTask "OK" (100,"Coffee"))
	,("Cappucino: 150", editTask "OK" (150,"Cappucino"))
	,("Tea: 50",        editTask "OK" (50, "Tea"))
	,("Chocolate: 100", editTask "OK" (100,"Chocolate"))
Rinus Plasmeijer's avatar
Rinus Plasmeijer committed
43 44 45
	] 
	=>> \v -> editTask "OK" v
	
46

Rinus Plasmeijer's avatar
Rinus Plasmeijer committed
47 48
myTask4 
=	seqTasks [("taak1",ed 0 0),("taak2", ed 1 1)] 
49

Rinus Plasmeijer's avatar
Rinus Plasmeijer committed
50 51
myTask3
=	myTask -||- myTask
52 53


Rinus Plasmeijer's avatar
Rinus Plasmeijer committed
54 55 56 57
myTask2 
= 				0 @:: ed 0 0
	=>> \v ->	0 @:: ed 1 v
	=>> \v ->	0 @:: ed 2 v
58

59

Rinus Plasmeijer's avatar
Rinus Plasmeijer committed
60 61 62 63
myTask 
= 				ed 0 0
	=>> \v ->	ed 1 v
	=>> \v ->	ed 2 v
64

65

Rinus Plasmeijer's avatar
Rinus Plasmeijer committed
66
ed i j = editTask ("OK " <+++ i) j