Tuesday, December 21, 2010

Schedule an Entry/Report Based on an Occurrence/Trigger

As part of setting up trigger-based scheduling, you must schedule an entry based on an occurrence.

Trigger-based schedule is activated if the user firing the trigger has:

read and traverse permissions for the schedule entry

traverse permissions for all ancestors of the schedule entry

access to IBM Cognos Administration

Steps
Click the schedule button next to the entry you want to schedule.

Under Frequency, click the By Trigger tab.

In Trigger name, type the name of the trigger occurrence.

Note: The trigger name that you enter may be provided to you by your administrator or developer. If not, you must inform your administrator or developer of the trigger name that you use.

The default start date is "now", and the default end date is "forever", which means the trigger schedule runs when the trigger is fired (either from trigger.bat or from an SDK application). If you enter a valid start and end date, the trigger schedule can only be fired between those dates.

Click OK.


Set Up a Trigger Occurrence on a Server

As part of setting up trigger-based report scheduling , you must set up the trigger occurrence on a server. You link the external occurrence, such as a database refresh or an email, with a trigger on the server that causes the entry to run. You must also specify the name of the occurrence.

Trigger occurrences can also be set up by an SDK developer using the IBM Cognos 8 software development kit (SDK). For more information, see the The IBM Cognos 8 SDK Developer Guide.

Scripts
Using the Windows script named trigger.bat or the shell script named trigger.sh, you can trigger one or more schedules to run on the server.

The script syntax follows where URL is the IBM Cognos 8 server URL, username is a valid username in the specified namespace, password is the password for the username, namespace is the namespace for the username, and triggerlist is a comma separated list of trigger names:

trigger.bat URL [username password namespace]
triggerlist
For example, if users want to schedule a report based on a database refresh and want to schedule a second report based on receipt of an email, your custom trigger command line may look similar to this:

trigger.bat http://localhost:9300/p2pd/servlet/dispatch username
password namespace databaserefreshtriggername,emailtriggername
Steps
If you are setting up a trigger occurrence on a server other than an IBM Cognos 8 server, complete the following tasks:

Ensure that the server has a supported version of either a Java Runtime Environment or a Java Development Kit.

Copy the following files from c8_location/webapps/p2pd/WEB-INF/lib on an IBM Cognos 8 server to the location on the server where you are setting up the trigger occurrence:

activation.jar

axis.jar

axisCrnpClient.jar

commons-discovery.jar

commons-logging.jar

jaxrpc.jar

saaj.jar

mail.jar

xml-apis.jar

xercesImpl.jar


Copy the following files from c8_location/webapps/EventTrigger on an IBM Cognos 8 server, to the location on the server where you are setting up the trigger occurrence:

trigger.bat

trigger.sh

trigger.class (a Java utility that can run on any IBM Cognos-supported platform)


Ensure that the command line runs when the external occurrence, such as a database refresh or email, occurs.

The mechanism that you use to invoke your custom trigger command depends on the application that you are working with, such as a database system or an email application. For information, see the documentation for your application.

Inform users that they can now schedule entries based on the trigger occurrence.

If a user scheduled an entry based on the occurrence, when the user clicks the schedule button for a report view, occurrence information replaces frequency information on the Schedule page.

If a user scheduled an entry based on the occurrence, when the user clicks the schedule button for a report view, occurrence information replaces frequency information on the Schedule page.

After the script runs, the trigger method returns an integer value representing the number of schedules that were run. The following integers represent errors:

-1 is a usage error, such as invalid parameter or syntax

-2 is a communication problem with IBM Cognos 8 server

Working with Compression on HDFS

Copy and uncompress file to HDFS without unziping the file on local filesystem If your file is in GB's then this command would cer...