Primavera Integration API 7.0

com.primavera.integration.client
Class JobManager

java.lang.Object
  extended by com.primavera.integration.client.JobManager

public class JobManager
extends java.lang.Object

The Job Manager is retrieved for a particular session by calling Session.getJobManager(). The types of jobs supported in the API are: Schedule, Summarize, Apply Actuals, Store Period Performance, Run Project Architect, and Create Batch Reports. All jobs are asynchronous, that is, they are submitted and the client code does not wait for them to complete. All asynchronous jobs created by the Job Manager, except the javaSchedule() and storePeriodPerformance() methods, are serviced by the Primavera Job Service, which runs as a Windows NT/2000/XP service. If you have not installed the Primavera Job Service, see the Administrator's Guide for instructions on how to install the service on a Windows machine. You can check the status of an asynchronous job initiated by the Integration API by calling getJobStatus().

An internal job type exists that is invoked when setting Project.LinkActualToActualThisPeriod to true, causing all actual-this-period values to be recalculated for the entire project. Although this job is not invoked using the JobManager, its status may be checked using the getCurrentJobs() and getJobStatus() methods. The type of this internal job is JobType.SYNC_ACTUAL_THIS_PERIOD.


Method Summary
 JobId applyActuals(Project project, java.util.Date newDataDate)
          Asynchronously applies actuals to a project using the Primavera Job Service.
 JobStatus cancelJob(JobId jobId)
          Cancels an asynchronous job initiated by the Integration API.
 ObjectId copyProject(Project project, EPS eps, CopyProjectOptions projOpts, CopyWBSOptions wbsOpts, CopyActivityOptions actOpts)
          Deprecated. As of release 5.0, use Project.createCopy(com.primavera.common.value.ObjectId, com.primavera.integration.common.CopyProjectOptions, com.primavera.integration.common.CopyWBSOptions, com.primavera.integration.common.CopyActivityOptions)
 JobId createBatchReportHTMLFile(BusinessObject[] objs, ObjectId batchReportId, java.lang.String sFileName, java.lang.String sUserNotes)
          Asynchronously create a batch report for one or more project and/or EPS objects using the Primavera Job Service, sending the output to an HTML file.
 JobId createBatchReportPrinter(BusinessObject[] objs, ObjectId batchReportId, java.lang.String sUserNotes)
          Asynchronously a create batch report for one or more project and/or EPS objects using the Primavera Job Service, sending the output to a printer.
 JobId createBatchReportTextFile(BusinessObject[] objs, ObjectId batchReportId, java.lang.String sFileName, java.lang.String sTextDelimiter, java.lang.String sTextQualifier, java.lang.String sUserNotes)
          Asynchronously create a batch report for one or more project and/or EPS objects using the Primavera Job Service, sending the output to a text file.
 JobInfo[] getCurrentJobs()
          Retrieves job information for current asynchronous jobs of this user.
 JobStatus getJobStatus(JobId jobId)
          Retrieves the status of an asynchronous job initiated by the Integration API.
 JobId javaSchedule(Project[] projects, java.util.Date newDataDate)
          Asynchronously schedules multiple projects using the Java scheduler.
 JobId javaSchedule(Project project, java.util.Date newDataDate)
          Asynchronously schedules a project using the Java scheduler.
 JobId runProjectArchitect(ObjectId projectObjId, ObjectId methodologyObjId, ObjectId wbsObjId, boolean mergeToRoot, boolean useMMPricePerUnit, int complexity, boolean useMMResponsibleMgr)
          Asynchronously runs the Project Architect to create a project plan from a methodology defined in the Methodology Manager database.
 JobId schedule(Project[] projects, java.util.Date newDataDate)
          Asynchronously schedules multiple projects using the Primavera Job Service.
 JobId schedule(Project project, java.util.Date newDataDate)
          Asynchronously schedules a project using the Primavera Job Service.
 JobId storePeriodPerformance(Project[] projects, ObjectId finPerObjId)
          Asynchronously stores period performance for multiple projects.
 JobId storePeriodPerformance(Project project, ObjectId finPerObjId)
          Asynchronously stores period performance for a single project.
 JobId summarize(EPS eps)
          Asynchronously summarizes an EPS node using the Primavera Job Service.
 JobId summarize(Project project)
          Asynchronously summarizes a project using the Primavera Job Service.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getJobStatus

public JobStatus getJobStatus(JobId jobId)
                       throws ServerException,
                              NetworkException
Retrieves the status of an asynchronous job initiated by the Integration API. Jobs initiated by Project Management or Primavera's Web application are not accessible.

Parameters:
jobId - the id of the job
Returns:
JobStatus the status of the job: 'Pending', 'Running', 'Failed', 'Complete', or 'Cancelled'.
Throws:
ServerException - if a problem occurred on the server-side
NetworkException - if a problem occurred in the network layer
java.lang.IllegalArgumentException - if the job id parameter is null

getCurrentJobs

public JobInfo[] getCurrentJobs()
                         throws ServerException,
                                NetworkException
Retrieves job information for current asynchronous jobs of this user. Only jobs initiated by the Integration API are accessible, not those initiated by Project Management or Primavera's Web application.

Returns:
JobInfo[] array containing one JobInfo object for every API-initiated job currently in the database
Throws:
ServerException - if a problem occurred on the server-side
NetworkException - if a problem occurred in the network layer

cancelJob

public JobStatus cancelJob(JobId jobId)
                    throws ServerException,
                           NetworkException
Cancels an asynchronous job initiated by the Integration API. Jobs initiated by Project Management or Primavera's Web application are not accessible.

Parameters:
jobId - the id of the job
Returns:
JobStatus the status of the job. 'Failed' if the job had previously failed, 'Complete' if the job was already completed, or 'Cancelled' if the job was cancelled.
Throws:
ServerException - if a problem occurred on the server-side
NetworkException - if a problem occurred in the network layer
java.lang.IllegalArgumentException - if the job id parameter is null

schedule

public JobId schedule(Project project,
                      java.util.Date newDataDate)
               throws ServerException,
                      NetworkException,
                      BusinessObjectException
Asynchronously schedules a project using the Primavera Job Service.

Parameters:
project - the project
newDataDate - the new data date
Returns:
JobId the id of the job
Throws:
ServerException - if a problem occurred on the server-side
NetworkException - if a problem occurred in the network layer
BusinessObjectException - if the project's ObjectId field was not loaded or set

schedule

public JobId schedule(Project[] projects,
                      java.util.Date newDataDate)
               throws ServerException,
                      NetworkException,
                      ClientException
Asynchronously schedules multiple projects using the Primavera Job Service.

Parameters:
projects - the projects
newDataDate - the new data date
Returns:
JobId the id of the job
Throws:
ServerException - if a problem occurred on the server-side
NetworkException - if a problem occurred in the network layer
ClientException - if the Projects array parameter is empty

javaSchedule

public JobId javaSchedule(Project project,
                          java.util.Date newDataDate)
                   throws ServerException,
                          NetworkException,
                          BusinessObjectException
Asynchronously schedules a project using the Java scheduler.

Parameters:
project - the project
newDataDate - the new data date
Returns:
JobId the id of the job
Throws:
ServerException - if a problem occurred on the server-side
NetworkException - if a problem occurred in the network layer
BusinessObjectException - if the project's ObjectId field was not loaded or set

javaSchedule

public JobId javaSchedule(Project[] projects,
                          java.util.Date newDataDate)
                   throws ServerException,
                          NetworkException,
                          ClientException
Asynchronously schedules multiple projects using the Java scheduler.

Parameters:
projects - the projects
newDataDate - the new data date
Returns:
JobId the id of the job
Throws:
ServerException - if a problem occurred on the server-side
NetworkException - if a problem occurred in the network layer
ClientException - if the Projects array parameter is empty

applyActuals

public JobId applyActuals(Project project,
                          java.util.Date newDataDate)
                   throws ServerException,
                          NetworkException,
                          BusinessObjectException
Asynchronously applies actuals to a project using the Primavera Job Service.

Parameters:
project - the project
newDataDate - the new data date
Returns:
JobId the id of the job
Throws:
ServerException - if a problem occurred on the server-side
NetworkException - if a problem occurred in the network layer
BusinessObjectException - if the project's ObjectId field was not loaded or set
java.lang.IllegalArgumentException - if one of the parameters is null

summarize

public JobId summarize(Project project)
                throws ServerException,
                       NetworkException,
                       BusinessObjectException
Asynchronously summarizes a project using the Primavera Job Service.

Parameters:
project - the project
Returns:
JobId the id of the job
Throws:
ServerException - if a problem occurred on the server-side
NetworkException - if a problem occurred in the network layer
BusinessObjectException - if the project's ObjectId field was not loaded or set
java.lang.IllegalArgumentException - if the project parameter is null

summarize

public JobId summarize(EPS eps)
                throws ServerException,
                       NetworkException,
                       BusinessObjectException
Asynchronously summarizes an EPS node using the Primavera Job Service.

Parameters:
eps - the EPS
Returns:
JobId the id of the job
Throws:
ServerException - if a problem occurred on the server-side
NetworkException - if a problem occurred in the network layer
BusinessObjectException - if the EPS object's ObjectId field was not loaded or specified
java.lang.IllegalArgumentException - if the eps parameter is null

copyProject

@Deprecated
public ObjectId copyProject(Project project,
                                       EPS eps,
                                       CopyProjectOptions projOpts,
                                       CopyWBSOptions wbsOpts,
                                       CopyActivityOptions actOpts)
                     throws ServerException,
                            NetworkException,
                            ClientException
Deprecated. As of release 5.0, use Project.createCopy(com.primavera.common.value.ObjectId, com.primavera.integration.common.CopyProjectOptions, com.primavera.integration.common.CopyWBSOptions, com.primavera.integration.common.CopyActivityOptions)

Synchronously copies a project. This feature, although exposed as a "job", does not require the Primavera Job Service in order to function.

Parameters:
project - the project to copy
eps - the destination EPS Id
projOpts - the copy project options. If null, the default options will be used.
wbsOpts - the copy WBS options. If null, the default options will be used.
actOpts - the copy activity options. If null, the default options will be used.
Returns:
ObjectId the new Project id. return null if failed
Throws:
java.lang.IllegalArgumentException - if any input parameters that are required are null.
ServerException - if a problem occurred on the server-side
NetworkException - if a problem occurred in the network layer
ClientException - if a problem occurred in the client layer
java.lang.IllegalArgumentException - if the project or eps parameter is null

storePeriodPerformance

public JobId storePeriodPerformance(Project project,
                                    ObjectId finPerObjId)
                             throws ServerException,
                                    NetworkException,
                                    BusinessObjectException
Asynchronously stores period performance for a single project. The "this period" values are added to the past period actuals values and then the "this period" fields are reset to zero.

Parameters:
project - the project
finPerObjId - the financial period
Returns:
JobId the id of the job
Throws:
ServerException - if a problem occurred on the server-side
NetworkException - if a problem occurred in the network layer
BusinessObjectException - if the project's ObjectId field was not loaded or set

storePeriodPerformance

public JobId storePeriodPerformance(Project[] projects,
                                    ObjectId finPerObjId)
                             throws ServerException,
                                    NetworkException,
                                    ClientException
Asynchronously stores period performance for multiple projects. The "this period" values are added to the past period actuals values and then the "this period" fields are reset to zero.

Parameters:
projects - the projects
finPerObjId - the financial period
Returns:
JobId the id of the job
Throws:
ServerException - if a problem occurred on the server-side
NetworkException - if a problem occurred in the network layer
ClientException - if the Projects array parameter is empty

runProjectArchitect

public JobId runProjectArchitect(ObjectId projectObjId,
                                 ObjectId methodologyObjId,
                                 ObjectId wbsObjId,
                                 boolean mergeToRoot,
                                 boolean useMMPricePerUnit,
                                 int complexity,
                                 boolean useMMResponsibleMgr)
                          throws ServerException,
                                 NetworkException,
                                 BusinessObjectException
Asynchronously runs the Project Architect to create a project plan from a methodology defined in the Methodology Manager database.

Parameters:
projectObjId - - the target project
methodologyObjId - - the ObjectId of the Methodology to be used to create the project plan
wbsObjId - - the ObjectId in the current project to which the methodology content should be saved. If null, it will be merged into the root WBS, which is the project itself.
mergeToRoot - - the flag that indicates whether to merge the methodology WBS into the current project's WBS
useMMPricePerUnit - - if true the price per unit will be copied from the methodology and the rate source will be set to Override, otherwise the project rate type will be used on all assignments
complexity - - the size and complexity percentage for the selected methodology to use for bottom-up estimation, used to estimate work efforts and costs
useMMResponsibleMgr - - if true the responsible manager assigned to the Project or WBS in Methodology Manager will be used, otherwise the responsible manager assigned to the selected Project or WBS will be used.
Returns:
JobId the id of the job
Throws:
ServerException - if a problem occurred on the server-side
NetworkException - if a problem occurred in the network layer
BusinessObjectException - if the project's ObjectId field was not loaded or set

createBatchReportPrinter

public JobId createBatchReportPrinter(BusinessObject[] objs,
                                      ObjectId batchReportId,
                                      java.lang.String sUserNotes)
                               throws ServerException,
                                      NetworkException,
                                      BusinessObjectException
Asynchronously a create batch report for one or more project and/or EPS objects using the Primavera Job Service, sending the output to a printer.

Parameters:
objs - the project and/or EPS objects
batchReportId - the ObjectId of the batch report
sUserNotes - the optional user notes
Returns:
JobId the id of the job
Throws:
ServerException - if a problem occurred on the server-side
NetworkException - if a problem occurred in the network layer
BusinessObjectException - if the project's ObjectId field was not loaded or set

createBatchReportHTMLFile

public JobId createBatchReportHTMLFile(BusinessObject[] objs,
                                       ObjectId batchReportId,
                                       java.lang.String sFileName,
                                       java.lang.String sUserNotes)
                                throws ServerException,
                                       NetworkException,
                                       BusinessObjectException
Asynchronously create a batch report for one or more project and/or EPS objects using the Primavera Job Service, sending the output to an HTML file.

Parameters:
objs - the project and/or EPS objects
batchReportId - the ObjectId of the batch report
sFileName - the output filename
sUserNotes - the optional user notes
Returns:
JobId the id of the job
Throws:
ServerException - if a problem occurred on the server-side
NetworkException - if a problem occurred in the network layer
BusinessObjectException - if the project's ObjectId field was not loaded or set
java.lang.IllegalArgumentException - if one of the parameters is null

createBatchReportTextFile

public JobId createBatchReportTextFile(BusinessObject[] objs,
                                       ObjectId batchReportId,
                                       java.lang.String sFileName,
                                       java.lang.String sTextDelimiter,
                                       java.lang.String sTextQualifier,
                                       java.lang.String sUserNotes)
                                throws ServerException,
                                       NetworkException,
                                       BusinessObjectException
Asynchronously create a batch report for one or more project and/or EPS objects using the Primavera Job Service, sending the output to a text file.

Parameters:
objs - the project and/or EPS objects
batchReportId - the ObjectId of the batch report
sFileName - the output filename
sTextDelimiter - text delimiter for the output report
sTextQualifier - the text qualifier for the output report
sUserNotes - the optional user notes
Returns:
JobId the id of the job
Throws:
ServerException - if a problem occurred on the server-side
NetworkException - if a problem occurred in the network layer
BusinessObjectException - if the project's ObjectId field was not loaded or set
java.lang.IllegalArgumentException - if one of the parameters is null

Primavera Integration API 7.0

Copyright © 2003, 2009, Oracle and/or its affiliates. All rights reserved.