Annotated services can be integrated seamlessly into a taskdriven development approach by introducing the concept of annotated tasks into task models. An annotated task is a system task that is implemented by an operation of an annotated service. It is created when the operation of an annotated service is imported into a task model. After the import step, interaction tasks are automatically added to the task model and associated with the annotated task.

They represent user interactions that must be performed before the annotated task can be invoked and for the presentation of the result returned by the annotated task. The association is established through data flows (specifying the exchange of data between tasks) and control flows (specifying the order and the conditions for task execution). The necessary information for the creation of the interaction tasks and their association is contained completely in the annotations of the service operation and therefore requires no additional action from the developer of the task model. Fig. 2 provides a comprehensible example to demonstrate how the automatic creation of interaction tasks based on annotations increases the efficiency of modeling an interactive application.

The example shows a simple excerpt of the task model for a flight booking application that allows the user to search flights after successful login. The user must first enter login information (Interaction Task Login). The login authentication (Annotated Task Check Login) is implemented by an operation of the User Management service. If the authentication failed, an error message is shown (Interaction Task Login Failed). Else, a session token is returned and a ’Welcome’ message (Interaction Task Login Success) is displayed. The session token is required to invoke the flight search operation (Annotated Task Flight Search) provided by the Flight Service.

After entering the search criteria (Interaction Task Enter Search Criteria), Flight Search returns a result list which is displayed to the user (Interaction Task Show Result List). With the help of the service annotations for the flight search operation, the task model in Fig. 2 can be created with minimal effort. The developer just needs to import the flight search service operation into the task model.

Note that the login operation does not need to be imported manually. The flight search operation is automatically transformed into the annotated task Flight Search. Its annotation is parsed and the interaction tasks associated with Flight Search (Enter Search Criteria, Show Result List) are added automatically. Their associations through data flows and control flows are also added automatically.

Preconditions for annotated tasks can be utilized to simplify and automate task modelling beyond the generation of interaction tasks. The fulfillment of preconditions can be evaluated at design time to check the completeness of the task model. If a task model is evaluated as being incomplete, it can be completed automatically by hints in the annotations.

In our example, the flight search operation is annotated with a precondition. The precondition specifies that a session token is required to invoke the operation. It furthermore specifies that the required session token is provided by the login operation of the User Management service. Based on this information, the task model can be completed without a developer’s intervention by automatically importing the login operation. The interaction tasks associated with Check Login and their associations can be derived from the annotations, ultimately producing the task model shown in Fig. 2.