Task Metamodel Conditions are defined in terms of Expressions. There are 5 types of expressions:
- Data expressions
- Social expressions
- Task expressions
- Space expressions
- Logic expressions
The Figure 8 shows and overview of the Expression metamodel.
Data Expressions
Data Expressions relate Social Instances (defined by the the Social Metamodel) to information.
For instance, suposse that we have to model the Exchange File task. The Pre-condition for this task defines the sender(file) Data expression to represent that the «sender» holds the file to be exchanged and the Post condition defines the receiver(file) Data expression to represent that the «receiver» has received the file that was exchanged.
Social Expressions
Social expressions relate Social instances (defined by the the Social Metamodel) to express social relationships. These relationships include: the Social Synchronization and the Social Alternative.
While the Social Synchronization represents a synchronization point where entities exchange information during a task execution, the Social Alternative represents entities that are able to perform the same tasks. The Social Expression metamodel is depicted on Figure 9.
An example of Social Synchronization emerges when we have to model the Exchange File task. The Pre-condition for this task defines the sender, receiver Social expression to represent that the «sender» and the «receiver» are ready to exchange information.
An example of Social Alternative emerges when we have to model the Cancel File Transference task. The Pre-condition for this task defines the sender + receiver Social expression to represent that the «sender» or the «receiver» can cancel the exchange of information.
Task Expressions
The aim of Task Expressions is the definition of task dependencies. Although task dependiencies are represented using Route tasks, this alternative allows designers to define task dependencies when Route tasks reduce the readability of the model. Task Expressions are based on Regular Expressions to define task dependencies. The Task Expression metamodel is depicted on Figure 10.
The Task Performance is Task Expression that relates a Social Instance (from the Social Metamodel) to a System Task (from the Task Metamodel).
The Task Expression Metamodel defines 2 unary and 2 binary operations for Task Expressions.
While the Task Repetition unary operator defines the Kleene Closure (represented by the * symbol) for expressions, the At Least Once unary expression (represented by the ! symbol) defines the variant of the Kleene Closure where the expression occurs at least once. Regarding the binary operators, the Task Expression Metamodel defines the Task Sequence (represented by the , symbol) to define that the expression is satisfied iff a task expression is executed before another one, and the Task Alternative (represented by the + symbol) to define the expression is satisfied iff one of the expressions was executed.
For instance, suppose that you have to model the Exchange File task, where the sender and the receiver Users have to execute a set of tasks in a defined order. In order to send a file, a User (the receiver) has to be Listening incomming files before the sender performs Load the file. Therefore, the Task Expression for the Load File task should be: «(receiver(Listening))». Once the file was loaded, the Exchange File task should be performed; therefore the Task Expression for the Exchange File task is «(sender(Load))». Once the File Exchange was performed, the Save task should be performed; thus, the Task Expression for this task should be «(sender(Exchange File), receiver(Exchange File))».
The Figure 11 depicts this example.
Space Expressions
Space Expressions’ goal is the definition of location-aware conditions. To represent this type of situations, Space expressions relate Space models to entities in order to define conditions that should be satified before/after a task is/was performed. They are expressed in terms of Regular Expressions. The Space Event expression is used to relate Spaces and Social Instances (i.e. User IN Room) where User is a Role instance from the Social metamodel and Room is a Space from the Space metamodel). As in Task Expressions, Space expressions define 2 unary and 2 binary operator for Space Expressions.
While the Space Repetition unary operator (represented by the * symbol) defines the Kleene Closure for expressions, the Space At Least Once unary operator (represented by the ! symbol) defines the variant of the Kleene Closure where the expression occurs at least once. Regarding the binary operators, the Space Expression Metamodel defines the Space Path (represented by the , symbol) to define a Space Expression should be satisfied before the another one, and the Space Alternative (represented by the + symbol) to define that the expression is satisfied if one of the two Space Expressions are satisfied.
The Space Expression Metamodel is depicted in Figure 12.
For instance, suppose that you have to model the location aware printing system where users (represented by the User Role) are able to print documents from mobile devices in the nearest printer. Besides, suppose that there are 3 offices (Spaces) in the floor: Office A, Office B and Office C; and 2 printers (Social Instances) : Printer A and Printer B. Finally, suppose that while users located on Office A and Office C print their documents on Printer A, users located on Office B print their documents on Printer B. Therefore, to model this situation we define two tasks: Print Document on Printer A and Print Document on Printer B. Before defining the the Space Expression for these tasks, we define 3 events: User IN Office A, User IN Office B, User IN Office C. Thus, the Space Expression for the Print Document on Printer A task is «(User IN Office A + User IN Office C)» and «(User IN Office B)» for the Print Document on Printer B task.
A variant to this example is considering the idea of a Mobile Printer that is able to move itself around the building from office to office. Therefore, in order to print we may use the «co-location» concept that allows users execute the Print Document task on a Printer that is in the same Room the user is located. The Space Expression representing this situation is «(User IN Room, Mobile Printer IN Room)».
Logic Expressions
Logic Expressions define logic relationships based on Data expressions (i.e. the Air Conditioning System is turned on if Sensor Temperature measurement is above the Max Temperature defined by the user and is turned off if Sensor Tepeature measurement is below the Min Temperature defined by the user).
Thus, the Turn On task defines the &qout;(Sensor Temperature > Max Temperature)&qout; Logic Expression as a pre-condition, and the &»(Sensor Temperature < Min Temperature)&» Logic Expression as a pre-condition of the Turn Off task.
You can reference this work as:
Ricardo Tesoriero, José A. Gallud, María D. Lozano and Víctor M. R. Penichet. CAUCE: Model-driven Development of Context-aware Applications for Ubiquitous Computing Environments. Journal of Universal Computer Science, Vol. 16, No. 15, pp. 2111-2138. 2010. Link: http://www.jucs.org/jucs_16_15/cauce_model_driven_development