Avatar

Level 3

Please download the jar file here:

http://www.sendspace.com/file/zgafgg

Here is the source code for the operation:

public com.adobe.idp.Document QueryFormData(long TaskId){
        try{
            //Set connection properties required to invoke LiveCycle ES2                                                                                                                      
             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, "administrator");
             connectionProps.setProperty(ServiceClientFactoryProperties.DSC_CREDENTIAL_PASSWORD, "password");
          
           //Create a ServiceClientFactory object
           ServiceClientFactory myFactory = ServiceClientFactory.createInstance(connectionProps);

           //Create a TaskManager object
           TaskManager myTaskManager = TaskManagerClientFactory.getTaskManager(myFactory);   
                      
           TaskInfo tInfo = myTaskManager.getTaskInfo(TaskId);
                      
           //Retrieve the form instance associated with task
           FormInstance[] fi = tInfo.getTaskItems();
           long formInstanceId = fi[0].getFormInstanceId();
           FormInstance newfi = myTaskManager.getFormInstanceForTask(TaskId, formInstanceId, true);
          
           //Get data located in the form
           Document doc = newfi.getDocument();


           return doc;
           }
          
       catch(Exception e)
       {
           System.out.println(e.getMessage());
           return null;
       }

    }