Take a survey

Invoking LiveCycle ES > Invoking LiveCycle ES Using the Java API > Invoking services using the Invocation API > Invoking a long-lived process using the Invocation API

Invoking a long-lived process using the Invocation API
You can invoke a long-lived process using the Invocation API by performing the following steps:
1.
2.
3.
Create a ServiceClientFactory object by invoking the ServiceClientFactory object’s static createInstance method and passing the java.util.Properties object that contains connection properties. A ServiceClientFactory object is a Java singleton responsible for creating a ServiceClient instance and maintaining connection settings.
4.
Create a ServiceClient object by invoking the ServiceClientFactory object’s getServiceClient method. A ServiceClient object enables you to invoke a service operation. It handles tasks such as locating, dispatching, and routing invocation requests.
5.
Create a java.util.HashMap object by using its constructor.
6.
Invoke this object’s put method for each parameter to pass to the service.
7.
Create an InvocationRequest object by invoking the ServiceClientFactory object’s createInvocationRequest method and passing the following values:
The java.util.HashMap object that contains the parameter values that are required by the service operation.
A Boolean value that specifies false, which creates an asynchronous request (this is required to invoke a long-lived operation).
8.
Send the invocation request to the service by invoking the ServiceClient object’s invoke method and passing the InvocationRequest object. The invoke method returns an InvocationReponse object.
9.
Get the invocation identifier of the long-lived operation by invoking the InvocationReponse object’s getInvocationId method.
10.
Create a JobManager object by using its constructor and passing the ServiceClientFactory object.
11.
Create a JobId object that represents the status of the long-lived process by using its constructor and passing the invocation identifier value that was returned by the getInvocationId method.
12.
Check the status of the long-lived operation by invoking the JobManager object’s getStatus method and passing the JobId object. This method returns a JobStatus object.
13.
Determine the status of the long-lived process by invoking the JobStatus object’s getStatusCode method. If the long-lived operation completed successfully, then this method returns JobStatus.JOB_STATUS_COMPLETED. If the long-lived operation did not complete successfully, then this method returns JobStatus.JOB_STATUS_FAILED. For information about other status values, see the LiveCycle ES API References.
14.
Dispose of the job by invoking the JobManager object’s disposeJob method and passing the JobId object that corresponds to the job that you want to dispose.
View Quick Start
 

 

Send me an e-mail when comments are added to this page | Comment Report

Current page: http://livedocs.adobe.com/livecycle/es/sdkHelp/programmer/sdkHelp/invokingJava.22.11.html