Class JobManager
The Job Manager is retrieved for a particular session by calling Session.getJobManager(). The types of jobs supported in the API are: Schedule, Level, Summarize, Apply Actuals, Recalculate Assignment Costs, and Store Period Performance. All jobs are asynchronous, that is, they are submitted and the client code does not wait for them to complete. 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
Modifier and TypeMethodDescriptionapplyActuals(Project[] projects, ObjectId[] projIds, ObjectId[] epsIds, ObjectId[] portfolioIds, ObjectId[] projectCodeIds, Date newDataDate) applyActuals(Project project, Date newDataDate) Asynchronously applies actuals to a project.ObjectId[]arrayCopy(ObjectId[] srcObjIds, com.primavera.bo.common.PRequest req, ObjectId[] targetObjIds, String boType) Cancels an asynchronous job initiated by the Integration API.voidcheckInValidOrNoAccessProjects(ObjectId[] projObjIds, BOIterator<Project> projects, Project[] project, int jobType) JobInfo[]Retrieves job information for current asynchronous jobs of this user.Retrieves the log of an asynchronous job initiated by the Integration API.getJobStatus(JobId jobId) Retrieves the status of an asynchronous job initiated by the Integration API.Asynchronously levels a project.Asynchronously levels multiple projects.level(Project[] projects, ObjectId[] projIds, ObjectId[] epsIds, ObjectId[] portfolioIds, ObjectId[] projectCodeIds) publish(Project[] projects, ObjectId[] projIds, ObjectId[] portfolioIds, ObjectId[] epsIds, ObjectId[] projectCodeIds) recalculateAssignmentCosts(Project[] projects, boolean syncOTFactor) Asynchronously recalculates assignment costs for multiple projects if the price per unit has changed for a resource or role and that assignment has been set to calculate cost from units.recalculateAssignmentCosts(Project project, boolean syncOTFactor) Asynchronously recalculates assignment costs for a single project if the price per unit has changed for a resource or role and that assignment has been set to calculate cost from units.schedule(Project[] projects, ObjectId[] projIds, ObjectId[] portfolioIds, ObjectId[] epsIds, Date newDataDate, ObjectId[] projectCodeIds) Asynchronously schedules multiple projects.Asynchronously schedules a project.scheduleCheck(Project project) Asynchronously perform check schedule of a project.scheduleCheck(Project[] projects) Asynchronously perform check schedule of multiple projects.sendToUnifier(Project project) Asynchronously sends a project to Unifier.sendToUnifier(Project[] projects) Asynchronously sends multiple projects to Unifier.storePeriodPerformance(Project[] projects, ObjectId finPerObjId) Asynchronously stores period performance for multiple projects.storePeriodPerformance(Project project, ObjectId finPerObjId) Asynchronously stores period performance for a single project.Asynchronously summarizes an EPS node.Asynchronously summarizes a project.summarizeCBS(Project project) Asynchronously summarizes a project by cbs.updateBaseline(String updateBaselineOptions, Project p)
-
Method Details
-
getJobStatus
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-sideNetworkException- if a problem occurred in the network layerIllegalArgumentException- if the job id parameter is null
-
getJobLog
Retrieves the log 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:
- String the job log
- Throws:
ServerException- if a problem occurred on the server-sideNetworkException- if a problem occurred in the network layerIllegalArgumentException- if the job id parameter is null
-
getCurrentJobs
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-sideNetworkException- if a problem occurred in the network layer
-
cancelJob
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-sideNetworkException- if a problem occurred in the network layerIllegalArgumentException- if the job id parameter is null
-
schedule
public JobId schedule(Project project, Date newDataDate) throws ServerException, NetworkException, BusinessObjectException Asynchronously schedules a project.- Parameters:
project- the projectnewDataDate- the new data date- Returns:
- JobId the id of the job
- Throws:
ServerException- if a problem occurred on the server-sideNetworkException- if a problem occurred in the network layerBusinessObjectException- if the project's ObjectId field was not loaded or set
-
schedule
public JobId schedule(Project[] projects, Date newDataDate) throws ServerException, NetworkException, ClientException Asynchronously schedules multiple projects.- Parameters:
projects- the projectsnewDataDate- the new data date- Returns:
- JobId the id of the job
- Throws:
ServerException- if a problem occurred on the server-sideNetworkException- if a problem occurred in the network layerClientException- if the Projects array parameter is empty
-
schedule
public JobId schedule(Project[] projects, ObjectId[] portfolioIds, ObjectId[] epsIds, Date newDataDate) throws ServerException, NetworkException, ClientException -
schedule
public JobId schedule(Project[] projects, ObjectId[] projIds, ObjectId[] portfolioIds, ObjectId[] epsIds, Date newDataDate, ObjectId[] projectCodeIds) throws ServerException, NetworkException, ClientException, MultipartObjectIdException -
publish
public JobId publish(Project[] projects, ObjectId[] projIds, ObjectId[] portfolioIds, ObjectId[] epsIds, ObjectId[] projectCodeIds) throws ServerException, NetworkException, ClientException, MultipartObjectIdException -
applyActuals
public JobId applyActuals(Project project, Date newDataDate) throws ServerException, NetworkException, BusinessObjectException Asynchronously applies actuals to a project.- Parameters:
project- the projectnewDataDate- the new data date- Returns:
- JobId the id of the job
- Throws:
ServerException- if a problem occurred on the server-sideNetworkException- if a problem occurred in the network layerBusinessObjectException- if the project's ObjectId field was not loaded or setIllegalArgumentException- if one of the parameters is null
-
applyActuals
public JobId applyActuals(Project[] projects, ObjectId[] projIds, ObjectId[] epsIds, ObjectId[] portfolioIds, ObjectId[] projectCodeIds, Date newDataDate) throws ServerException, NetworkException, BusinessObjectException, MultipartObjectIdException -
summarize
public JobId summarize(Project project) throws ServerException, NetworkException, BusinessObjectException Asynchronously summarizes a project.- Parameters:
project- the project- Returns:
- JobId the id of the job
- Throws:
ServerException- if a problem occurred on the server-sideNetworkException- if a problem occurred in the network layerBusinessObjectException- if the project's ObjectId field was not loaded or setIllegalArgumentException- if the project parameter is null
-
summarize
public JobId summarize(ObjectId[] projectIds, ObjectId[] portfolioIds, ObjectId[] projectCodeIds) throws ServerException, NetworkException, BusinessObjectException -
summarize
Asynchronously summarizes an EPS node.- Parameters:
eps- the EPS- Returns:
- JobId the id of the job
- Throws:
ServerException- if a problem occurred on the server-sideNetworkException- if a problem occurred in the network layerBusinessObjectException- if the EPS object's ObjectId field was not loaded or specifiedIllegalArgumentException- if the eps parameter is null
-
summarize
public JobId summarize(ObjectId[] epsIds) throws ServerException, NetworkException, BusinessObjectException -
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 projectfinPerObjId- the financial period- Returns:
- JobId the id of the job
- Throws:
ServerException- if a problem occurred on the server-sideNetworkException- if a problem occurred in the network layerBusinessObjectException- 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 projectsfinPerObjId- the financial period- Returns:
- JobId the id of the job
- Throws:
ServerException- if a problem occurred on the server-sideNetworkException- if a problem occurred in the network layerClientException- if the Projects array parameter is empty
-
recalculateAssignmentCosts
public JobId recalculateAssignmentCosts(Project project, boolean syncOTFactor) throws ServerException, NetworkException, BusinessObjectException Asynchronously recalculates assignment costs for a single project if the price per unit has changed for a resource or role and that assignment has been set to calculate cost from units.- Parameters:
project- the project to recalculate assignment costssyncOTFactor- the flag to synchronize the overtime factor- Returns:
- JobId the id of the job
- Throws:
ServerException- if a problem occurred on the server-sideNetworkException- if a problem occurred in the network layerClientException- if the Projects array parameter is emptyBusinessObjectException
-
recalculateAssignmentCosts
public JobId recalculateAssignmentCosts(Project[] projects, boolean syncOTFactor) throws ServerException, NetworkException, ClientException Asynchronously recalculates assignment costs for multiple projects if the price per unit has changed for a resource or role and that assignment has been set to calculate cost from units.- Parameters:
projects- the projectssyncOTFactor- the flag to synchronize the overtime factor- Returns:
- JobId the id of the job
- Throws:
ServerException- if a problem occurred on the server-sideNetworkException- if a problem occurred in the network layerClientException- if the Projects array parameter is empty
-
level
public JobId level(Project project) throws ServerException, NetworkException, BusinessObjectException Asynchronously levels a project.- Parameters:
project- the project- Returns:
- JobId the id of the job
- Throws:
ServerException- if a problem occurred on the server-sideNetworkException- if a problem occurred in the network layerBusinessObjectException- if the project's ObjectId field was not loaded or set
-
level
Asynchronously levels multiple projects.- Parameters:
projects- the projects- Returns:
- JobId the id of the job
- Throws:
ServerException- if a problem occurred on the server-sideNetworkException- if a problem occurred in the network layerClientException- if the Projects array parameter is empty
-
level
public JobId level(Project[] projects, ObjectId[] projIds, ObjectId[] epsIds, ObjectId[] portfolioIds, ObjectId[] projectCodeIds) throws ServerException, NetworkException, BusinessObjectException, MultipartObjectIdException -
sendToUnifier
public JobId sendToUnifier(Project project) throws ServerException, NetworkException, BusinessObjectException Asynchronously sends a project to Unifier.- Parameters:
project- the project- Returns:
- JobId the id of the job
- Throws:
ServerException- if a problem occurred on the server-sideNetworkException- if a problem occurred in the network layerBusinessObjectException- if the project's ObjectId field was not loaded or set
-
sendToUnifier
public JobId sendToUnifier(Project[] projects) throws ServerException, NetworkException, ClientException Asynchronously sends multiple projects to Unifier.- Parameters:
projects- the projects- Returns:
- JobId the id of the job
- Throws:
ServerException- if a problem occurred on the server-sideNetworkException- if a problem occurred in the network layerClientException- if the Projects array parameter is empty
-
updateBaseline
public JobId updateBaseline(String updateBaselineOptions, Project p) throws ServerException, NetworkException, BusinessObjectException -
summarizeCBS
public JobId summarizeCBS(Project project) throws ServerException, NetworkException, BusinessObjectException Asynchronously summarizes a project by cbs.- Parameters:
project- the project- Returns:
- JobId the id of the job
- Throws:
ServerException- if a problem occurred on the server-sideNetworkException- if a problem occurred in the network layerBusinessObjectException- if the project's ObjectId field was not loaded or set
-
scheduleCheck
public JobId scheduleCheck(Project project) throws ServerException, NetworkException, BusinessObjectException Asynchronously perform check schedule of a project.- Parameters:
project- the project- Returns:
- JobId the id of the job
- Throws:
ServerException- if a problem occurred on the server-sideNetworkException- if a problem occurred in the network layerBusinessObjectException- if the project's ObjectId field was not loaded or set
-
scheduleCheck
public JobId scheduleCheck(Project[] projects) throws ServerException, NetworkException, ClientException Asynchronously perform check schedule of multiple projects.- Parameters:
projects- the projects- Returns:
- JobId the id of the job
- Throws:
ServerException- if a problem occurred on the server-sideNetworkException- if a problem occurred in the network layerClientException- if the Projects array parameter is empty
-
arrayCopy
public ObjectId[] arrayCopy(ObjectId[] srcObjIds, com.primavera.bo.common.PRequest req, ObjectId[] targetObjIds, String boType) throws PhoenixException - Throws:
PhoenixException
-
checkInValidOrNoAccessProjects
public void checkInValidOrNoAccessProjects(ObjectId[] projObjIds, BOIterator<Project> projects, Project[] project, int jobType) throws BusinessObjectException - Throws:
BusinessObjectException
-