Title: i-Tasks - interactive workflow tasks for the WEB ___________ WORK IN PROGRESS
1Task Oriented Programming in using Rinus
Plasmeijer Bas Lijnse - Peter Achten Pieter
Koopman - Steffen Michels - Jurriën Stutterheim
Jan Martin Jansen (NLDA) - Laszlo Domoszlai
(ELTE) Part 1/2 Radboud University Nijmegen
2Overview
- Introduction to Task Oriented Programming
- iTask Library
- Task Values
- Editors
- Shared Data
- Sequential Tasks
- Parallel Tasks
- Semantics
- Conclusions and Future Work
3Overview
- Introduction to Task Oriented Programming
- iTask Library
- Task Values
- Editors
- Shared Data
- Sequential Tasks
- Parallel Tasks
- Semantics
- Conclusions and Future Work
4Why Task Oriented Programming ?
-
- Tasks are a common notion in daily life / in any
organization - a task to do, assigned to one person
- group of people working together collection of
subtasks - statically known lt-gt dynamically determined
- managing tasks is also a task
- Computers often play an important role when
performing a Task - Filling in a web form
- Answering an email
- Writing a piece of text, filling in a
spreadsheet, - Many programming concepts can be seen as Tasks to
be executed by a computer - Function call, procedure call, method invocation,
calling a web-service, a query - process, thread, "App"
5Task Oriented Programming
- TOP
- Tasks as central concept
- New style of programming / New programming
paradigm - Declarative (focus on what instead of how)
- High level of abstraction
- No worry about technical realization (unless
they matter) - Yields a distributed running (on client and
server) application coordinating the tasks to do - Can also be used
- for Rapid Prototyping
- to Formalize how work should be organized
- for Simulation (agents) what is the best way of
working - for Training mix of real people and agents
- to Show properties by testing, analysis or by
formal proof (semantics formally defined)
6Task Oriented Programming with
-
- Domain Specific Programming Language, embedded in
- Combinator Library
- Specify Basic Tasks
- Define new tasks as a composition of other tasks,
using combinators - Abstracts from (thanks to advanced Functional
Programming techniques) - graphical user interfaces handling of
user-interaction - (client-server) communication
- informing tasks about the progress made by others
- informing tasks when shared information is being
changed - Resulting application Web-Service coordinating
the tasks to be done - Clients can run on computers, laptops, tablets,
smart phones
7iTasks Architecture
My iTask Specification
8iTasks Architecture
iTask Web Server
iTask Combinator Library
My iTask Specification
9iTasks Architecture
10Papers on iTasks
- First paper on iTasks
- iTasks Executable Specifications of Interactive
Work Flow Systems for the Web (ICFP 2007) - Extensions
- iTasks for a change - Type-safe run-time change
in dynamically evolving workflows (PEPM 2011) - GiN a graphical language and tool for defining
iTask workflows (TFP 2011) - iTask as a new paradigm for building GUI
applications (IFL 2010) - Getting a grip on tasks that coordinate tasks
(LDTA 2011) - Semantics
- An Executable and Testable Semantics for iTasks
(IFL 2008) - Task Oriented Programming in a Pure Functional
Language (PPDP 2012) - Client site evaluation of tasks
- Transparant Ajax and Client-Site Evaluation of
iTasks (IFL 2007) - iEditors Extending iTask with Interactive
Plug-ins (IFL 2008)
11"Real" Prototype Applications using iTasks
- Simple workflow
- Aerial project Home Healthcare project (Peter
Lucas, Bas Lijnse, e.a.) - Testing chronically lung diseases caused by
smoking - Testing pregnancy disease
12Home Healthcare project
13"Real" Prototype Applications using iTasks
- Real real-life workflow
- Crisis ManagementCapturing the Netherlands
Coast Guards Search And Rescue Workflow
(ISCRAM 2011, Bas Lijnse, Jan Martin Jansen, Ruud
Nanne, Rinus Plasmeijer)
14Prototype Coast Guard Search And Rescue
15What did we learn ?
- Tasks which pass information to each other
(one-to-many) is not powerful enough - One has to be able to define tasks which can
monitor and coordinate other tasks - Internal monitor the status of (sub-)tasks (like
a process table in an OS) - External monitor the status of the environment
(e.g. status of Search And Rescue) - Tasks must be able to share update information
while the task is being performed - Many to many communication, broadcast
-
- User definable dashboard view (windows, menus,
buttons) on shared information - System should remain semantically simple, easy to
use, implement, and maintain
16Back to the drawing board
- The whole iTask system has been redesigned
- More features than ever
- Yet the Core of the system consists of only a few
primitives - Redesigned API on top enabling easy specification
of complex systems - Re-implemented kernel to gain efficiency
VERSION 3 !
17Overview
- Introduction to Task Oriented Programming
- iTask Library
- Task Values
- Editors
- Shared Data
- Sequential Tasks
- Parallel Tasks
- Semantics
- Conclusions and Future Work
18How does an i Tasks look like ?
- Embedded Domain Specific Language
- iTask Core
- Basic tasks
- Interactive Tasks Editors
- Non-interactive Tasks Lifting Conversion
- Integrated Tasks web-service-call, OS-call, exec
application, access a database - Combinators for combining tasks
- Define control flow (sequential / parallel) and
data flow between tasks - iTask Library to support frequently occurring
work patterns - Clean general purpose pure functional
programming language - Recursive -, higher order -, polymorphic -,
overloaded -, generic - functions
19Core Concepts
- Data
- Local data Task Values
- Shared data Shared Data Sources
- Tasks
- Basic Tasks
- Non-interactive
- return, throw,
- Interactive
- Editors
- Combinators
- Sequential
- Parallel
20Overview
- Introduction to Task Oriented Programming
- iTask Library
- Task Values
- Editors
- Shared Data
- Sequential Tasks
- Parallel Tasks
- Semantics
- Conclusions and Future Work
21Core - Task Values
- Task a typed unit of work which should
deliver a value of type a - While the task is going on, its value may change
over time
22Core - Task Values
- Task a typed unit of work which should
deliver a value of type a - While the task is going on, its value may change
over time
NoVal
23Core - Task Values
- Task a typed unit of work which should
deliver a value of type a - While the task is going on, its value may change
over time
NoVal
Val a Unstable
24Core - Task Values
- Task a typed unit of work which should
deliver a value of type a - While the task is going on, its value may change
over time
NoVal
Val a False
25Core - Task Values
- Task a typed unit of work which should
deliver a value of type a - While the task is going on, its value may change
over time
26Core - Task Values
- Task a typed unit of work which should
deliver a value of type a - While the task is going on, its value may change
over time - TaskResult a ValRes TimeStamp
(Value a) - ? e ExcRes e iTask e
- Value a NoVal
- Val a Stability
- Stability Bool
- Task Values (ValRes)
- have a time stamp
- can be observed by other tasks
- influence the set of tasks to work on
- can be of any type user defined, higher order
(e.g a task or a function) - must satisfy the iTask context restriction at
least have to be serializable
27Core - Simple Basic Tasks
- Lift an ordinary expression to the task domain,
delivers a Stable value - return a ? Task a iTask a
- Raise an exceptional result (ExcRes)
- throw e ? Task e iTask e
- Conversion of Task Values
- (_at_?) infixl 1 (Task a) ((Value a) ? (Value
b)) ? Task b iTask a iTask b - (_at_) infixl 1 (Task a) (a ? b) ? Task b
iTask a iTask b
"Core" Definitions
28Overview
- Introduction to Task Oriented Programming
- iTask Library
- Task Values
- Editors
- Shared Data
- Sequential Tasks
- Parallel Tasks
- Semantics
- Conclusions and Future Work
29Editors - 1
- module example
- import iTasks
- Start World ? World
- Start world startEngine myTask world
- myTask Task Int
- myTask enterInformation "Enter an integer"
30Editors - 2
- Person name String, gender Gender,
dateOfBirth Maybe Date - Gender Male Female
- derive class iTask Person, Gender
- myTask Task Person
- myTask enterInformation "Enter your personal
information"
31Editors - 3
- myTask Task Person
- myTask enterInformation "Please personal
information of multiple people"
32Types treated special
- simpleEditor Task Note
- simpleEditor enterInformation "Enter a piece of
text" - chooseDate Task Date
- chooseDate enterInformation "Choose a date"
- Maybe a Just a Nothing
- chooseDate2 Task (Maybe Date)
- chooseDate2 enterInformation "Choose a date"
- import GoogleMaps
- pointOnMap Task GoogleMap
- pointOnMap enterInformation "Show me the
location(s)"
33Examples of Editors
- taskInt Task Int
- taskInt enterInformation "Please enter a value"
- taskInt2 Task Int
- taskInt2 updateInformation "Please enter a
value" 42 - chooseNumber Task Int
- chooseNumber enterChoice "Choose a number"
0..9 - pizzaWith Task String
- pizzaWith enterMultipleChoice "What do you like
on your pizza ?" "Cheese","Tomato","An
sjofish","Salami"
34Interactive Editors (see InteractionTasks.dcl)
- Basic tasks Interactive editor for filling in
forms of a certain type - viewInformation d ViewOption a a ? Task
a descr d iTask a - enterInformation d EnterOption a ? Task a
descr d iTask a - updateInformation d UpdateOption a a a ?
Task a descr d iTask a - enterChoice d ChoiceOption o o
? Task o descr d iTask o - updateChoice d ChoiceOption o o o
? Task o descr d iTask o - enterMultipleChoice d MultiChoiceOption o
o ? Task o descr d iTask o - updateMultipleChoice d MultiChoiceOption o
o o ? Task o descr d iTask o -
35Interactive Editors (see InteractionTasks.dcl)
- Basic tasks Interactive editor for filling in
forms of a certain type - viewInformation d ViewOption a a ? Task
a descr d iTask a
36Types used for interaction tasks
- viewInformation d ViewOption a a ? Task
a descr d iTask a - ViewOption a E.v ViewWith (a ? v)
iTask v
37Interactive Editors (see InteractionTasks.dcl)
- viewInformation d ViewOption a a ? Task
a descr d iTask a - myList1 viewInformation "View the numbers from
1 to 10" 1..10 - myList2 viewInformation "View the numbers from
1 to 10" - ViewWith (map (\n ? "Number " lt n))
1..10
38Types used for interaction tasks
- enterInformation d EnterOption a ? Task a
descr d iTask a - EnterOption a E.v EnterWith (v ? a)
iTask v
39Types used for interaction tasks
- updateInformation d UpdateOption a a a ?
Task a descr d iTask a - UpdateOption a b E.v UpdateWith (a ? v) (a
v ? b) iTask v
Define how to map view v to value a
Any view can be chosen
Context Restriction
40Types used for interaction tasks
- ViewOption a E.v ViewWith (a ? v)
iTask v - EnterOption a E.v EnterWith (v ? a)
iTask v - UpdateOption a b E.v UpdateWith (a ? v) (a
v ? b) iTask v - ChoiceOption a E.v ChooseWith
ChoiceType (a ? v) iTask v - MultiChoiceOption a E.v ChooseMultipleWith
MultiChoiceType (a ? v) iTask v - ChoiceType AutoChoice
- ChooseFromComboBox
- ChooseFromRadioButtons
- ChooseFromGrid
- ChooseFromTree
- MultiChoiceType AutoMultiChoice
- ChooseFromCheckBoxes
41Types used for interaction tasks
- viewInformation d ViewOption a a ? Task
a descr d iTask a - class descr d where initAttributes d ?
TaskAttribute - instance descr Void, String, (String, String) ,
(Icon, String, String) , - class iTask a gVisualizeEditor // creates
a form editor - , gVisualizeText // converts text to
html code - , gHeaders // grid header for record
field name - , gGridRows // grid row for record
value - , gUpdate // handles a form update
- , gVerify // verifies values filled in
- , JSONDecode // convert to JSON to
communicate / store - , JSONEncode // convert from JSON
- , gEq // to compare values / web
screens - , TC a // conversion to and from Dynamics
42Types used for interaction tasks
- generic gVisualizeEditor a gVisualizeText a,
gHeaders a, gGridRows a - (Maybe a) VSt ? (VisualizationResult,VS
t) - generic gVisualizeText a StaticVisualizationMo
de a ? String - generic gUpdate a (UpdateMode a) USt ? (a,
USt) - generic gHeaders a a ? String
- generic gGridRows a gVisualizeText a
- a String ? Maybe String
- generic gVerify a (Maybe a) VerSt ? VerSt
- generic JSONEncode t t ? JSONNode
- generic JSONDecode t JSONNode ? (Maybe t,
JSONNode) - generic gEq a a a ? Bool
- TC is a special class automatically instantiated
by the compiler for every known type - toDynamic a ? Dynamic TC a
- fromDynamic Dynamic ? a TC a
43Overview
- Introduction to Task Oriented Programming
- iTask Library
- Task Values
- Editors
- Shared Data
- Sequential Tasks
- Parallel Tasks
- Semantics
- Conclusions and Future Work