Configure Reports and Jobs

HID_admin_configure_report_job_defs
ccppmod153
HID_admin_configure_report_job_defs
As an administrator, you configure which reports and jobs are active for other users to run. A report or job definition consists of the following items:
  • General properties.
  • Parameters to filter report data or to specify the scope of a job.
  • Incompatible reports and jobs that cannot run concurrently with the selected report or job.
  • Associated categories to identify groups of similar reports and jobs. For example, finance-related jobs can be grouped in the financial processing category.
  • Access rights to define the resources, OBS units, or groups of users who can run or manage the report or job.
: As an administrator, you select
Administration
,
Data Administration
,
Reports and
 
Jobs
. to make configuration changes. To view available reports and jobs, users select
Home
,
Personal
,
Reports and
 
Jobs
.
 
2
 
Video: Data Extraction
The following video is provided by CA Technologies.

To play this video in full screen, click the YouTube logo to the right of Settings at the bottom of the video. 
Create Report or Job Definitions
Use the
Job Definitions
page to view a list of all available report and job definitions. You can edit only user-defined report and jobs.
Follow these steps:
  1. Open
    Administration
    , and from
    Data Administration
    , click
    Reports and
     
    Jobs
    .
  2. Click
    New
    .
  3. In the 
    Executable Type
    field, specify the method for running the report or  job. The method is based on the job listener. Select one of the following executable types: 
    • Report
      : Executes a Jaspersoft report stored on your Jaspersoft server. For the product to be aware of reports, definition files refer to the executable by name. The executable name stores the file on the Jaspersoft server.
    • Java: 
      Executes queries. Use when you cannot implement the business logic XBL. Java is considered a super-set of XBL and PMD. For example, the following Java statement performs the
      calendar
      background process:
        
      com.niku.calendar.scheduler. CalendarBackgroundProcess
       
       
    • Persistent Meta Data (PMD): 
      Executes a set of queries at regular intervals. PMD does not contain business logic.
       
      For example, the following PMD statement executes the Post Incident Financials job: 
       
      itl.incidentCostCalc
       
       
    • SQL Stored Procedure: 
      Implements business logic as a stored procedure when operations are data intensive. For data intensive operations, a SQL stored procedure is selected over Java for implementing business logic. For example, the following stored procedure executes the Remove Job Logs job: 
       
      cmn_job_logs_delete_sp  
    • Extensible Business Language (XBL)
      : Implements business logic and executes queries. XBL is considered a super-set of PMD. For example, the following XQL/XBL statements execute the Post Timesheets and Time Slicing jobs, respectively:
        
      postTimesheets.xql
        
      blobcrack#blobcrack.xbl
    • Extract, Transform, and Load (ETL)
      : Executes an ETL extraction, structured data transformation, and loads the transformed data tables. For example, the Load Data Warehouse job extracts data from the
      Clarity PPM
      database. This ETL job transforms that data into a denormalized format and then loads it into the data warehouse.
  4. In the 
    Executable Name
    field, enter a name for the report or job. The naming convention depends on the executable type. Refer to the following examples:
    • Report
      : The report name on the JasperReports server. For example, /ca_ppm/reports/investment_management/CSK_INV_TimeAndEstimate.
    • Java
      : Enter the class path. For example, com.myorg.projmgr.service.staffing.job.InvestmentAllocationJob or com.company.security.CleanUserSessionListener.
    • PMD
      : Enter a descriptive name using dot syntax; for example, itl.incidentCostCalc.
    • SQL
      Stored Procedure: Enter a descriptive name using underscores; for example, IMM_ASSIGN_INCIDENT.
    • XBL
      : For example, projmgr#projects/purgeProjects.xbl
    • ETL
      : Enter the ETL job filename.
  5. Save your changes.
Define the Report or Job Parameters
Report or job parameters enable users who run reports or jobs to filter data or to specify the scope of the report or job. For example, you add a parameter, make an existing one mandatory, or delete a parameter from a report or job definition.
Define all report or job parameters for passing on to the server from 
Clarity PPM
. Define the parameters whether the report or job is executed directly from the product, or indirectly from a link in another report or job.
Follow these steps:
  1. Open
    Administration
    , and from
    Data Administration
    , click
    Reports and
     
    Jobs
    .
  2. Open the report or job definition.
  3. Click
    Parameters
    , and then click
    New
    .
  4. Complete the requested information. The following fields require explanation:
    • Bind Parameter Code
      Defines the parameter bind code. For example, the job executable type is an SQL stored procedure and the SQL stored procedure parameter name is "P_JOB_RUN_ID". The bind parameter code is "P_JOB_RUN_ID."
    • Type
      Specifies the parameter field type that is displayed to users when they select parameters to run their job.
      Values:
      • Text: Displays a text field to users who run jobs.
      • Checkbox: Displays Boolean values (true or false).
      • Pull-down: Displays a list of values that users can select from a drop-down. Users click the Browse icon to select a single value from the lookup that appears.
      • Browse: Displays a long list of values that users can browse. Users click the Browse icon to select a single value from the lookup that appears.
      • Date: Displays date parameters. Users who run jobs can either enter a date or select a date from a calendar.
      • Relative Date: Displays a field to allow users to select a date relative to the day the job runs. The relative dates exist in a drop-down of calendar periods.
      • Time Period: Displays a field from which users can select a time period relative to the day the job runs. The drop-down provides system-defined periods.
      Save changes to set default values for browse or pull-down parameter types.
    • Default
      Indicates the read-only value of the parameter.
      Required:
      If you selected the Read-only field.
    • Read-only
      Indicates if the parameter is read-only when the field is selected. If you select Read-only, provide a value for the parameter in the Default field.
  5. Save your changes.
Reorder Report or Job Definition Parameters
Parameters are displayed in the order in which you add them to the report or job definition. The order of parameters is important for SQL Stored Procedure jobs. To reorder the definition parameters, at least one parameter must be defined.
Follow these steps:
  1. Open
    Administration
    , and from
    Data Administration
    , click 
    Reports and
     
    Jobs
    .
  2. Open the report or job definition to reorder parameters.
  3. Select
    Parameter Order
    .
  4. Select the parameter and use the arrows to move the parameter up or down the list.
  5. Save your changes.
Identify Incompatible Report or Job Definitions
Some reports or jobs or instances of the same report or job cannot run simultaneously. For example, you cannot concurrently run a job with the Datamart Extraction job if they depend on data resulting from the datamart extraction.
Use the
Incompatible Jobs
page to identify the jobs that cannot run simultaneously as the selected job. If jobs become compatible, delete jobs from the list. Delete reports and jobs if they become compatible. For example, you schedule to run an incompatible report or job listed. The scheduled run time of the incompatible report or job is postponed until the running report or job completes. Use these steps to compile a list of reports or jobs that cannot run concurrently.
Follow these steps:
  1. Open
    Administration
    , and from
    Data Administration
    , click
    Reports and
     
    Jobs
    .
  2. Open the report or job definition that you want to edit.
  3. Click
    Incompatible Jobs
    , and click Add.
  4. Select the check box next to the report or job that cannot run with this report or  job and click
    Add
    .
Associate Report or Job Definitions with Categories
Use the set of categories that are included with the product to group reports or jobs in meaningful ways. Categories help to filter reports or jobs. No new categories can be created or deleted. Use the
Associated Categories
page of report or job definition to add or remove jobs from categories.
Follow these steps:
  1. Open
    Administration
    , and from
    Data Administration
    , click 
    Reports and
     
    Jobs
    .
  2. Open the report or job definition, and click
    Associated Categories
    .
  3. Click
    Add
    .
  4. Select the category to associate with the report or job, and click
    Add
    .
Report and Job Notifications
As an administrator, you can advise users to set up notifications if they want to know when a report or job is finished or fails. Recipients can receive notifications by an alert, email, or SMS text message. You can configure the subject and body of report and job notifications to meet your organization requirements. For example, email can indicate the reason for a failed job. Provide users with the following steps or a link to Personalize CA PPM.
Follow these steps:
  1. Open
    Home
    , and from
    Personal
    , click
    Account Settings
    .
  2. Click
    Notifications
    .
  3. Select the check box next to each notification and method you want to receive, and save the changes. 
Activate or Deactivate a Report or Job
Activate report or jobs to run them. Inactive reports or jobs display on the definitions page, but the check box in the Active column is not selected.
Follow these steps:
  1. Open
    Administration
    , and from
    Data Administration
    , click
    Reports and
     
    Jobs
    .
  2. Select
    Job Definitions
    .
  3. Complete one of the following steps:
    • Select the inactive report or job, and click
      Activate
      .
    • Select the active report or job, and click
      Deactivate
      .
Create a Job
The software includes a list of stock jobs. If the included jobs do not meet your requirements, you can create new jobs. For a list of the access rights that are required to manage jobs (jobs access rights), see 
Access Rights Reference
.
With programming experience writing queries, statements, procedures, and Java classes, you can create new jobs, .
Follow these steps:
  1. Select a method that best addresses the job to create.
  2. Write the queries, statements, or procedures for the new job using Java and SQL.
  3. Deploy the executable.
  4. Create a job definition by referencing the executable type and name of the method.
To enable the background scheduler to clean up all processing jobs at startup, set the isPrimary attribute on the jobSchedulerInstance element in properties.xml to true. Setting this attribute to true is useful when the background server shuts down and restarts while a job is executing.
SQL Stored Procedure Guidelines
When you create a job using SQL stored procedures, pass the P_JOB_RUN_ID and P_JOB_USER_ID parameters. The parameter order for SQL stored procedures is important on SQL Server and Oracle. Read and follow these recommendations when writing stored procedure for SQL server and for Oracle:
SQL Server Recommendations
The stored procedure must start as follows:
CREATE PROCEDURE OR REPLACE PROCEDURE <my new job> ( @P_JOB_RUN_ID NUMERIC, @P_JOB_USER_ID NUMERIC, )
Oracle Recommendations
The stored procedure must start as follows:
CREATE OR REPLACE PROCEDURE <my new job> ( P_JOB_RUN_ID IN NUMBER, P_JOB_USER_ID IN NUMBER, ) AS <procedure body>
Other parameters are passed in the order that they are listed in the Parameters page of job definition.
Java Guidelines
If you select Java as the executable type, use the following steps to create the Java class, deploy, and register it.
Follow these steps:
  1. Create a Java class that performs the background processing.
    This class must implement the com.niku.union.interfaces.SchedulerListener interface. You only implement the scheduledEventFired() method of this interface.
  2. Implement the Java class using the scheduledEventFired() method of the following interface: com.niku.union.interfaces.SchedulerListener
  3. Compile the Java class. Verify that the compiler CLASSPATH is aware of the following: $NIKU_HOME/lib/union.jar
    See the Oracle website for more information about creating a JAR file. For example, the following JAR command creates a JAR file from a Java class jar cf myBackgroundJob.jar myBackgroundJob.class
  4. Deploy the class by placing the executable (for example, myBackgroundJob.class) in the $NIKU_HOME/customlib directory.
  5. Register this job by creating a job definition. For the executable name, enter one of the following:
    • Valid class name. For example, myBackgroundJob.
    • Fully qualified class name if this class is made a part of a package. For example, com.myserver.jobs.background.myBackgroundJob.
Java Class Background Jobs (Sample Code)
import com.niku.union.interfaces.JobSchedulerContext; import com.niku.union.interfaces.SchedulerListener; /** * Kicks off a background process. * This class is primarily used by the Job Scheduler. * @author Ken Chen */ public class myBackgroundJob implements SchedulerListener { /** * Constructor for the myBackgroundJob object */ public myBackgroundJob()  { } /** * Kicks off the background processing. * * @param jobContext_ Contains information required by job. * @exception Exception */ public void scheduledEventFired(JobSchedulerContext jobContext_) throws Exception { /** * The JobSchedulerContext parameter contains the Job definition ( * jobContext_.getJob() ) and the Job definition contains the value of the * OutputPath parameter. * * String outputPath = jobContext_.getJob().getRunOutputPath(); * File f = new File(outputPath, "myoutput.txt"); */ if(jobContext_ == null) { throw new Exception("Invalid JobContext"); } try { doSomeWork(); } catch (Exception e) { throw new Exception("Cannot doSomeWork()::" + e); } } private void doSomeWork(JobSchedulerContext jobContext_) throws Exception { } // Write your background processing logic here. // One important and useful thing you can get out of // jobContext_ is the SecurityIdentifier. // SecurityIdentifier gives you handle to current user // information under which job is executed. // The user who often schedules the job. // is "scheduler". String userName = jobContext_.getSecurityIdentifier().getUsername(); // // userName = "scheduler" // String sessionId = jobContext_.getSecurityIdentifier().getSessionId(); // // sessionId is the unique identifier for the job. // Every time job is invoked, sessionId is different. // ...job does its work. }
Update Investments Created Before 
Clarity PPM
 Release 13.2 to Display Capital and Operating Expenses
If you have investments that were created before Release 13.2, you can update the investments to display both capital and operating expenses. To update your investments run the following jobs in this order:
  • Enable Capitalization
  • Copy Cost Type Plan of Record Charge Code with Cost Type
If you are processing investments with large amounts of data, limit the number of investments for a job run. When all of your investments have been successfully processed to show capital and operating expenses, we recommend deactivating the jobs. The statistics of a job execution are printed in a BG log file for the job. You can open and read the log file. The log file contains information such as the number of investments that were processed, skipped, or failed.
For more information about the jobs, see
Jobs Reference
.