Expand my Community achievements bar.

JobManager service functionality

Avatar

Level 2

I have JobManager: 1.0 service with ComponentID: com.adobe.idp.jobmanager.service.JobManagerComponent on Adobe LC Server.

I've created a service link in my .NET application and

JobManagerService proxy class was generated. BUT the instance of JobManagerService clsss doesn't have any "getResult" methods.

How I can get the results of asynchronous call if I use web service walkthrough but not remoting?

Thanks in advance.

Help topic:

Create a JobManagerService object by using its constructor.
Create a JobId object by using its constructor.
Set the JobId object’s id data member with the return value of the MortgageLoanPrebuiltService object’s invoke_Async method.
Assign the value true to the JobId object’s persistent data member.
Create a JobStatus object by invoking the JobManagerService object ‘s getStatus method and passing the JobId object.
Get the status value by retrieving the value of the JobStatus object’s statusCode data member.

There is NO action to get the return parameters!

5 Replies

Avatar

Level 2

I've found a temp solution to achieve my goal. I created a new livecycle process with only 1 JavaExecute service. The process has only 1 input parameter - jobID and returns results of long-lived processes invoking. Investigation to be continued...

Avatar

Level 2

What is a JavaExecute service? I don't seem to have that in my list of available services in workbench. Is that the same as ExecuteScript? If so, can you provide the script you use for this?

Avatar

Former Community Member

Hi.

1) Yep, that was exactly ExecuteScript service.

2) Java API is able to retrieve the results.

There is actually not bad example at http://livedocs.adobe.com/livecycle/8.2/programLC/programmer/help/wwhelp/wwhimpl/js/html/wwhelp.htm?...

Hope it'll be useful)

Regards,

Irina.

Avatar

Level 2

Hi, Mike.

Exactly, it's ExecureScript.

First time I will do this for free but next time only for money or at least for beer. SkypeMe: pavel_savashynski

import com.adobe.idp.dsc.clientsdk.ServiceClientFactory;
import com.adobe.idp.dsc.clientsdk.ServiceClient;
import com.adobe.idp.dsc.clientsdk.ServiceClientFactoryProperties;
import com.adobe.idp.dsc.FaultResponse;
import com.adobe.idp.dsc.InvocationRequest;
import com.adobe.idp.dsc.InvocationResponse;
import java.util.Properties;
import java.util.Map;
import java.util.HashMap;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import org.w3c.dom.Element;
import com.adobe.idp.jobmanager.client.JobManager;
import com.adobe.idp.jobmanager.common.JobId;
import com.adobe.idp.jobmanager.common.JobStatus;

//Set variables
String invocationId = patExecContext.getProcessDataStringValue("/process_data/@invocationId");

//Set connection properties required to invoke LiveCycle ES
Properties connectionProps = new Properties();
connectionProps.setProperty(ServiceClientFactoryProperties.DSC_DEFAULT_EJB_ENDPOINT, "jnp://localhost:1099");
connectionProps.setProperty(ServiceClientFactoryProperties.DSC_TRANSPORT_PROTOCOL,ServiceClientFactoryProperties.DSC_EJB_PROTOCOL);
connectionProps.setProperty(ServiceClientFactoryProperties.DSC_SERVER_TYPE,"JBoss");
connectionProps.setProperty(ServiceClientFactoryProperties.DSC_CREDENTIAL_USERNAME, "adm");
connectionProps.setProperty(ServiceClientFactoryProperties.DSC_CREDENTIAL_PASSWORD, "pass");

//Create a ServiceClientFactory object
ServiceClientFactory myFactory = ServiceClientFactory.createInstance(connectionProps);

//Create a Job Manager object to check the results of an asynchronous request
JobManager jobManager = new JobManager(myFactory);

//Create a JobID object that represents the status of the long-lived operation
JobId myJobId = new JobId(invocationId);

InvocationResponse jobResponse = jobManager.getResponse(myJobId);
jobManager.disposeJob(myJobId);

Object[] two = jobResponse.getOutputParameters().values().toArray();


for (int i=0;i<two.length;i++)
{
if (two[i] instanceof String)
{
  String iid = (String)two[i];
  patExecContext.setProcessDataStringValue("/process_data/imageID", iid);
}
   if (two[i] instanceof com.adobe.idp.Document)
  {
   System.out.println("xdpDocument");
   com.adobe.idp.Document file = (com.adobe.idp.Document) two[i];
    patExecContext.setProcessDataDocumentValue("/process_data/@resultPDF", file);
  }

}

It's OK for my target.