We planned to upgrade GitLab and Mattermost to the latest version this Friday morning (early). You may experience some downtime!

Commit 8d111b5d authored by Bas Lijnse's avatar Bas Lijnse

Split up iTasks.Core.TasksCombinators into iTasks.WF.Combinators.*

parent 4ebf810e
......@@ -14,10 +14,14 @@ import
, iTasks.SDS.Combinators.Core
, iTasks.SDS.Combinators.Common
, iTasks.WF.Definition
, iTasks.WF.Tasks.Core
, iTasks.WF.Tasks.SDS
, iTasks.WF.Tasks.IO
, iTasks.WF.Tasks.System
, iTasks.WF.Combinators.Core
, iTasks.WF.Combinators.SDS
, iTasks.WF.Combinators.Tune
, iTasks.API
// Miscellaneous machinery
......
......@@ -13,8 +13,4 @@ import
, iTasks.API.Common.ExportTasks // tasks for exporting data
// Task combinators
, iTasks.API.Core.TaskCombinators // The core iTask combinators
, iTasks.API.Common.TaskCombinators // Set of derived useful iTask combinators
// Layout tuning
, iTasks.UI.Layout
definition module iTasks.API.Common.InteractionTasks
import iTasks.WF.Definition
from iTasks.API.Core.Types import :: Date, :: Time, :: DateTime, :: Action
from iTasks.WF.Combinators.Core import :: Action
from iTasks.API.Core.Types import :: Date, :: Time, :: DateTime
from Data.Functor import class Functor
from iTasks.UI.Prompt import class toPrompt
from iTasks.UI.Editor.Builtin import :: ChoiceText, :: ChoiceGrid, :: ChoiceNode
from iTasks.SDS.Definition import :: Shared, :: SDS, :: RWShared, :: ReadWriteShared
/*** General input/update/output tasks ***/
:: ViewOption a = E.v: ViewAs (a -> v) & iTask v
......
......@@ -9,7 +9,6 @@ from Data.Map import qualified get, put
import StdBool, StdList, StdMisc, StdTuple, Data.Functor
import iTasks.WF.Tasks.Core
import iTasks.WF.Tasks.SDS
import iTasks.API.Core.TaskCombinators
import iTasks.API.Common.TaskCombinators
import iTasks.SDS.Sources.Core, iTasks.SDS.Sources.System
import iTasks.SDS.Combinators.Common
......
......@@ -2,7 +2,9 @@ definition module iTasks.API.Common.TaskCombinators
/**
* This module contains a collection of useful iTasks combinators defined in terms of the basic iTask combinators.
*/
import iTasks.API.Core.TaskCombinators
import iTasks.SDS.Definition
import iTasks.WF.Combinators.Core
import iTasks.WF.Combinators.Tune
from Data.Map import :: Map
from Data.Either import :: Either
......
......@@ -2,8 +2,8 @@ implementation module iTasks.API.Common.TaskCombinators
/**
* This module contains a collection of useful iTasks combinators defined in terms of the basic iTask combinators
*/
import StdBool, StdList,StdOrdList, StdTuple, StdGeneric, StdMisc, StdInt, StdClass
import Text, System.Time, Data.Tuple, Data.List, Data.Either, Data.Functor
import StdBool, StdList,StdOrdList, StdTuple, StdGeneric, StdMisc, StdInt, StdClass, StdString
import Text, System.Time, Data.Maybe, Data.Tuple, Data.List, Data.Either, Data.Functor
import iTasks._Framework.Util
from StdFunc import id, const, o
from iTasks.SDS.Sources.Core import randomInt
......@@ -15,7 +15,8 @@ import qualified Data.Map as DM
import iTasks.WF.Tasks.Core
import iTasks.WF.Tasks.SDS
import iTasks.API.Core.TaskCombinators, iTasks.API.Common.InteractionTasks, iTasks.UI.Layout, iTasks.UI.Prompt
import iTasks.WF.Combinators.Core, iTasks.WF.Combinators.Tune
import iTasks.API.Common.InteractionTasks, iTasks.UI.Layout, iTasks.UI.Prompt
import iTasks.UI.Layout.Common, iTasks.UI.Layout.Default
(>>*) infixl 1 :: !(Task a) ![TaskCont a (Task b)] -> Task b | iTask a & iTask b
......
definition module iTasks.API.Core.TaskCombinators
/**
* This is the kernel module for the specification of workflows. It contains the core set of iTasks combinators
* with which additional combinators can be defined.
*/
from System.Time import :: Timestamp
import iTasks._Framework.Task, iTasks._Framework.SDS, iTasks._Framework.Generic
derive class iTask ParallelTaskType, AttachmentStatus
/**
* Adds a result transformation function to a task.
* The resulting task is still considered a single step in the workflow.
*
* @param Function: The transformation function. It works on maybe's to also map over instable tasks.
* @param Task: The task to which the transformation function is added
*
* @return The transformed task
*/
transform :: ((TaskValue a) -> TaskValue b) !(Task a) -> Task b
/**
* The generic sequential combinator.
* It does a task followed by one out of a given list of continuations.
* Once the transition to the continuation has been made it cannot be reversed.
*
* @param Task: The first step in the sequence
* @param Value before step function: Computes the value of the composition before a step is taken
* @param Continuations: A set of continuation definitions from which one is selected to make the step
* -OnValue: inspect the value, step if the predicate matches
* -OnAction: enable an action if the predicate matches, step if the actions is chosen
* -OnException: Provides an exception handler for exceptions of type e
* -OnAllExceptions: Provides an exception handler that catches all exceptions
*
* @return The combined task
*/
step :: !(Task a) ((Maybe a) -> (Maybe b)) [TaskCont a (Task b)] -> Task b | TC a & JSONDecode{|*|} a & JSONEncode{|*|} a
:: TaskCont a b
= OnValue ((TaskValue a) -> Maybe b)
| OnAction Action ((TaskValue a) -> Maybe b)
| E.e: OnException (e -> b) & iTask e
| OnAllExceptions (String -> b)
/**
* Parallel task creation
*
* @param Initial tasks: The initial list of tasks to run in parallel, each task is given
* a view on the status of all tasks in the list
* @param Continuations: A set of continuation definitions with which the list of tasks
* can be extended
* -OnValue: Inspect the value, add if the predicate matches
* -OnAction: Enable an action if the predicate matches, add if the actions is chosen
* -OnException: Provides an exception handler for exceptions of type e
* The task in the parallel set that raised the exception is replaced
* with the continuation
* -OnAllExceptions: Provides an exception handler that catches all exceptions
* The task in the parallel set that raised the exception is replaced
* with the continuation
* @return The sum of all results
* @gin False
*/
parallel :: ![(!ParallelTaskType,!ParallelTask a)] [TaskCont [(!Int,!TaskValue a)] (!ParallelTaskType,!ParallelTask a)] -> Task [(!Int,!TaskValue a)] | iTask a
//Task list manipulation
/**
* Appends a task to a task list
*/
appendTask :: !ParallelTaskType !(ParallelTask a) !(SharedTaskList a) -> Task TaskId | iTask a
/**
* Removes (and stops) a task from a task list
*/
removeTask :: !TaskId !(SharedTaskList a) -> Task ()
/**
* Replaces a task in a list and resets its execution state.
* All meta-data is kept
*/
replaceTask :: !TaskId !(ParallelTask a) !(SharedTaskList a) -> Task () | iTask a
/**
* Focuses a task in a task list
*/
focusTask :: !TaskId !(SharedTaskList a) -> Task () | iTask a
/**
* Attaches a a detached task.
*
* @param Identification of the task instance to attach
* @param Steal/takeover if this is true this attach will takeover the instance when it was already attached somewhere else
* @return The state of the task to work on
*/
attach :: !InstanceNo !Bool -> Task AttachmentStatus
/**
* Provide a local read/write shared for a task to work on.
*
* @param The initial value of the shared variable
* @param The task which uses the shared variable
*/
withShared :: !b !((Shared b) -> Task a) -> Task a | iTask a & iTask b
/**
* Expose a share to be accessable via an URL.
*
* @param The share to be exposed
* @param The task which uses the shared variable
*/
exposeShared :: !(RWShared p r w) !(String (RWShared p r w) -> Task a) -> Task a | iTask a & iTask r & iTask w & iTask p
/**
* Fine tune a task by specifying custom layouts, tweaking generic layouts,
* or add additional titles, hints and descriptions
*/
class tune b :: !b !(Task a) -> Task a
class tunev b a | iTask a :: !(b a) !(Task a) -> Task a
/**
* Fine tune evaluation behaviour
*/
instance tune LazyRefresh
withTaskId :: (Task a) -> Task (a, TaskId)
This diff is collapsed.
......@@ -24,9 +24,13 @@ from iTasks._Framework.IWorld import :: IWorld
from iTasks.UI.Definition import :: UI, :: UINodeType, :: UISize, :: UIDirection, :: UISideSizes, :: UIBound, :: UIAttributes
from iTasks.UI.Editor import :: Editor, :: EditMask, :: Masked
from iTasks.UI.Editor.Generic import generic gEditor, :: VSt
from iTasks.WF.Definition import :: Task, :: TaskId, :: InstanceNo, :: TaskValue, :: Stability, class iTask
from iTasks.WF.Definition import :: Task, :: TaskId, :: InstanceNo, :: TaskValue, :: Stability, :: TaskAttributes, class iTask
from iTasks.WF.Combinators.Core import :: Action(..), :: TaskListItem(..), :: TaskListFilter(..), :: InstanceKey
from iTasks.WF.Combinators.Core import :: InstanceConstants(..), :: InstanceProgress(..), :: ValueStatus(..)
from iTasks.SDS.Definition import :: SDS, :: ReadWriteShared, :: ReadOnlyShared
from iTasks.SDS.Sources.System import :: TaskInstance
from iTasks.UI.JS.Interface import :: JSWorld, :: JSVal
from iTasks.UI.Prompt import class toPrompt
......@@ -143,12 +147,8 @@ instance toString FileException, ParseException, CallException, SharedException,
// you may read them when interacting with the framework
//****************************************************************************//
instance Functor TaskValue
:: InstanceKey :== String
:: SessionId :== String
class toInstanceNo t :: t -> InstanceNo
......@@ -160,88 +160,8 @@ instance fromString TaskId
instance == TaskId
instance < TaskId
// Instance data which does not change after creation (except when a task is replaced)
:: InstanceConstants =
{ listId :: !TaskId //* Reference to parent tasklist
, session :: !Bool //* True for sessions (instances that automatically get garbage collected)
, build :: !String //* Application build version when the instance was created
, issuedAt :: !DateTime //* When was the task created
}
:: InstanceProgress =
{ value :: !ValueStatus //* Status of the task value
, attachedTo :: ![TaskId] //* Chain of tasks through which this instance was attached
, instanceKey :: !InstanceKey //* Random token that a client gets to have (temporary) access to the task instance
, firstEvent :: !Maybe DateTime //* When was the first work done on this task
, lastEvent :: !Maybe DateTime //* When was the latest event on this task (excluding Refresh events)
}
:: ValueStatus
= None
| Unstable
| Stable
| Exception
//* Access to parallel task lists
:: TaskList a :== (!TaskId,![TaskListItem a])
:: SharedTaskList a :== SDS TaskListFilter (!TaskId,![TaskListItem a]) [(!TaskId,!TaskAttributes)]
:: TaskListItem a =
{ taskId :: !TaskId
, listId :: !TaskId
, detached :: !Bool
, self :: !Bool
, value :: !TaskValue a
, attributes :: !TaskAttributes
, progress :: !Maybe InstanceProgress //Only possible for detached tasks
}
:: TaskListFilter =
//Which rows to filter
{ onlyIndex :: !Maybe [Int]
, onlyTaskId :: !Maybe [TaskId]
, onlySelf :: !Bool
//What to include
, includeValue :: !Bool
, includeAttributes :: !Bool
, includeProgress :: !Bool
}
:: TaskAttributes :== Map String String
:: ParallelTaskType
= Embedded //Simplest embedded
| NamedEmbedded !String //Embedded with name
| Detached !TaskAttributes !Bool //Management meta and flag whether the task should be started at once
| NamedDetached !String !TaskAttributes !Bool //Detached with name
:: ParallelTask a :== (SharedTaskList a) -> Task a
/**
* State of another process the user works on.
*/
:: AttachmentStatus
= ASAttached Stability //* the task instance is currently attached to this task
| ASInUse TaskId //* the task instance is already attached to another task
| ASExcepted //* the task instance had an uncaught exception
| ASDeleted //* the task instance does not exist anymore
| ASIncompatible //* the task instance can not be executed in this is version of the program (it was created by an older version)
//* Types to view the server's internal table of running task instances
:: TaskInstance =
{ instanceNo :: !InstanceNo //* Unique global identification
, instanceKey :: !InstanceKey //* Random string that a client needs to provide to access the task instance
, session :: !Bool //* Is this a session
, listId :: !TaskId //* Reference to parent tasklist
, build :: !String //* Application build version when the instance was created
, issuedAt :: !DateTime //* When was the task created
, attributes :: !TaskAttributes //* Arbitrary meta-data
, value :: !ValueStatus //* Status of the task value
, firstEvent :: !Maybe DateTime //* When was the first work done on this task
, lastEvent :: !Maybe DateTime //* When was the last event on this task
}
derive class iTask TaskListFilter
//* Framework configuration
......@@ -255,9 +175,6 @@ derive class iTask TaskListFilter
= RunningProcess !String
| CompletedProcess !Int
//* Next task actions
:: Action = Action !String //Locally unique identifier for actions
//Common action constants with predefined options
ActionOk :== Action "Ok"
ActionCancel :== Action "Cancel"
......@@ -314,9 +231,6 @@ CREATED_AT_ATTRIBUTE :== "createdate"//Creation task time, used for ordering but
LAST_EVENT_ATTRIBUTE :== "lastevent" //Last event task time, used for ordering but not real time
LAST_FOCUS_ATTRIBUTE :== "lastfocus" //Last focus, also used for ordering
//Task evaluation tuning directives, for increasing performance
:: LazyRefresh = LazyRefresh //If you tune a task in a parallel set with this directive, it not be evaluated unless its focused
//****************************************************************************//
// Generic instances for common library types
//****************************************************************************//
......
......@@ -10,7 +10,7 @@ import qualified Data.Map as DM
import Data.List, Data.Tuple
import iTasks.UI.Definition, iTasks.UI.Editor, iTasks.UI.Editor.Builtin, iTasks.UI.Editor.Common, iTasks.UI.Layout.Default, iTasks.UI.Layout.Common
// SPECIALIZATIONS
derive class iTask Workflow
derive class iTask Workflow, AttachmentStatus
gText{|WorkflowTaskContainer|} _ _ = []
gEditor{|WorkflowTaskContainer|} = emptyEditor
......
......@@ -5,14 +5,18 @@ import qualified Data.Map as DM
import iTasks.UI.Definition, iTasks.UI.Editor, iTasks.UI.Editor.Builtin, iTasks.UI.Editor.Combinators
import iTasks.UI.Layout.Default
from iTasks.WF.Definition import :: InstanceProgress(..)
from iTasks.WF.Combinators.Core import :: TaskListItem(..)
from iTasks._Framework.Util import timestampToGmDateTime
gText{|User|} _ val = [maybe "" toString val]
derive JSONEncode User, UserConstraint
derive JSONDecode User, UserConstraint
derive gDefault User, UserConstraint
derive gEq User, UserConstraint
derive gText UserConstraint
derive gEditor User, UserConstraint
derive JSONEncode User, UserConstraint, AttachmentStatus
derive JSONDecode User, UserConstraint, AttachmentStatus
derive gDefault User, UserConstraint, AttachmentStatus
derive gEq User, UserConstraint, AttachmentStatus
derive gText UserConstraint, AttachmentStatus
derive gEditor User, UserConstraint, AttachmentStatus
instance toString User
where
......@@ -223,8 +227,8 @@ where
toView (_,[{TaskListItem|progress=Just p,attributes}:_]) =
{ assignedTo = mkAssignedTo attributes
, firstWorkedOn = p.InstanceProgress.firstEvent
, lastWorkedOn = p.InstanceProgress.lastEvent
, firstWorkedOn = fmap timestampToGmDateTime p.InstanceProgress.firstEvent
, lastWorkedOn = fmap timestampToGmDateTime p.InstanceProgress.lastEvent
, taskStatus = case p.InstanceProgress.value of
None -> "No results so far..."
Unstable -> "In progres..."
......
......@@ -3,11 +3,11 @@ definition module iTasks.SDS.Combinators.Common
* This module provides common patterns for composing shared sources defined on top of the core set
*/
from iTasks.SDS.Definition import :: SDS, :: RWShared, :: ROShared, :: SDSNotifyPred, :: Shared, :: ReadOnlyShared, :: ReadWriteShared
from iTasks.WF.Definition import :: TaskException, :: TaskValue, :: TaskId, class iTask
from iTasks.WF.Definition import :: TaskException, :: TaskValue, :: TaskId, :: TaskAttributes, :: InstanceProgress, class iTask
from iTasks.WF.Definition import generic gEditor, generic gEq, generic gDefault, generic gText, generic JSONEncode, generic JSONDecode
from iTasks.WF.Combinators.Core import :: TaskList, :: TaskListFilter, :: TaskListItem, :: SharedTaskList
from iTasks._Framework.Generic.Visualization import :: TextFormat
from iTasks.UI.Editor import :: Editor, :: EditMask, :: Masked
from iTasks.API.Core.Types import :: TaskList, :: TaskListFilter, :: TaskListItem, :: SharedTaskList, :: TaskAttributes, :: InstanceProgress
from Data.Maybe import :: Maybe
from Data.Either import :: Either
......
......@@ -2,6 +2,7 @@ implementation module iTasks.SDS.Combinators.Common
import StdTuple, StdList
import iTasks.SDS.Definition, iTasks.SDS.Combinators.Core
import iTasks.WF.Combinators.Core
import iTasks.API.Core.Types
from StdFunc import o, const, flip, id
from iTasks._Framework.Task import exception, :: TaskException
......
......@@ -4,14 +4,28 @@ definition module iTasks.SDS.Sources.System
*/
from iTasks.SDS.Definition import :: SDS
from iTasks.WF.Definition import :: TaskId, :: TaskNo, :: InstanceNo
from iTasks.API.Core.Types import :: DateTime, :: Date, :: Time
from iTasks.API.Core.Types import :: TaskList, :: TaskAttributes
from iTasks.API.Core.Types import :: TaskListFilter, :: TaskListItem, :: TaskInstance, :: Config, :: SharedTaskList
from iTasks.WF.Definition import :: TaskId, :: TaskNo, :: InstanceNo, :: InstanceKey, :: TaskAttributes, :: ValueStatus
from iTasks.WF.Combinators.Core import :: TaskList, :: SharedTaskList, :: TaskListFilter, :: TaskListItem
from iTasks.API.Core.Types import :: DateTime, :: Date, :: Time, :: Config
from System.Time import :: Timestamp
from System.FilePath import :: FilePath
from Data.Map import :: Map
from Data.Maybe import :: Maybe
//* Types to view the server's internal table of running task instances
:: TaskInstance =
{ instanceNo :: !InstanceNo //* Unique global identification
, instanceKey :: !InstanceKey //* Random string that a client needs to provide to access the task instance
, session :: !Bool //* Is this a session
, listId :: !TaskId //* Reference to parent tasklist
, build :: !String //* Application build version when the instance was created
, issuedAt :: !Timestamp //* When was the task created
, attributes :: !TaskAttributes //* Arbitrary meta-data
, value :: !ValueStatus //* Status of the task value
, firstEvent :: !Maybe Timestamp //*When was the first work done on this task
, lastEvent :: !Maybe Timestamp //* When was the last event on this task
}
// Date & time (in task server's local timezone)
currentDateTime :: SDS () DateTime ()
......
......@@ -14,7 +14,8 @@ from Data.Functor import class Functor
from iTasks._Framework.Task import :: TaskId
from Text.HTML import :: HtmlTag
from Data.Map import :: Map
from iTasks.API.Core.Types import :: Document, :: DocumentId, :: Date, :: Time, :: Action
from iTasks.API.Core.Types import :: Document, :: DocumentId, :: Date, :: Time
from iTasks.WF.Combinators.Core import :: Action
from iTasks.WF.Definition import class iTask
from iTasks._Framework.Generic.Visualization import generic gText, :: TextFormat(..)
......
......@@ -6,7 +6,6 @@ definition module iTasks.UI.Layout
* updates that are later applied accordingly.
*/
from iTasks.API.Core.TaskCombinators import class tune
from iTasks.UI.Definition import :: UI, :: UINodeType, :: UIAttributes, :: UIChange
from Data.Maybe import :: Maybe
......@@ -58,10 +57,6 @@ from Text.JSON import :: JSONNode
// | MvUINoLongerMoved Int //A marker that indicates that at this location in the UI there were previously 'moved' nodes.
// //A RemoveChild or ReplaceUI change has removed them.
// These types are used to control when to apply layout in a task composition
:: ApplyLayout = ApplyLayout Layout
instance tune ApplyLayout //Apply a modification after a layout has been run
// In specifications of layouts, sub-parts of UI's are commonly addressed as
// a path of child selections in the UI tree.
......
......@@ -3,52 +3,24 @@ implementation module iTasks.UI.Layout
import StdTuple, StdList, StdBool, StdInt, StdOrdList, StdArray, StdMisc
import Data.Maybe, Data.Either, Text, Data.Tuple, Data.List, Data.Either, Data.Functor
import iTasks._Framework.Util, iTasks._Framework.HtmlUtil, iTasks.UI.Definition
import iTasks.API.Core.Types, iTasks.API.Core.TaskCombinators
import iTasks._Framework.Generic.Defaults
import iTasks.API.Core.Types
import StdEnum
from Data.Map as DM import qualified put, get, del, newMap, toList, fromList, alter, union, keys, unions, singleton
from Data.Tuple import appSnd
import Text.JSON
from StdFunc import o, const, id, flip
from iTasks._Framework.TaskState import :: TIMeta(..), :: TaskTree(..), :: DeferredJSON
from iTasks._Framework.TaskEval import :: TaskTime
from iTasks.WF.Combinators.Core import :: AttachmentStatus
import GenEq
import StdDebug
//This type records the states of layouts applied somewhere in a ui tree
derive JSONEncode LayoutState, LayoutTree, MvUI, MvUIChild
derive JSONDecode LayoutState, LayoutTree, MvUI, MvUIChild
instance tune ApplyLayout
where
tune (ApplyLayout l) task=:(Task evala) = Task eval
where
eval event evalOpts (TCDestroy (TCLayout s tt)) iworld //Cleanup duty simply passed to inner task
= evala event evalOpts (TCDestroy tt) iworld
eval event evalOpts tt=:(TCInit _ _) iworld
= eval ResetEvent evalOpts (TCLayout JSONNull tt) iworld //On initialization, we need to do a reset to be able to apply the layout
//On Reset events, we (re-)apply the layout
eval ResetEvent evalOpts (TCLayout _ tt) iworld = case evala ResetEvent evalOpts tt iworld of
(ValueResult value info (ReplaceUI ui) tt,iworld)
//Determine the change the layout makes to the UI
# (change,state) = l.Layout.apply ui
//Modify the layout accorgingly
# ui = applyUIChange change ui
= (ValueResult value info (ReplaceUI ui) (TCLayout (toJSON state) tt), iworld)
(res,iworld) = (res,iworld)
eval event evalOpts (TCLayout json tt) iworld = case evala event evalOpts tt iworld of
(ValueResult value info change tt,iworld)
= case fromJSON json of
(Just s)
# (change,s) = l.Layout.adjust (change,s)
= (ValueResult value info change (TCLayout (toJSON s) tt), iworld)
Nothing
= (ExceptionResult (exception ("Corrupt layout state:" +++ toString json)), iworld)
(res,iworld) = (res,iworld)
eval event evalOpts state iworld = evala event evalOpts state iworld //Catchall
//Test if a specific UI at a path is in the selection
inUISelection :: UISelection UIPath UI -> Bool
inUISelection (SelectByPath p) path _ = p === path
......
......@@ -8,6 +8,7 @@ import iTasks.UI.Layout
from iTasks.UI.Definition import :: UISide(..), :: UIDirection(..), :: UIWindowType(..), :: UIHAlign(..), :: UIVAlign(..)
from iTasks.UI.Prompt import :: Title, :: Label, :: Icon
from iTasks.API.Core.Types import :: Attribute
from iTasks.WF.Combinators.Tune import class tune
/**
* Create a tabset with all child items as separate tabs
......
......@@ -2,8 +2,9 @@ implementation module iTasks.UI.Layout.Common
import iTasks.UI.Layout, iTasks.UI.Layout.Default
import iTasks.UI.Definition, iTasks.UI.Prompt
import iTasks.API.Core.Types, iTasks.API.Core.TaskCombinators
import Data.List
import iTasks.WF.Combinators.Tune
import iTasks.API.Core.Types
import Data.List, Text.JSON
import qualified Data.Map as DM
import StdBool
from StdFunc import id, const, o
......
definition module iTasks.WF.Combinators.Core
/**
* This module provides the core builtin combinators for composing tasks
* This module provides the core builtin combinators for composing tasks into workflows
*/
import iTasks.WF.Definition
from iTasks.SDS.Definition import :: SDS
from Data.Maybe import :: Maybe
//* Next task actions
:: Action = Action !String //Locally unique identifier for actions
:: ParallelTaskType
= Embedded //Simplest embedded
| NamedEmbedded !String //Embedded with name
| Detached !TaskAttributes !Bool //Management meta and flag whether the task should be started at once
| NamedDetached !String !TaskAttributes !Bool //Detached with name
:: ParallelTask a :== (SharedTaskList a) -> Task a
// Data available to parallel sibling tasks
:: TaskList a :== (!TaskId,![TaskListItem a])
:: SharedTaskList a :== SDS TaskListFilter (!TaskId,![TaskListItem a]) [(!TaskId,!TaskAttributes)]