public interface Task extends DocumentWorkerObject
The task includes a document or a partial document to be processed, as well as some custom data which may include processing instructions.
| Modifier and Type | Method and Description |
|---|---|
String |
getCustomData(String dataKey)
Used to retrieve any custom data that was sent with the task.
|
Document |
getDocument()
Returns the document to be processed by this task.
|
Response |
getResponse()
Returns an object which can be used to customise the response to the document processing task.
|
Scripts |
getScripts()
Gets the list of customization scripts associated with this task.
|
<S> S |
getService(Class<S> service)
Returns the specified task-level service, or
null if the service has not been registered. |
getApplicationString getCustomData(String dataKey)
dataKey - the key of the data to be retrieved (note that the key lookup is case-sensitive)@Nonnull Document getDocument()
@Nonnull Scripts getScripts()
Scripts are ordered and can be accessed by index.
<S> S getService(Class<S> service)
null if the service has not been registered.
This method can be used to access task-level services that are provided by the underlying Worker Framework but not exposed by the Document Worker Framework.
For example, to access the Worker Framework WorkerTaskData object add the following dependency to the project POM:
<dependency>
<groupId>com.github.workerframework</groupId>
<artifactId>worker-api</artifactId>
<scope>provided</scope>
</dependency>
and then retrieve the object using this method:
WorkerTaskData workerTask = documentTask.getService(WorkerTaskData.class);S - the type of the service to be returnedservice - the interface or abstract class representing the serviceApplication.getService()Copyright © 2016–2022 EntIT Software LLC, a Micro Focus company. All rights reserved.