Commit c29dd994 authored by Bas Lijnse's avatar Bas Lijnse

Standardized use of subjects and descriptions for tasks.

IMPORTANT: this update changes the API of interactive tasks

git-svn-id: https://svn.cs.ru.nl/repos/iTask-system/trunk@1139 63da3aa8-80fd-4f01-9db8-e6ea747a3da2
parent 9e0d009f
......@@ -3,26 +3,34 @@ Ext.ns('itasks.ttc');
itasks.ttc.FormContainer = Ext.extend(itasks.ttc.InteractionBase, {
initComponent : function() {
this.cls = 'FormContainer';
this.cls = 'FormContainer';
itasks.ttc.FormContainer.superclass.initComponent.apply(this,arguments);
},
buildComponents: function(data){
this.panel = new itasks.ttc.form.FormPanel({
xtype: 'itasks.ttc.form.panel',
items: data.content.form,
buttons: data.content.buttons,
width: 720
});
this.descpanel = {
xtype: 'itasks.ttc.common.description',
cls: 'FormDescription',
description: data.description,
this.subjectpanel = {
xtype: 'itasks.ttc.common.subject',
cls: 'TTCSubject',
subject: data.subject,
headerButton: this.headerButton,
width: 720
}
};
this.descriptionpanel = {
xtype: 'panel',
cls: 'TTCDescription',
unstyled: true,
html: data.description,
width: 720
};
console.log(data.subject);
console.log(data.description);
},
update: function(data) {
......@@ -65,13 +73,16 @@ itasks.ttc.FormContainer = Ext.extend(itasks.ttc.InteractionBase, {
break;
}
}
} else {
} else {
//Completely replace form
this.taskId = data.taskId;
this.removeAll();
this.buildComponents(data);
this.add(this.descpanel);
this.add(this.subjectpanel);
this.add(this.descriptionpanel);
this.add(this.panel);
this.doLayout();
......
......@@ -87,12 +87,7 @@ itasks.ttc.GroupContainer = Ext.extend(Ext.Panel,{
}];
}
if(cont.xtype == 'itasks.ttc.proc-control')
var title = 'Control process properties';
else if(cont.xtype == 'itasks.ttc.monitor')
var title = 'Monitor task';
else
var title = cont.description || cont.label;
var title = cont.subject;
this.floatingCont.add(idx, {
id: this.taskId + '_' + idx,
......
......@@ -8,16 +8,16 @@ itasks.ttc.InstructionContainer = Ext.extend(Ext.Panel,{
, unstyled: true
, taskUpdates : {}
, items: [
{ xtype: 'itasks.ttc.common.description'
, cls: 'InstructionContainer-Description'
, description: this.label
{ xtype: 'itasks.ttc.common.subject'
, cls: 'TTCSubject'
, subject: this.subject
, headerButton: this.headerButton
, width: 720
},
{ xtype: 'panel'
, unstyled: true
, html: this.instruction
, cls: 'InstructionContainer-Text'
, html: this.description
, cls: 'TTCDescription'
, width: 720
}
]});
......
......@@ -11,7 +11,7 @@ itasks.ttc.InteractionBase = Ext.extend(Ext.Panel, {
{ layout: 'anchor'
, taskUpdates : {}
, url: itasks.config.serverUrl + '/work/tab'
, items: [this.descpanel,this.panel]
, items: [this.subjectpanel,this.descriptionpanel,this.panel]
, unstyled: true
, autoScroll: true
});
......
......@@ -13,15 +13,22 @@ itasks.ttc.MessageContainer = Ext.extend(itasks.ttc.InteractionBase, {
xtype: 'itasks.ttc.message.panel',
items: data.content.form,
buttons: data.content.buttons
}
};
this.descpanel = {
xtype: 'itasks.ttc.common.description',
cls: 'MessageDescription',
description: data.description,
this.subjectpanel = {
xtype: 'itasks.ttc.common.subject',
cls: 'TTCSubject',
subject: data.subject,
headerButton: this.headerButton,
width: 720
}
};
this.descriptionpanel = {
xtype: 'panel',
cls: 'TTCDescription',
html: data.description,
unstyled: true,
width: 720
};
},
update: function(data){
......
......@@ -10,13 +10,18 @@ itasks.ttc.MonitorContainer = Ext.extend(Ext.Panel,{
unstyled: true,
cls: 'MonitorContainer',
items: [
{ xtype: 'itasks.ttc.common.description'
, cls: 'MonitorContainerDescription'
, description: 'Monitor task'
{ xtype: 'itasks.ttc.common.subject'
, cls: 'MonitorContainer-Subject'
, subject: this.subject
, headerButton: this.headerButton
, width: 720
},
{ xtype: 'panel'
, cls: 'MonitorContainer-Description'
, html: this.description
, width: 720
},
{ xtype: 'panel'
, cls: 'MonitorPanel'
, unstyled: true
, html: this.html
......
......@@ -15,9 +15,9 @@ itasks.ttc.ParallelContainer = Ext.extend(Ext.Panel, {
, autoScroll: true
, cls: 'ParallelControlContainer'
, items: [
{ cls: 'task-description ParallelControlDescription'
{ cls: 'TTCSubject'
, unstyled: true
, html: this.label
, html: this.subject
, width: 720
},
{ bodyStyle: 'padding: 4px'
......
......@@ -6,11 +6,11 @@ itasks.ttc.ProcessControlContainer = Ext.extend(Ext.Panel,{
Ext.apply(this,
{ unstyled: true
, cls: 'ProcessControlContainer'
, description: 'Control process properties'
, subject: 'Control process properties'
, items: [
{ xtype: 'itasks.ttc.common.description'
{ xtype: 'itasks.ttc.common.subject'
, cls: 'ProcessControlDescription'
, description: 'Control process properties'
, subject: 'Control process properties'
, headerButton: this.headerButton
, width: 720
},
......
......@@ -6,7 +6,7 @@ itasks.ttc.ResultContainer = Ext.extend(Ext.Panel,{
{ unstyled: true
, cls: 'ResultContainer'
, width: 720
, html: '<div class="ResultContainer-Description task-description">'+this.label+'</div><div class="ResultContainer-Text">'+this.result+'</div>'
, html: '<div class="TTCDescription">'+this.subject+'</div><div class="ResultContainer-Text">'+this.result+'</div>'
});
itasks.ttc.ResultContainer.superclass.initComponent.apply(this,arguments);
......@@ -14,9 +14,9 @@ itasks.ttc.ResultContainer = Ext.extend(Ext.Panel,{
update: function(data){
if(this.rendered){
this.body.html = '<div class="ResultContainer-Description task-description">'+data.label+'</div><div class="ResultContainer-Text">'+data.result+'</div>'
this.body.html = '<div class="TTCDescription">'+data.subject+'</div><div class="ResultContainer-Text">'+data.result+'</div>'
}else{
this.html = '<div class="ResultContainer-Description task-description">'+data.label+'</div><div class="ResultContainer-Text">'+data.result+'</div>'
this.html = '<div class="TTCDescription">'+data.subject+'</div><div class="ResultContainer-Text">'+data.result+'</div>'
}
}
});
......
......@@ -155,22 +155,21 @@ itasks.ttc.common.attachDocumentLinkInformation = function() {
}
};
itasks.ttc.common.DescriptionPanel = Ext.extend(Ext.Panel,{
itasks.ttc.common.SubjectPanel = Ext.extend(Ext.Panel,{
initComponent : function(){
Ext.apply(this,{
cls: this.cls + ' task-description',
unstyled: true
});
if(Ext.isDefined(this.headerButton)) {
this.items = [{html: this.description, unstyled: true, columnWidth: 1}, this.headerButton];
this.items = [{html: this.subject, unstyled: true, columnWidth: 1}, this.headerButton];
this.layout = 'column';
} else {
this.items = [{html: this.description, unstyled: true}];
this.items = [{html: this.subject, unstyled: true}];
}
itasks.ttc.common.DescriptionPanel.superclass.initComponent.apply(this,arguments);
itasks.ttc.common.SubjectPanel.superclass.initComponent.apply(this,arguments);
}
});
......@@ -233,4 +232,4 @@ itasks.ttc.common.setupHotkeys = function(tb, parent) {
parent.keyMap = new Ext.KeyMap(parent.getEl(), conf);
};
Ext.reg('itasks.ttc.common.description', itasks.ttc.common.DescriptionPanel);
\ No newline at end of file
Ext.reg('itasks.ttc.common.subject', itasks.ttc.common.SubjectPanel);
\ No newline at end of file
......@@ -2,6 +2,21 @@
Layout Styles of TaskTree Components
*/
/* Shared subject and description panels */
.TTCSubject {
background-image : url('img/ttc-icons/TTCDescriptionBackground.png') !important;
background-repeat: repeat-x;
border: 1px solid #99BBE8;
margin: 10px 10px 0px 10px;
font-weight: bold;
}
.TTCDescription {
background-image : url('img/ttc-icons/TTCBackground80.png') !important;
border: 1px solid #99BBE8;
margin: 0px 10px 0px 10px;
padding: 5px;
}
/* Form Container */
.FormContainer {
background-color: #eee;
......@@ -21,26 +36,17 @@
background-repeat: repeat;
}
.FormDescription {
background-image : url('img/ttc-icons/TTCDescriptionBackground.png') !important;
background-repeat: repeat-x;
border: 1px solid #99BBE8;
margin: 10px 10px 0px 10px;
}
/* Group Container */
.GroupContainer {
background-color: #eee;
}
.GroupFixedNoFocus .x-panel-fbar {
display: none;
}
.GroupFixed .x-plain-tbar {
display: none;
}
/*
.GroupFixedNoFocus .FormPanel,
.GroupFixedNoFocus .ProcessControlPanel,
.GroupFixedNoFocus .InstructionContainer-Text,
......@@ -53,13 +59,11 @@
border-right:1px solid #ddd;
background-repeat: repeat;
}
*/
.GroupFixedNoFocus .task-description {
.GroupFixedNoFocus .TTCSubject {
background-image: url("img/ttc-icons/TTCDescriptionBackgroundNoFocus.png") !important;
border:1px solid #ddd;
}
.GroupFixedNoFocus .task-description {
color:#888899;
}
......@@ -71,6 +75,7 @@
display: none;
}
.GroupFloating .TTCDescription,
.GroupFloating .FormPanel,
.GroupFloating .ProcessControlPanel,
.GroupFloating .InstructionContainer-Text,
......@@ -82,7 +87,7 @@
width: auto;
}
.GroupFloating .task-description {
.GroupFloating .TTCSubject {
display: none;
}
......@@ -262,13 +267,20 @@
background-repeat: repeat;
}
.MessageDescription {
.MessageContainer-Subject {
background-image : url('img/ttc-icons/TTCDescriptionBackground.png') !important;
background-repeat: repeat-x;
border: 1px solid #99BBE8;
margin: 10px 0px 0px 10px;
width: 700px;
}
.MessageContainer-Description {
background-image : url('img/ttc-icons/TTCBackground80.png') !important;
border: 1px solid #99BBE8;
margin: 0px 10px 0px 10px;
padding: 5px;
width: 700px;
}
/* Monitor Container */
.MonitorContainer {
......@@ -289,10 +301,5 @@
background-repeat: repeat;
}
.MonitorContainerDescription {
background-image : url('img/ttc-icons/TTCDescriptionBackground.png') !important;
background-repeat: repeat-x;
border: 1px solid #99BBE8;
margin: 10px 0px 0px 10px;
width: 700px;
}
......@@ -72,7 +72,7 @@ reportIncident
= enterIncident >>= chooseResponse >>= allTasks
where
enterIncident :: Task Incident
enterIncident = enterInformation "Incident" "Describe the incident"
enterIncident = enterInformation "Incident report" "Describe the incident"
chooseResponse :: Incident -> Task [Task Void]
chooseResponse incident
......
......@@ -93,7 +93,7 @@ where
editor file = createEditor (EditorState file.TextFile.content (OpenedFile file)) textEditorFile <<@ GBFloating
about :: Task GAction
about = showMessageAbout "About" "iTextEditor July 2010" GContinue
about = showMessage "About" "iTextEditor July 2010" GContinue
quit :: !(MDIIterateEditors EditorState Bool) -> Task GAction
quit iterateEditors =
......
......@@ -5,4 +5,10 @@ import TSt
applyChangeToProcess :: !ProcessId !ChangeDyn !ChangeLifeTime -> Task Void
applyChangeToProcess pid change lifetime
= mkInstantTask "applyChangeToProcess" (\tst -> (TaskFinished Void, applyChangeToTaskTree pid (lifetime,change) tst))
\ No newline at end of file
= mkInstantTask "Apply a change to a process" ("Apply a " +++ lt +++ " change to task " +++ pid)
(\tst -> (TaskFinished Void, applyChangeToTaskTree pid (lifetime,change) tst))
where
lt = case lifetime of
CLTransient = "transient"
CLPersistent _ = "persistent"
\ No newline at end of file
......@@ -8,16 +8,16 @@ import CommonDomain
import CoreCombinators
getCurrentTime :: Task Time
getCurrentTime = mkInstantTask "getCurrentTime" (mkTaskFunction (accWorldTSt currentTime))
getCurrentTime = mkInstantTask "Get current time" "Determine the current time" (mkTaskFunction (accWorldTSt currentTime))
getCurrentDate :: Task Date
getCurrentDate = mkInstantTask "getCurrentDate" (mkTaskFunction (accWorldTSt currentDate))
getCurrentDate = mkInstantTask "Get current date" "Determine the current date" (mkTaskFunction (accWorldTSt currentDate))
getCurrentDateTime :: Task DateTime
getCurrentDateTime = mkInstantTask "getCurrentDateTime" (mkTaskFunction (accWorldTSt currentDateTime))
getCurrentDateTime = mkInstantTask "Get current datetime" "Determine the current date and time." (mkTaskFunction (accWorldTSt currentDateTime))
waitForTime :: !Time -> Task Void
waitForTime time = mkMonitorTask "waitForTime" waitForTime`
waitForTime time = mkMonitorTask "Wait for time" ("Wait until " +++ toString time) waitForTime`
where
waitForTime` tst
# (now,tst) = accWorldTSt currentTime tst
......@@ -28,7 +28,7 @@ where
= (TaskFinished Void,tst)
waitForDate :: !Date -> Task Void
waitForDate date = mkMonitorTask "waitForDate" waitForDate`
waitForDate date = mkMonitorTask "Wait for date" ("Wait until " +++ toString date) waitForDate`
where
waitForDate` tst
# (now,tst) = accWorldTSt currentDate tst
......@@ -39,5 +39,4 @@ where
= (TaskBusy,tst)
waitForTimer :: !Time -> Task Void
waitForTimer time
= getCurrentTime >>= \now -> waitForTime (now + time)
waitForTimer time = getCurrentTime >>= \now -> waitForTime (now + time)
......@@ -5,22 +5,22 @@ import TSt, DocumentDB
import StdFile, CSV
exportDocument :: !String !Document -> Task Document
exportDocument filename document = mkInstantTask ("Export of document " +++ filename) (writeDocument filename document)
exportDocument filename document = mkInstantTask "Document export" ("Export of document " +++ filename) (writeDocument filename document)
exportTextFile :: !String !String -> Task String
exportTextFile filename content = mkInstantTask ("Export of text file " +++ filename) (fileTask filename content writeAll)
exportTextFile filename content = mkInstantTask "Text file export" ("Export of text file " +++ filename) (fileTask filename content writeAll)
exportCSVFile :: !String ![[String]] -> Task [[String]]
exportCSVFile filename content = mkInstantTask ("Export of CSV file " +++ filename) (fileTask filename content writeCSVFile)
exportCSVFile filename content = mkInstantTask "CSV file export" ("Export of CSV file " +++ filename) (fileTask filename content writeCSVFile)
exportCSVFileWith :: !Char !Char !Char !String ![[String]] -> Task [[String]]
exportCSVFileWith delimitChar quoteChar escapeChar filename content = mkInstantTask ("Export of CSV file " +++ filename) (fileTask filename content (writeCSVFileWith delimitChar quoteChar escapeChar))
exportCSVFileWith delimitChar quoteChar escapeChar filename content = mkInstantTask "CSV file export" ("Export of CSV file " +++ filename) (fileTask filename content (writeCSVFileWith delimitChar quoteChar escapeChar))
exportJSONFile :: !String a -> Task a | JSONEncode{|*|} a
exportJSONFile filename content = exportJSONFileWith toJSON filename content
exportJSONFileWith :: !(a -> JSONNode) !String a -> Task a
exportJSONFileWith encoder filename content = mkInstantTask ("Export of JSON file " +++ filename) (fileTask filename content (writeJSON encoder))
exportJSONFileWith encoder filename content = mkInstantTask "JSON file export" ("Export of JSON file " +++ filename) (fileTask filename content (writeJSON encoder))
fileTask filename content f tst=:{TSt|iworld=iworld=:{IWorld|world}}
# (ok,file,world) = fopen filename FWriteData world
......
......@@ -7,22 +7,22 @@ import TSt, DocumentDB, ExtToMime, Text, Util
CHUNK_SIZE :== 1024
importDocument :: !String -> Task Document
importDocument filename = mkInstantTask ("Import of document " +++ filename) (readDocument filename)
importDocument filename = mkInstantTask "Document import" ("Import of document " +++ filename) (readDocument filename)
importTextFile :: !String -> Task String
importTextFile filename = mkInstantTask ("Import of text file " +++ filename) (fileTask filename readAll)
importTextFile filename = mkInstantTask "Text file import" ("Import of text file " +++ filename) (fileTask filename readAll)
importCSVFile :: !String -> Task [[String]]
importCSVFile filename = mkInstantTask ("Import of CSV file " +++ filename) (fileTask filename readCSVFile)
importCSVFile filename = mkInstantTask "CSV file import" ("Import of CSV file " +++ filename) (fileTask filename readCSVFile)
importCSVFileWith :: !Char !Char !Char !String -> Task [[String]]
importCSVFileWith delimitChar quoteChar escapeChar filename = mkInstantTask ("Import of CSV file " +++ filename) (fileTask filename (readCSVFileWith delimitChar quoteChar escapeChar))
importCSVFileWith delimitChar quoteChar escapeChar filename = mkInstantTask "CSV file import" ("Import of CSV file " +++ filename) (fileTask filename (readCSVFileWith delimitChar quoteChar escapeChar))
importJSONFile :: !String -> Task a | JSONDecode{|*|} a
importJSONFile filename = mkInstantTask ("Import of JSON file " +++ filename) (readJSON filename fromJSON)
importJSONFile filename = mkInstantTask "JSON file import" ("Import of JSON file " +++ filename) (readJSON filename fromJSON)
importJSONFileWith :: !(JSONNode -> Maybe a) !String -> Task a
importJSONFileWith parsefun filename = mkInstantTask ("Import of JSON file " +++ filename) (readJSON filename parsefun)
importJSONFileWith parsefun filename = mkInstantTask "JSON file import" ("Import of JSON file " +++ filename) (readJSON filename parsefun)
fileTask filename f tst=:{TSt|iworld=iworld=:{IWorld|world}}
# (ok,file,world) = fopen filename FReadData world
......
......@@ -319,7 +319,7 @@ updateSharedLocal :: question ![TaskAction s] !s ![View s] -> Task (!Action, !s
// This html class makes it possible to use either strings, or html as description/message/instruction
class html a
where
html :: a -> [HtmlTag]
html :: a -> HtmlTag
instance html String
instance html [HtmlTag]
\ No newline at end of file
......@@ -12,21 +12,21 @@ derive bimap (,), Maybe
getMenus :: Task (Maybe [Menu])
getMenus
= mkInstantTask "getMenus" getMenus`
= mkInstantTask "Get menus" "Access the menus set for the current process." getMenus`
where
getMenus` tst=:{TSt|menus}
= (TaskFinished menus, tst)
setMenus :: ![Menu] -> Task Void
setMenus menus
= mkInstantTask "setMenus" (setMenus` (Just menus))
= mkInstantTask "Set menus" "Set the menus for the current process." (setMenus` (Just menus))
setMenus` :: !(Maybe [Menu]) !*TSt -> (!TaskResult Void,!*TSt)
setMenus` menus tst
= (TaskFinished Void, {TSt|tst & menus = menus, menusChanged = True})
removeMenus :: Task Void
removeMenus = mkInstantTask "removeMenus" (setMenus` Nothing)
removeMenus = mkInstantTask "Remove menus" "Remove the menus for the current process." (setMenus` Nothing)
setMenuItem :: !String !MenuItem -> Task Void
setMenuItem updName newItem =
......
......@@ -16,7 +16,7 @@ pathToPDString :: !Path -> Task String
pathToPDString path = accWorld (pathToPD_String path)
callProcessBlocking :: !Path ![String] -> Task Int
callProcessBlocking cmd args = mkInstantTask "callProcess" callProcess`
callProcessBlocking cmd args = mkInstantTask "Call process (blocking)" "Running command" callProcess`
where
callProcess` tst=:{TSt|iworld=iworld=:{IWorld|world}}
# (os,world) = worldGetToolbox world
......@@ -30,10 +30,9 @@ where
| otherwise = (TaskFinished ret, tst)
callProcess :: !message !Path ![String] -> Task Int | html message
callProcess msg cmd args = mkMonitorTask "callProcess" callProcess`
callProcess msg cmd args = mkMonitorTask "Call process" ("Running command: " +++ (toString (html msg))) callProcess`
where
callProcess` tst
# tst = setStatus (html msg) tst
# (mbHandle, tst) = getTaskStore "handle" tst
# tst=:{TSt|iworld=iworld=:{IWorld|world}}
= tst
......@@ -79,7 +78,7 @@ mkCmdString path args world
= (foldl (\cmd arg -> cmd +++ " " +++ arg) pathStr args, world)
readTextFile :: !Path -> Task String
readTextFile path = mkInstantTask "readTextFile" readTextFile`
readTextFile path = mkInstantTask "Read text file" "Read a text file" readTextFile`
where
readTextFile` tst=:{TSt|iworld=iworld=:{IWorld|world}}
# (pathStr, world) = pathToPD_String path world
......@@ -105,7 +104,7 @@ where
| otherwise = readFile file [str:acc]
writeTextFile :: !String !Path -> Task Void
writeTextFile text path = mkInstantTask "writeTextFile" writeTextFile`
writeTextFile text path = mkInstantTask "Write text file" "Write a text file" writeTextFile`
where
writeTextFile` tst=:{TSt|iworld=iworld=:{IWorld|world}}
# (pathStr, world) = pathToPD_String path world
......@@ -122,14 +121,14 @@ where
fileException pathStr prob = (dynamic (FileException pathStr prob))
fileExists :: !Path -> Task Bool
fileExists path = mkInstantTask "fileExists" fileExists`
fileExists path = mkInstantTask "File exists check" "Check if a file exists" fileExists`
where
fileExists` tst=:{TSt|iworld=iworld=:{IWorld|world}}
# (pathStr, world) = pathToPD_String path world
= (TaskFinished (winFileExists pathStr), {TSt|tst & iworld = {IWorld|iworld & world = world}})
isDirectory :: !Path -> Task Bool
isDirectory path = mkInstantTask "isDirectory" isDirectory`
isDirectory path = mkInstantTask "Directory check" "Check if a path is a directory" isDirectory`
where
isDirectory` tst=:{TSt|iworld=iworld=:{IWorld|world}}
# (pathStr, world) = pathToPD_String path world
......@@ -144,7 +143,7 @@ where
}
createDirectory :: !Path -> Task Void
createDirectory path = mkInstantTask "createDirectory" createDirectory`
createDirectory path = mkInstantTask "Create directory" "Create a directory on the server's filesystem" createDirectory`
where
createDirectory` tst=:{TSt|iworld=iworld=:{IWorld|world}}
# (pathStr, world) = pathToPD_String path world
......@@ -162,7 +161,7 @@ where
}
getAppPath :: Task String
getAppPath = mkInstantTask "getAppPath" getAppPath`
getAppPath = mkInstantTask "Get application path" "Determine the path of the server executable" getAppPath`
where
getAppPath` tst=:{TSt|iworld=iworld=:{IWorld|world}}
# (os,world) = worldGetToolbox world
......
......@@ -33,25 +33,31 @@ where
toProcessId (ProcessRef pid) = pid
getProcess :: !pid -> Task (Maybe Process) | toProcessId pid
getProcess pid = mkInstantTask "getProcess" (mkTaskFunction (\tst -> 'ProcessDB'.getProcess (toProcessId pid) tst))
getProcess pid = mkInstantTask "Get process" "Read a process from the database."
(mkTaskFunction (\tst -> 'ProcessDB'.getProcess (toProcessId pid) tst))
getProcessForUser :: !User !pid -> Task (Maybe Process) | toProcessId pid
getProcessForUser user pid = mkInstantTask "getProcessForUser" (mkTaskFunction (\tst -> 'ProcessDB'.getProcessForUser user (toProcessId pid) tst))
getProcessForUser user pid = mkInstantTask "Get process for user" "Read a process from the database with a check if a user needs to work on it."
(mkTaskFunction (\tst -> 'ProcessDB'.getProcessForUser user (toProcessId pid) tst))
getProcessForManager :: !User !pid -> Task (Maybe Process) | toProcessId pid
getProcessForManager man pid = mkInstantTask "getProcessForManager" (mkTaskFunction (\tst -> 'ProcessDB'.getProcessForManager man (toProcessId pid) tst))
getProcessForManager man pid = mkInstantTask "Get process for manager" "Read a process from the database with a check if it is managed by a specific user."
(mkTaskFunction (\tst -> 'ProcessDB'.getProcessForManager man (toProcessId pid) tst))
getProcesses :: ![pid] -> Task [Process] | toProcessId pid
getProcesses ids = mkInstantTask "getProcessesById" (mkTaskFunction (\tst -> 'ProcessDB'.getProcessesById (map toProcessId ids) tst))
getProcesses ids = mkInstantTask "Get processes" "Read a set of processes from the database."
(mkTaskFunction (\tst -> 'ProcessDB'.getProcessesById (map toProcessId ids) tst))
getProcessesWithStatus :: ![TaskStatus] -> Task [Process]
getProcessesWithStatus statuses = mkInstantTask "getProcesses" (mkTaskFunction (\tst -> 'ProcessDB'.getProcesses statuses tst))
getProcessesWithStatus statuses = mkInstantTask "Get processes by status" "Read all processes from the database with a specific status."
(mkTaskFunction (\tst -> 'ProcessDB'.getProcesses statuses tst