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 stepsTo retrieve file attachments from tasks, perform the following
tasks:
Include project files.
Create a TaskManager Client API object.
Retrieve the file attachments.
Include project filesInclude 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 objectBefore you can programmatically
retrieve file attachments, you must create a TaskManager object.
Retrieve the file attachmentsTo 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 APIRetrieve file attachments from tasks by using the Java
API:
Include project files
Include client JAR files,
such as adobe-taskmanager-client-sdk.jar, in your Java project’s
class path.
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.
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 APIRetrieve file attachments from tasks by using the the web
service API:
Include project files
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.
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.
|
|
|