Getting information about a running or pending job
GetFactoryServiceJobs returns a list of synchronous jobs that are either running or pending on the node specified by the TargetServer element in the SOAP header. You can also request a list of synchronous and asynchronous reports currently running on the target machine and specific job properties.
GetFactoryServiceJobs always returns the following data in
Table 5‑4 for a running or a pending job.
Table 5‑4 Job data for GetFactoryServiceJobs
Pending synchronous job | Running job |
ConnectionHandle | ConnectionHandle for a synchronous job |
IsTransient | IsSyncJob |
ObjectId | ObjectId for a synchronous job |
Volume | IsTransient for a synchronous job |
| JobId for an asynchronous job |
| Volume for synchronous and asynchronous jobs |
You can use PendingSyncJobsResultDef and RunningJobsResultDef to define other properties to retrieve for a pending or a running job, as shown in the following example:
<SOAP-ENV:Header>
<AuthId>G4RhQBxOo0HDEQLSkwhYEHFr2ZcApO1AA==</AuthId>
<TargetServer>Tokyo</TargetServer>
</SOAP-ENV:Header>
<SOAP-ENV:Body>
<GetFactoryServiceJobs>
<PendingSyncJobsResultDef>
<String>Owner</String>
<String>ExecutableFileName</String>
<String>ExecutableVersionNumber</String>
<String>PendingTime</String>
<String>ResourceGroup</String>
</PendingSyncJobsResultDef>
<RunningJobsResultDef>
<String>Owner</String>
<String>ExecutableFileName</String>
<String>StartTime</String>
<String>RunningTime</String>
<String>ExecutionTimeout</String>
<String>ResourceGroup</String
</RunningJobsResultDef>
</GetFactoryServiceJobs >
</SOAP-ENV:Body>
This request returns the default properties and those requested in ResultDef. For a pending job, the response includes details such as the full path to the executable file, the version number, the resource group to which the job is assigned, and the time since the report entered the queue, expressed in seconds. For a running job, the response can include the number of seconds the report has been running and the number of seconds remaining before job execution times out. The following example shows a response that includes synchronous and asynchronous jobs:
<SOAP-ENV:Body>
<GetFactoryServiceJobsResponse>
<PendingSyncJobs>
<PendingSyncJob>
<ConnectionHandle>1DelRhsJO8Jo</ConnectionHandle>
<ObjectId>25</ObjectId>
<IsTransient>true</IsTransient>
<Volume>Dresden</Volume>
<Owner>Ray Morrell</Owner>
<ExecutableFileName>/Marketing/Campaign2008.rptdesign
</ExecutableFileName>
<ExecutableVersionNumber>2</ExecutableVersionNumber >
<PendingTime>921</PendingTime >
<ResourceGroup>Default Sync</ResourceGroup>
</PendingSyncJob>
…
</PendingSyncJobs>
<RunningJobs>
<RunningJob>
<IsSyncJob>true</IsSyncJob>
<ConnectionHandle>1DelRhsJO8Jo</ConnectionHandle>
<ObjectId>125</ObjectId>
<IsTransient>true</IsTransient>
<Volume>Corinth</Volume>
<Owner>Pablo Ruiz</Owner>
<ExecutableFileName>/Forecasts/detail.rptdesign
</ExecutableFileName>
<StartTime>2008-10-03 06:11:51</StartTime>
<RunningTime>821</RunningTime>
<ExecutionTimeout>79</ExecutionTimeout>
<ResourceGroup>Default Sync</ResourceGroup>
</RunningJob>
<RunningJob>
<IsSyncJob>false</IsSyncJob>
<ConnectionHandle>1DelRhsJO8Jo</ConnectionHandle>
<ObjectId>3031</ObjectId>
<IsTransient>true</IsTransient>
<Volume>Rubio</Volume>
<Owner>Frank Kitada</Owner>
<ExecutableFileName>/Forecasts/regions.rptdesign
</ExecutableFileName>
<StartTime>2008-10-03 06:13:41</StartTime>
<RunningTime>438</RunningTime> <ExecutionTimeout>500</ExecutionTimeout>
<ResourceGroup>Default Async</ResourceGroup>
</RunningJob>
</RunningJobs>
</GetFactoryServiceJobs Response>
</SOAP-ENV:Body>