public abstract class BaseJavaDelegate extends Object implements org.activiti.engine.delegate.JavaDelegate
| Modifier and Type | Field and Description |
|---|---|
protected ActivitiHelper |
activitiHelper |
protected ActivitiRuntimeHelper |
activitiRuntimeHelper |
protected ActivitiService |
activitiService |
protected ConfigurationDaoHelper |
configurationDaoHelper |
protected HerdStringHelper |
daoHelper |
protected HerdStringHelper |
herdStringHelper |
protected JobDefinitionDao |
jobDefinitionDao |
protected JobDefinitionDaoHelper |
jobDefinitionDaoHelper |
protected JobDefinitionHelper |
jobDefinitionHelper |
protected JsonHelper |
jsonHelper |
protected UserNamespaceAuthorizationHelper |
userNamespaceAuthorizationHelper |
static String |
VARIABLE_JSON_RESPONSE
Variable that is set in workflow for the json response.
|
protected XmlHelper |
xmlHelper |
| Constructor and Description |
|---|
BaseJavaDelegate() |
| Modifier and Type | Method and Description |
|---|---|
void |
execute(org.activiti.engine.delegate.DelegateExecution execution)
This is what Activiti will call to execute this task.
|
abstract void |
executeImpl(org.activiti.engine.delegate.DelegateExecution execution)
The execution implementation.
|
protected ApplicationUser |
getApplicationUser(org.activiti.engine.delegate.DelegateExecution execution)
Retrieves application user per last updater of the current process instance's job definition.
|
protected <T> T |
getRequestObject(String contentType,
String requestString,
Class xsdClass)
Converts the request string to xsd object.
|
protected void |
handleException(org.activiti.engine.delegate.DelegateExecution execution,
Exception exception)
Handles any exception thrown by an Activiti task.
|
boolean |
isSpringInitialized() |
protected void |
logInputParameters(org.activiti.engine.delegate.DelegateExecution execution)
Loops through all process variables and logs them.
|
protected void |
logTaskExecutionTime(long taskBeginTimeMillis,
boolean taskSuccessFlag)
Logs the Activiti task execution time
|
void |
setJsonResponseAsWorkflowVariable(Object responseObject,
org.activiti.engine.delegate.DelegateExecution execution)
Sets a JSON response object as a workflow variable.
|
void |
setJsonResponseAsWorkflowVariable(Object responseObject,
String executionId,
String activitiId) |
protected void |
setSecurityContext(ApplicationUser applicationUser)
Sets the security context per last updater of the current process instance's job definition.
|
void |
setSpringInitialized(boolean springInitialized) |
protected void |
setTaskWorkflowVariable(org.activiti.engine.delegate.DelegateExecution execution,
String variableName,
Object variableValue)
Sets the workflow variable with task id prefixed.
|
protected void |
setTaskWorkflowVariable(String executionId,
String activitiId,
String variableName,
Object variableValue) |
@Autowired protected ActivitiService activitiService
@Autowired protected ConfigurationDaoHelper configurationDaoHelper
@Autowired protected HerdStringHelper daoHelper
@Autowired protected HerdStringHelper herdStringHelper
@Autowired protected JobDefinitionDao jobDefinitionDao
@Autowired protected JobDefinitionDaoHelper jobDefinitionDaoHelper
@Autowired protected JobDefinitionHelper jobDefinitionHelper
@Autowired protected JsonHelper jsonHelper
@Autowired protected UserNamespaceAuthorizationHelper userNamespaceAuthorizationHelper
@Autowired protected XmlHelper xmlHelper
public static final String VARIABLE_JSON_RESPONSE
@Autowired protected ActivitiHelper activitiHelper
@Autowired protected ActivitiRuntimeHelper activitiRuntimeHelper
public abstract void executeImpl(org.activiti.engine.delegate.DelegateExecution execution)
throws Exception
execution - the delegation execution.Exception - when a problem is encountered. A BpmnError should be thrown when there is a problem that should be handled by the workflow. All other
errors will be considered system errors that will be logged.public final void execute(org.activiti.engine.delegate.DelegateExecution execution)
throws Exception
execute in interface org.activiti.engine.delegate.JavaDelegateexecution - the execution information.Exception - if any errors were encountered.protected void logTaskExecutionTime(long taskBeginTimeMillis,
boolean taskSuccessFlag)
taskBeginTimeMillis - the task begin time in millisecondtaskSuccessFlag - the success flag for the taskprotected void setSecurityContext(ApplicationUser applicationUser)
applicationUser - the application userprotected ApplicationUser getApplicationUser(org.activiti.engine.delegate.DelegateExecution execution)
execution - the delegate executionprotected void handleException(org.activiti.engine.delegate.DelegateExecution execution,
Exception exception)
throws Exception
execution - The execution which identifies the task.exception - The exception that has been thrownException - Some exceptions may choose to bubble up the exceptionpublic void setJsonResponseAsWorkflowVariable(Object responseObject, org.activiti.engine.delegate.DelegateExecution execution) throws Exception
responseObject - the JSON object.execution - the delegate execution.Exception - if any problems were encountered.public void setJsonResponseAsWorkflowVariable(Object responseObject, String executionId, String activitiId) throws Exception
Exceptionpublic boolean isSpringInitialized()
public void setSpringInitialized(boolean springInitialized)
protected void setTaskWorkflowVariable(org.activiti.engine.delegate.DelegateExecution execution,
String variableName,
Object variableValue)
execution - the delegate execution.variableName - the variable namevariableValue - the variable valueprotected void setTaskWorkflowVariable(String executionId, String activitiId, String variableName, Object variableValue)
protected <T> T getRequestObject(String contentType, String requestString, Class xsdClass)
T - the type of the returned object.contentType - the content type "xml" or "json"requestString - the request stringxsdClass - the xsd class of the object to convert toprotected void logInputParameters(org.activiti.engine.delegate.DelegateExecution execution)
execution - the execution informationCopyright © 2019. All rights reserved.