From dda68fb7dfc802f76fa1caa194883c4bf5c948c6 Mon Sep 17 00:00:00 2001 From: Rinus Plasmeijer Date: Mon, 14 Apr 2008 13:47:08 +0000 Subject: [PATCH] *** empty log message *** git-svn-id: https://svn.cs.ru.nl/repos/iTask-system/trunk@137 63da3aa8-80fd-4f01-9db8-e6ea747a3da2 --- iTasks/iTasks.dcl | 12 +++++++++--- iTasks/iTasks.icl | 12 ++++++++---- iTasks/iTasksDB.dcl | 4 ---- 3 files changed, 17 insertions(+), 11 deletions(-) diff --git a/iTasks/iTasks.dcl b/iTasks/iTasks.dcl index 0ddc9cab8..cf36db51c 100644 --- a/iTasks/iTasks.dcl +++ b/iTasks/iTasks.dcl @@ -66,13 +66,19 @@ instance @>> SubPage // default: the *whole* page will be updated when a singleUserTask :: iTask start function for defining tasks for one, single user multiUserTask :: iTask start function for multi-users, with option in window to switch between [0..users - 1] -workFlowTask :: iTask start function for a real workflow, expects a login task and the actual task +workFlowTask :: iTask start function for a real workflow + - the first arument has to be an itask which is used for login purposes; it should yield + Bool: True, is the user a new one: if so the second argument is spawned as a separate task for that user + UserId: the id of that user + - the second argument is workflow that will spawned as a task + (True if we have new user,user id of the user, has ) : + - the second one is the actual function for that user a predefined login task is defined in iTaskLogin.dcl */ singleUserTask :: ![StartUpOptions] !(Task a) !*HSt -> (!Bool,Html,*HSt) | iData a multiUserTask :: ![StartUpOptions] !(Task a) !*HSt -> (!Bool,Html,*HSt) | iData a -workFlowTask :: ![StartUpOptions] !(Task (Bool,UserId,a)) - !((Bool,UserId,a) -> Task b)!*HSt -> (!Bool,Html,*HSt) | iData b +workFlowTask :: ![StartUpOptions] !(Task ((Bool,UserId),a)) + !(UserId a -> LabeledTask b) !*HSt -> (!Bool,Html,*HSt) | iData b :: StartUpOptions = TraceOn | TraceOff // for single & multiUser: default = TraceOn | ThreadStorage Lifespan // for Ajax: where to store threadinformation: default = TxtFile diff --git a/iTasks/iTasks.icl b/iTasks/iTasks.icl index c2f0b2706..0d6648265 100644 --- a/iTasks/iTasks.icl +++ b/iTasks/iTasks.icl @@ -232,11 +232,11 @@ multiUserTask startUpOptions maintask hst (if userOptions.traceOn (idform.changed,idform.form) (False,[])) userOptions maintask tst = mkHtmlExcep "multiUser" exception html hst -workFlowTask :: ![StartUpOptions] !(Task (Bool,UserId,a)) !((Bool,UserId,a) -> Task b) !*HSt -> (!Bool,Html,*HSt) | iData b -workFlowTask startUpOptions taska iataskb hst +workFlowTask :: ![StartUpOptions] !(Task ((Bool,UserId),a)) !(UserId a -> LabeledTask b) !*HSt -> (!Bool,Html,*HSt) | iData b +workFlowTask startUpOptions taska userTask hst # userOptions = determineUserOptions startUpOptions # tst = initTst -1 userOptions.threadStorageLoc hst -# ((new,i,a),tst=:{activated,html,hst}) = taska tst // for doing the login +# (((new,i),a),tst=:{activated,html,hst}) = taska tst // for doing the login | not activated # iTaskHeader = [showHighLight "i-Task", showLabel " - Multi-User Workflow System ",Hr []] # iTaskInfo = mkDiv "iTaskInfo" [showText "Login procedure... ", Hr []] @@ -244,7 +244,7 @@ workFlowTask startUpOptions taska iataskb hst ]] hst # userOptions = determineUserOptions [TestModeOff, VersionCheck, ThreadStorage TxtFile:startUpOptions] # tst = initTst i userOptions.threadStorageLoc hst -# (exception,body,hst) = startTstTask i True (False,[]) userOptions (iataskb (new,i,a)) tst +# (exception,body,hst) = startTstTask i True (False,[]) userOptions (newUserTask ((new,i),a) <<@ TxtFile) tst = mkHtmlExcep "workFlow" exception body hst where noFilter :: HtmlTree -> HtmlCode @@ -255,6 +255,10 @@ where noFilter (htmlL +|+ htmlR) = noFilter htmlL <|.|> noFilter htmlR noFilter (DivCode str html) = noFilter html + newUserTask ((True,i),a) = (spawnWorkflow i True (userTask i a)) =>> \_ -> return_V Void + newUserTask _ = return_V Void + + /* workFlowTask :: ![StartUpOptions] !(Task (UserId,a)) !((UserId,a) -> Task b) !*HSt -> (!Bool,Html,*HSt) | iData b workFlowTask startUpOptions taska iataskb hst diff --git a/iTasks/iTasksDB.dcl b/iTasks/iTasksDB.dcl index 63ebebace..6c6d04108 100644 --- a/iTasks/iTasksDB.dcl +++ b/iTasks/iTasksDB.dcl @@ -16,9 +16,6 @@ mkDBid :: create a typed database identificator only Database and TxtFile are currently supported readDB :: read the database writeDB :: write the database - -readDB2 :: read the database, each and everytime the application is evaluated - dangerous: not referential transparent, only use it if you know what you are doing ! */ mkDBid :: String Lifespan -> (DBid a) @@ -26,4 +23,3 @@ mkDBid :: String Lifespan -> (DBid a) readDB :: (DBid a) -> Task a | iData a writeDB :: (DBid a) a -> Task a | iData a -readDB2 :: (DBid a) -> Task a | iData a -- GitLab