Retrieving File Attachments from Tasks

When a process instance is started from within Workspace, a user can attach files, such as image files, which lets the user view the files while completing a task. You can retrieve file attachments from tasks by using the Java API and web service API. After you retrieve file attachments, you can process them to meet your business requirements. For example, you can retrieve a file attachment and save it as a local file.

Note: The name of the service that is invoked when retrieving file attachments from a task is TaskManagerService. To create a proxy object that lets you invoke its operations by using a web service, specify the following WSDL definition: http://localhost:8080/soap/services/TaskManagerService?WSDL . (See Invoking LiveCycle using Web Services .)

Summary of steps

To retrieve file attachments from tasks, perform the following tasks:

  1. Include project files.

  2. Create a TaskManager Client API object.

  3. Retrieve the file attachments.

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 TaskManager Client API object

Before you can programmatically retrieve file attachments, you must create a TaskManager object.

Retrieve the file attachments

To retrieve form data from a task, reference the task that contains the form by using the task identifier. You can determine the task identifier by retrieving tasks that are assigned to a specific user. (See Retrieving Tasks Assigned to Users .)

After you obtain a file attachment, you can save it as a local file (or perform another task that meets your business requirements).

Retrieve file attachments from tasks using the Java API

Retrieve file attachments from tasks by using the Java API:

  1. Include project files

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

  2. Create a TaskManager Client API object

    • Create a ServiceClientFactory object that contains connection properties.

    • Create a TaskManager object by invoking the TaskManagerClientFactory object’s static getTaskManager method and passing the ServiceClientFactory object.

  3. Retrieve the file attachments

    • Retrieve file attachments by invoking the TaskManager object’s getAttachmentListForTask method and passing the task identifier value. This method returns a java.util.List object where each element is a com.adobe.idp.Document object that contains a file attachment. You can determine the task identifier by retrieving tasks that are assigned to a specific user.

    • Iterate through the java.util.List object and for each element, cast the element value to a com.adobe.idp.Document instance.

Retrieve file attachments from tasks using the web service API

Retrieve file attachments from tasks by using the the web service API:

  1. Include project files

    • Create a Microsoft .NET client assembly that consumes the TaskManagerService WSDL.

    • Reference the Microsoft .NET client assembly.

  2. Create a TaskManager Client API object

    • Using the Microsoft .NET client assembly, create a TaskManagerServiceService object by invoking its default constructor.

    • Set the TaskManagerServiceService object’s Credentials data member with a System.Net.NetworkCredential value that specifies the user name and password value.

  3. Retrieve the file attachments

    • Retrieve file attachments by invoking the TaskManagerServiceService object’s getAttachmentListForTask method and passing the task identifier value and a Boolean value that specifies true . This method returns an Object array where each element is a BLOB object that contains a file attachment. You can determine the task identifier by retrieving tasks that are assigned to a specific user. (See Retrieving Tasks Assigned to Users .)

    • Iterate through the Object array by creating a loop structure and, for each element, cast the element value to a BLOB instance.

See also

Retrieving File Attachments from Tasks

Quick Start (Base64): Retrieving file attachments from tasks using the web service API

Invoking LiveCycle using Base64 encoding

// Ethnio survey code removed