@PermitAll public class HttpClientTask extends AbstractAsynchronousExecutionTask implements AsynchronousExecutionTask
String
type of httpMethod to execute. Possible values: GET, POST, PUT, DELETE String
request payload - text that will be sent in http request String
request content typeReferenceHolder
object. It is the String reference where the
output from the http call (response payload) will be storedReferenceHolder
object. HTTP response code will be stored into this referenceExecutableTask.Result
Constructor and Description |
---|
HttpClientTask() |
Modifier and Type | Method and Description |
---|---|
Serializable |
collectDataForExecution(TaskContext context)
Collects data from task context for asynchronous execution.
|
boolean |
executeAsynchronously(TaskContext context)
Determines, based on current task context (params, metadata, etc.) if the exeuction
should be done asynchronously.
|
Class<? extends AbstractAsynchronousExecutionTask> |
getImplementationClass() |
Serializable |
processDataAsynchronously(Serializable data)
Process data collected in
AsynchronousExecutionTask.collectDataForExecution(com.whitestein.lsps.engine.lang.TaskContext) . |
void |
processExecutionResult(TaskContext context,
Serializable result)
This method is called after the asynchronous execution has been done
|
processInput, start, terminate
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
processInput, start, terminate
public Class<? extends AbstractAsynchronousExecutionTask> getImplementationClass()
getImplementationClass
in class AbstractAsynchronousExecutionTask
ComponentService
.public Serializable collectDataForExecution(TaskContext context) throws ErrorException
AsynchronousExecutionTask
AsynchronousExecutionTask.processDataAsynchronously(java.io.Serializable)
method asynchronously.collectDataForExecution
in interface AsynchronousExecutionTask
collectDataForExecution
in class AbstractAsynchronousExecutionTask
ErrorException
public void processExecutionResult(TaskContext context, Serializable result) throws ErrorException
AsynchronousExecutionTask
processExecutionResult
in interface AsynchronousExecutionTask
processExecutionResult
in class AbstractAsynchronousExecutionTask
result
- result of asynchronous call of method AsynchronousExecutionTask.processDataAsynchronously(java.io.Serializable)
ErrorException
public Serializable processDataAsynchronously(Serializable data)
AsynchronousExecutionTask
AsynchronousExecutionTask.collectDataForExecution(com.whitestein.lsps.engine.lang.TaskContext)
. This execution is done asynchronously
outside of process model. The result of this execution is afterwards sent back to task (AsynchronousExecutionTask.processExecutionResult(com.whitestein.lsps.engine.lang.TaskContext, java.io.Serializable)
)
so that the computed results can be processed and any necessary changes in model instance can be done.
This method should not throw ErrorException
since it is not executed in model instance context.processDataAsynchronously
in interface AsynchronousExecutionTask
processDataAsynchronously
in class AbstractAsynchronousExecutionTask
data
- data to processpublic boolean executeAsynchronously(TaskContext context) throws ErrorException
AsynchronousExecutionTask
AsynchronousExecutionTask.processDataAsynchronously(java.io.Serializable)
will be
executed outside model instance (thus not blocking transaction, model execution, etc.}. If
false it will be called directly.executeAsynchronously
in interface AsynchronousExecutionTask
executeAsynchronously
in class AbstractAsynchronousExecutionTask
ErrorException
Copyright © 2007-2020 Whitestein Technologies. All Rights Reserved.