IBM WebSphere Multichannel Bank Transformation Toolkit, Version 7.1

Defining tasks using TaskInfo

About this task

A TaskInfo is a Desktop element that contains the following information needed to define a task:
Table 1. Task definition fields
Field Description
taskName The unique identifier for a task
operation/process/ application The name of the function to launch. (Only one function is defined for each TaskInfo.) If the field is operation, the defined operation is associated with the panel and is the one that is launched. Otherwise, the operation that is launched is the operation defined as the attribute of the panel.
operationPanel The identifier of the panel that is opened when a task is launched. If there is no view file (the view definition is not externalized), the value is the name of the class (including the package name) of the panel.
shortDescription The short description of the task
longDescription The long description of the task
code The code corresponding to the task
executeOperation If the task type is an operation and this flag is set to true, the operation should be executed when launching the task; otherwise, it should not be executed.

The following table shows the complete list of valid field value combinations that may be used to define a task.

Table 2. Valid task field combinations
Op Name Case taskName opPanel shortDesc. longDesc. code executeOperation
--- 1 X X X X X  
operation 2 X X X X X X
process 3 X   X X X  
application 4 X   X X X  

Explanation of cases from the above table:

TaskInfo elements are stored by the Desktop in a Hashtable. The key of a TaskInfo in this Hashtable is its taskName attribute. Each time the Desktop creates a TaskLauncher from its XML definition, it checks if this TaskLauncher defines a Task completely. To completely define a Task, a TaskLauncher must define a taskName, a shortDescription, a longDescription, and a code (mandatory), in one of the combinations defined in the table above.

If the same task is to be launched from several TaskLaunchers (such as a TaskLauncherButton and a MenuItem), define the task (with all its attributes) in one TaskLauncher and then specify the same taskName in the other TaskLaunchers. If the TaskLauncher defines a Task completely, a TaskInfo element will be created to hold this information and make it available to other TaskLaunchers.

You can also create TaskInfo elements by defining them in the Desktop definition file.

When a TaskLauncher asks the Desktop to launch a task by sending a taskName, the Desktop checks its TaskInfo list to see if there is an existing TaskInfo object that matches the task to be launched. The matching TaskInfo object will have the specified taskName as an attribute, and defines the task. If a match is found but the TaskLauncher does not specify some task attribute values, then the attributes values of this TaskInfo object will be used as the default values for the task.

If no matching TaskInfo object is found, and the TaskLauncher does not completely define the task to be launched, the process of launching the task will end and an exception will be thrown.



Feedback