Commit 8470081e authored by Rinus Plasmeijer's avatar Rinus Plasmeijer

in basic combinators assignTask and chooseTask html dependent part taken apart.

the different kinf of chooseTask combinators (buttons, pull down menu) and the like
are move to the combinator module

I did not do condAnd yet...
parent 35bb2114
......@@ -29,9 +29,9 @@ return_V :: !a -> Task a | iCreateAndPrint a
/*
Assign tasks to user with indicated id:
assignTaskTo :: assign task to indicated user, True for verbose reporting
assignTaskTo :: assign task to indicated user
*/
assignTaskTo :: !Bool !UserId !(LabeledTask a) -> Task a | iData a
assignTaskTo :: !UserId !(LabeledTask a) -> Task a | iData a
/*
Repetition and loops:
......@@ -48,23 +48,10 @@ seqTasks :: do all iTasks one after another, task completed when all done
seqTasks :: ![LabeledTask a] -> Task [a] | iCreateAndPrint a
/*
Choose the tasks you want to do one forehand:
chooseTask_btn :: choose ONE task by pressing a button, True for horizontal buttons, else vertical
chooseTask_pdm :: as chooseTask_btn, depending on pulldownmenu item selected, Int for initial value
chooseTask_radio:: as chooseTask_btn, depending on radio item selected, Int for initial value, htmlcode for option explanation
chooseTask_cb :: choice N tasks out of N, order of chosen task depending on first arg
(initial setting, effect for all when set, explanation) for each option
Select the tasks to do from a given list of tasks:
selectTasks :: the first argument is task yielding the task numbers (index in the list) to do; tasks will be done in this order.
*/
chooseTask_btn :: !HtmlCode !Bool![LabeledTask a] -> Task a | iCreateAndPrint a
chooseTask_pdm :: !HtmlCode !Int ![LabeledTask a] -> Task a | iCreateAndPrint a
chooseTask_radio:: !HtmlCode !Int ![(HtmlCode,LabeledTask a)]
-> Task a | iCreateAndPrint a
chooseTask_cbox :: !([LabeledTask a] -> Task [a])
!HtmlCode ![((!Bool,!ChoiceUpdate,!HtmlCode),LabeledTask a)]
-> Task [a] | iData a
selectTasks :: !([LabeledTask a] -> Task [Int]) [LabeledTask a] -> Task [a] | iData a
/*
Do m Tasks parallel / interleaved and FINISH as soon as SOME Task completes:
......
This diff is collapsed.
......@@ -36,6 +36,26 @@ repeatTask :: repeat Task until predicate is valid
repeatTask :: !(a -> Task a) !(a -> Bool) a -> Task a | iData a
(<|) infixl 6 :: !(Task a) !(a -> (Bool, HtmlCode)) -> Task a | iData a
/*
Choose the tasks you want to do one forehand:
chooseTask_btn :: choose ONE task by pressing a button, True for horizontal buttons, else vertical
chooseTask_pdm :: as chooseTask_btn, depending on pulldownmenu item selected, Int for initial value
chooseTask_radio:: as chooseTask_btn, depending on radio item selected, Int for initial value, htmlcode for option explanation
chooseTask_cb :: choice N tasks out of N, order of chosen task depending on first arg
(initial setting, effect for all when set, explanation) for each option
*/
chooseTask_btn :: !HtmlCode !Bool![LabeledTask a] -> Task a | iData a
chooseTask_pdm :: !HtmlCode !Int ![LabeledTask a] -> Task a | iData a
chooseTask_radio:: !HtmlCode !Int ![(HtmlCode,LabeledTask a)]
-> Task a | iData a
chooseTask_cbox :: !([LabeledTask a] -> Task [a])
!HtmlCode ![((!Bool,!ChoiceUpdate,!HtmlCode),LabeledTask a)]
-> Task [a] | iData a
/* Choose out the tasks you want to do one forehand, labels are used to make the choice:
button :: return value when button pressed
buttonTask :: do the iTask when button pressed
......@@ -51,10 +71,10 @@ mchoiceTask2 :: as mchoiceTask, boolean used for initial setting of the checks
mchoiceTask3 :: as mchoiceTask2, function can be used to (re)set the checkboxes
*/
button :: !String !a -> Task a | iCreateAndPrint a
buttonTask :: !String !(Task a) -> Task a | iCreateAndPrint a
chooseTask :: !HtmlCode ![LabeledTask a] -> Task a | iCreateAndPrint a
chooseTaskV :: !HtmlCode ![LabeledTask a] -> Task a | iCreateAndPrint a
button :: !String !a -> Task a | iData a
buttonTask :: !String !(Task a) -> Task a | iData a
chooseTask :: !HtmlCode ![LabeledTask a] -> Task a | iData a
chooseTaskV :: !HtmlCode ![LabeledTask a] -> Task a | iData a
mchoiceTasks :: !HtmlCode ![LabeledTask a] -> Task [a] | iData a
mchoiceTasks2 :: !HtmlCode ![(!Bool,LabeledTask a)] -> Task [a] | iData a
......
This diff is collapsed.
......@@ -128,7 +128,7 @@ where
scheduleWorkflows :: !(Task a) -> (Task a) | iData a
scheduleWorkflows maintask
# nmaintask = newTask defaultWorkflowName (assignTaskTo False 0 ("main",maintask))
# nmaintask = newTask defaultWorkflowName (assignTaskTo 0 ("main",maintask))
= IF_Ajax
(IF_ClientServer // we running both client and server
(IF_ClientTasks
......@@ -187,15 +187,11 @@ 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}) = newTask label (assignTaskTo False currentWorker ("main",task)) tst
# (a,tst=:{activated}) = newTask label (assignTaskTo currentWorker ("main",task)) tst
// # (a,tst=:{activated}) = newTask label (assignTaskTo False userid ("main",task)) tst
# dyn = dynamic a
| not activated = (dyn,tst) // not finished, return
# ((_,wfls),tst) = workflowProcessStore id tst // read workflow process administration
// # wfls = case (wfls!!(entry - 1)) of // update process administration
// (ActiveWorkflow _ acttask) -> updateAt (entry - 1) (FinishedWorkflow (currentWorker,processid,label) dyn acttask) wfls
// _ -> wfls
# wfls = case (wfls!!(entry - 1)) of // update process administration
(ActiveWorkflow wid acttask) -> updateAt (entry - 1) (FinishedWorkflow wid dyn acttask) wfls
_ -> wfls
......
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