Class DefaultBpmnHttpActivityDelegate
java.lang.Object
org.flowable.http.common.impl.BaseHttpActivityDelegate
org.flowable.engine.impl.bpmn.http.DefaultBpmnHttpActivityDelegate
- All Implemented Interfaces:
FutureJavaDelegate<BaseHttpActivityDelegate.ExecutionData>
public class DefaultBpmnHttpActivityDelegate
extends BaseHttpActivityDelegate
implements FutureJavaDelegate<BaseHttpActivityDelegate.ExecutionData>
- Author:
- Filip Hrisafov, Joram Barrez
-
Nested Class Summary
Nested classes/interfaces inherited from class org.flowable.http.common.impl.BaseHttpActivityDelegate
BaseHttpActivityDelegate.ExecutionData, BaseHttpActivityDelegate.RequestData
-
Field Summary
Fields inherited from class org.flowable.http.common.impl.BaseHttpActivityDelegate
disallowRedirects, failStatusCodes, handleStatusCodes, HTTP_TASK_REQUEST_FIELD_INVALID, HTTP_TASK_REQUEST_HEADERS_INVALID, HTTP_TASK_REQUEST_METHOD_INVALID, HTTP_TASK_REQUEST_METHOD_REQUIRED, HTTP_TASK_REQUEST_URL_REQUIRED, httpClient, ignoreException, requestBody, requestBodyEncoding, requestHeaders, requestMethod, requestTimeout, requestUrl, responseVariableName, resultVariablePrefix, saveRequestVariables, saveResponseParameters, saveResponseParametersTransient, saveResponseVariableAsJson
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
afterExecution
(DelegateExecution execution, BaseHttpActivityDelegate.ExecutionData result) Method invoked with the result fromFutureJavaDelegate.execute(DelegateExecution, AsyncTaskInvoker)
.protected Expression
createExpression
(ExpressionManager expManager, Object value) protected List<FieldDeclaration>
createFieldDeclarations
(List<FieldExtension> fieldList, ProcessEngineConfigurationImpl processEngineConfiguration) protected FlowableHttpClient
protected HttpRequestHandler
createHttpRequestHandler
(FlowableHttpRequestHandler handler, ProcessEngineConfigurationImpl processEngineConfiguration) protected HttpResponseHandler
createHttpResponseHandler
(FlowableHttpResponseHandler handler, ProcessEngineConfigurationImpl processEngineConfiguration) protected ScriptHttpHandler
createScriptHttpHandler
(ExpressionManager expressionManager, ScriptInfo scriptInfo) execute
(DelegateExecution execution, AsyncTaskInvoker taskInvoker) Perform the execution of the delegate, potentially on another thread.protected void
propagateError
(VariableContainer container, String code) Methods inherited from class org.flowable.http.common.impl.BaseHttpActivityDelegate
createRequest, getRequestHeaders, prepareAndExecuteRequest, saveResponseFields, validateRequest
-
Constructor Details
-
DefaultBpmnHttpActivityDelegate
public DefaultBpmnHttpActivityDelegate() -
DefaultBpmnHttpActivityDelegate
-
-
Method Details
-
createHttpClient
- Specified by:
createHttpClient
in classBaseHttpActivityDelegate
-
execute
public CompletableFuture<BaseHttpActivityDelegate.ExecutionData> execute(DelegateExecution execution, AsyncTaskInvoker taskInvoker) Description copied from interface:FutureJavaDelegate
Perform the execution of the delegate, potentially on another thread. The result of the future is passed in theFutureJavaDelegate.afterExecution(DelegateExecution, Object)
in order to store the data on the execution on the same thread as the caller of this method. IMPORTANT: the execution should only be used to read data before creating the future. The execution should not be used in the task that will be executed on a new thread.The
AsyncTaskInvoker
is in order to schedule an execution on a different thread. However, it is also possible to use a different scheduler, or return a future not created by the giventaskInvoker
.- Specified by:
execute
in interfaceFutureJavaDelegate<BaseHttpActivityDelegate.ExecutionData>
- Parameters:
execution
- the execution that can be used to extract datataskInvoker
- the task invoker that can be used to execute expensive operation on another thread- Returns:
- the output data of the execution
-
afterExecution
public void afterExecution(DelegateExecution execution, BaseHttpActivityDelegate.ExecutionData result) Description copied from interface:FutureJavaDelegate
Method invoked with the result fromFutureJavaDelegate.execute(DelegateExecution, AsyncTaskInvoker)
. This should be used to set data on theDelegateExecution
. This is on the same thread asFutureJavaDelegate.execute(DelegateExecution, AsyncTaskInvoker)
and participates in the process transaction.- Specified by:
afterExecution
in interfaceFutureJavaDelegate<BaseHttpActivityDelegate.ExecutionData>
- Parameters:
execution
- the execution to which data can be setresult
- the execution data
-
createHttpRequestHandler
protected HttpRequestHandler createHttpRequestHandler(FlowableHttpRequestHandler handler, ProcessEngineConfigurationImpl processEngineConfiguration) -
createExpression
-
createHttpResponseHandler
protected HttpResponseHandler createHttpResponseHandler(FlowableHttpResponseHandler handler, ProcessEngineConfigurationImpl processEngineConfiguration) -
createScriptHttpHandler
protected ScriptHttpHandler createScriptHttpHandler(ExpressionManager expressionManager, ScriptInfo scriptInfo) -
createFieldDeclarations
protected List<FieldDeclaration> createFieldDeclarations(List<FieldExtension> fieldList, ProcessEngineConfigurationImpl processEngineConfiguration) -
propagateError
- Specified by:
propagateError
in classBaseHttpActivityDelegate
-