public abstract class AbstractTask extends DocumentWorkerObjectImpl implements Task
| Modifier and Type | Field and Description |
|---|---|
protected DocumentImpl |
document |
protected ResponseImpl |
response |
protected ScriptsImpl |
scripts |
application| Modifier | Constructor and Description |
|---|---|
protected |
AbstractTask(ApplicationImpl application,
com.hpe.caf.api.worker.WorkerTaskData workerTask,
ReadOnlyDocument effectiveDocument,
Map<String,String> customData) |
protected |
AbstractTask(ApplicationImpl application,
com.hpe.caf.api.worker.WorkerTaskData workerTask,
ReadOnlyDocument effectiveDocument,
Map<String,String> customData,
List<DocumentWorkerScript> scripts) |
| Modifier and Type | Method and Description |
|---|---|
com.hpe.caf.api.worker.WorkerResponse |
createWorkerResponse() |
protected abstract com.hpe.caf.api.worker.WorkerResponse |
createWorkerResponseImpl() |
String |
getCustomData(String dataKey) |
DocumentImpl |
getDocument() |
Response |
getResponse() |
ScriptsImpl |
getScripts() |
<S> S |
getService(Class<S> service) |
com.hpe.caf.api.worker.WorkerResponse |
handleGeneralFailure(Throwable failure)
Returns appropriate WorkerResponse for the task in the event of a general task failure.
|
protected abstract com.hpe.caf.api.worker.WorkerResponse |
handleGeneralFailureImpl(Throwable failure) |
void |
loadScripts()
Load the customization scripts and if there is an exception then try to determine if it is a transient issue.
|
void |
raiseAfterProcessDocumentEvent(Document document) |
void |
raiseAfterProcessTaskEvent() |
boolean |
raiseBeforeProcessDocumentEvent(Document document) |
boolean |
raiseOnErrorEvent(RuntimeException ex) |
void |
raiseProcessDocumentEvent(Document document) |
void |
raiseProcessTaskEvent() |
void |
unloadScripts() |
getApplicationclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetApplicationprotected final DocumentImpl document
protected final ResponseImpl response
protected final ScriptsImpl scripts
protected AbstractTask(ApplicationImpl application, com.hpe.caf.api.worker.WorkerTaskData workerTask, ReadOnlyDocument effectiveDocument, Map<String,String> customData)
protected AbstractTask(ApplicationImpl application, com.hpe.caf.api.worker.WorkerTaskData workerTask, ReadOnlyDocument effectiveDocument, Map<String,String> customData, List<DocumentWorkerScript> scripts) throws InvalidScriptException
InvalidScriptException@Nonnull public final DocumentImpl getDocument()
getDocument in interface Taskpublic final String getCustomData(String dataKey)
getCustomData in interface Task@Nonnull public final ScriptsImpl getScripts()
getScripts in interface Taskpublic <S> S getService(Class<S> service)
getService in interface Task@Nonnull public Response getResponse()
getResponse in interface Task@Nonnull public final com.hpe.caf.api.worker.WorkerResponse createWorkerResponse()
@Nonnull protected abstract com.hpe.caf.api.worker.WorkerResponse createWorkerResponseImpl()
@Nonnull public final com.hpe.caf.api.worker.WorkerResponse handleGeneralFailure(Throwable failure)
failure - detail of the failure that occurred@Nonnull protected abstract com.hpe.caf.api.worker.WorkerResponse handleGeneralFailureImpl(Throwable failure)
public void loadScripts()
throws DocumentWorkerTransientException,
InterruptedException
DocumentWorkerTransientException - if one of the scripts could not be loaded due to a transient issueInterruptedException - if any thread has interrupted the current threadpublic void unloadScripts()
public void raiseProcessTaskEvent()
throws DocumentWorkerTransientException,
InterruptedException
public boolean raiseBeforeProcessDocumentEvent(Document document) throws DocumentWorkerTransientException, InterruptedException
public void raiseProcessDocumentEvent(Document document) throws DocumentWorkerTransientException, InterruptedException
public void raiseAfterProcessDocumentEvent(Document document) throws DocumentWorkerTransientException, InterruptedException
public void raiseAfterProcessTaskEvent()
throws DocumentWorkerTransientException,
InterruptedException
public boolean raiseOnErrorEvent(RuntimeException ex) throws DocumentWorkerTransientException, InterruptedException
Copyright © 2016–2021 EntIT Software LLC, a Micro Focus company. All rights reserved.