Retrieving the Status of a LiveCycle Job

You can programmatically retrieve the status of a LiveCycle job by using the Job Manager API. A job occurs when a long-lived process is invoked. For example, when you invoke a long-lived process by using the Invocation API, a job is created.

The following list specifies job status values:

  • 0 (JOB_STATUS_UNKNOWN): Indicates that the job status is unknown

  • 1 (JOB_STATUS_QUEUED): Indicates that the job is queued.

  • 2 (JOB_STATUS_RUNNING): Indicates that the job is currently running

  • 3 (JOB_STATUS_COMPLETED): Indicates that the job is completed

  • 4 (JOB_STATUS_FAILED): Indicates that the job failed

  • 5 (JOB_STATUS_TERMINATED): Indicates that the job is terminated

  • 6 (JOB_STATUS_SUSPENDED): Indicates that the job is suspended

  • 7 (JOB_STATUS_COMPLETE_REQUESTED): Indicates that a job complete request was made

  • 8 (JOB_STATUS_TERMINATE_REQUESTED): Indicates that a job terminate request was made

  • 9 (JOB_STATUS_SUSPEND_REQUESTED): Indicates that a job suspend request was made

  • 10 (JOB_STATUS_RESUME_REQUESTED): Indicates that a job resume request was made

Summary of steps

To retrieve the status of a LiveCycle job, perform the following tasks:

  1. Include project files.

  2. Create a JobManager Client API object.

  3. Specify search criteria.

  4. Perform the search.

  5. Iterate through the returned job instances.

Include project files

Include necessary files into your development project. If you are creating a client application by using Java, include the necessary JAR files. If you are using web services, make sure that you include the proxy files.

Create a JobManager Client API object

Before you can programmatically retrieve LiveCycle job instances, you must create a JobManager object.

Specify filter criteria

To search for job status values, define filter criteria. You can, for example, limit the number of jobs that are returned. To define filter criteria, you use a JobInstanceFilter instance.

Perform the search

After you specify filter criteria, you can perform the search. All job instances are returned within a list. That is, each element in the list is a JobInstance object.

Iterate through the returned job instances

Iterate through the returned list to retrieve each process instance. After you obtain a process instance, you can obtain information about it. For example, you can determine its status.

Note: For information on how to retrieve the status of a job using web sevices, see Creating an ASP.NET web application that invokes a human-centric long-lived process.

Retrieve the status of a job using the Java API

Retrieve the status of a job by using the Job Manager API (Java):

  1. Include project files

    Include client JAR files, such as adobe-jobmanager-client-sdk.jar, in your Java project’s class path.

  2. Create a JobManager Client API object

    • Create a ServiceClientFactory object that contains connection properties.

    • Create a JobManager object by invoking its constructor and passing the ServiceClientFactory object.

  3. Specify filter criteria

    • Create a JobInstanceFilter object that is used to define search criteria by using its constructor.

    • Define filter criteria by invoking an appropriate method that belongs to the JobInstanceFilter object. For example, to define the maximum number of jobs to return, invoke the JobInstanceFilter object’s setMaxObjects method, and pass an integer value that specifies value.

  4. Perform the search

    Search for jobs by invoking the JobManager object’s getJobInstances method and passing the JobInstanceFilter object. This method returns a java.util.List instance, where each element is a JobInstance instance that represents a LiveCycle job.

  5. Iterate through the returned job instances

    • Create a java.util.Iterator object by invoking the java.util.List object’s iterator method. This object lets you iterate through the java.util.List instance to retrieve job instances.

    • Iterate through the java.util.List object. If they are jpb instances, each element is a JobInstance instance.

    • Retrieve information about a job by invoking an appropriate method that belongs to the JobInstance object. For example, to get the status of the job, invoke the JobInstance object’s getStatus method.

// Ethnio survey code removed