Working with scheduled tasks
With scheduled tasks, you can create automated actions, such as running queries and exporting query results without taking direct action from the user interface.
Scheduled tasks are invaluable tools that help to automate business processes to run at specified dates and times. This is especially useful for actions that must be run on a regular basis, such as weekly sales reports that are supposed to be distributed to several different locations, or quarterly earnings reports.
- Procedure 1: Schedules tasks from the File menu.
- Procedure 2: Schedules tasks from the Repository Explorer > Workspace(s) tree, by right clicking on the objects under the workspaces.
All the scheduled tasks that are available in a repository are displayed in the Scheduled Tasks view. The tasks, which are not local and are created by other instances of QMF for WebSphere or QMF Server, will be listed, but you will not be able to perform any operations on these tasks.
appdata
from a single location and are installed on two or more machines that are
in the same time zone:- If the time difference between the machines is more than 5 minutes, the scheduled task will be executed from every instance.
- If the time differences between the machines is less than or equal to 5 minutes, the scheduled task will be executed only once as per the schedule.
Procedure 1
To create a scheduled task, perform the following steps:
- Select or .
- In the Task List window, click Select Repository Connection and use the Select Repository Connection dialog to select the repository connection that you want the task to access.
- If authorization information is required, you are prompted to enter it in the Log on to window.
- Click Add Task to create a scheduled task if you use Task List dialog.
- If you open the Create New Scheduled Task wizard by clicking , select the type of scheduler you want to use. You can use a local scheduler or QMF for WebSphere scheduler and click Next.
- If you open the Create New Scheduled Task wizard by right clicking on a QMF object such as procedure, query, visual report, and quick reports, then a new drop down is displayed with the User Selection. The User Selection is populated with the values you have selected in the current workspace context.
- Specify a name for the task in the Task name field.
- Click Select Repository Connection and use the Select Repository Connection dialog to select the repository connection that you want the task to access
- Click Set User Information.
The Set User Information for Repository window opens.
- Specify the login name and password for the repository in the Login and
Password fields and click OK.
The Set User Information for Repository window closes.
- Click Add Action.
The Action Wizard opens.
- Specify a name for the action in the Action name field.
- Select what type of action you want to add and click Next.
- Specify the options for the selected task type and click Finish.
The Action Wizard closes and the new action is added to the Actions list.
- To generate a detailed log of this task execution, select the Enable logging check box. The error log and the task execution report are saved to the user home directory if the task is run from the operating system scheduler.
- When you have added all of the actions that you want the task to run, click OK. The Task window closes and control returns to the Task List window.
- Click Import task to import a task.
- Click Export task to export a task.
- To schedule a task, select the task that you want to schedule and click Schedule task.
- Click OK.
The Task List window closes.
Procedure 2
Alternately, you can schedule a task by right clicking on one or multiple objects from the Repository explorer.
- Select one or more object(s) of type Procedure, Visual Query, Quick Report, Visual Report, from the Repository Explorer tree and right click on the selected objects. Click New > Scheduled Task.
- From the Create New Scheduled Task window, on the Select the
task type page, select the task type and click Next.Note: If you are connected to a shared repository, you would be able to see only local scheduler option. If you are connected to a WebService repository connection, you will be able to see the following two options:
- Use local scheduler
- Use QMF for WebSphere scheduler.
- On a Local task or Remote task page (based on the
type of the scheduler), enter the following:
- Task name: Specify the name of the task.
- Repository connection: By default, the current repository connection is selected. If you want to change the repository connection, select from the drop-down and provide user name and password.
- User Selection(s): Select the object to be scheduled from the drop-down. You can even add a new object to the existing list in the drop-down by clicking on the Select New Object button.
- Click Add Action.
The Action Wizard opens.
- Specify a name for the action in the Action name field.
- Select the type of action from the following and click Next.
- Execute object: The execute object action allows you to automatically execute queries, a visual report, procedure, or quick report, and export, mail, or print it. For more information on how to add execute object action, see Adding an execute object action.
- Resource manipulation: The resource manipulation action allows you to automatically copy, paste, delete, and email resources that are generated by the scheduled task. For more information on how to add resource manipulation action, see Adding a resource manipulation task.
- Action group: You can use action groups to create a series of actions that should be performed successively. For more information on creating a series of action groups, see Adding an action group.
- Specify the options for the selected task type and click Finish.
The Action Wizard closes and the new action is added to the Actions list.
- To generate a detailed log of this task execution, select the Enable logging check box. The error log and the task execution report are saved to the user home directory if the task is run from the operating system scheduler.
- When you have added all of the actions that you want the task to run, click OK. The Task window closes and control returns to the Task List window.
- Click Import task to import a task.
- Click Export task to export a task.
- To schedule a task, select the task that you want to schedule and click Schedule task.
- Click OK.
The Task List window closes.