Class ProcessengineTaskRunner
- java.lang.Object
-
- de.hybris.platform.processengine.process.ProcessengineTaskRunner
-
- All Implemented Interfaces:
TaskRunner<ProcessTaskModel>
public class ProcessengineTaskRunner extends java.lang.Object implements TaskRunner<ProcessTaskModel>
SpecialTaskRunnerimplementation intended to work withProcessengineTaskExecutionStrategyonly!This runner takes over responsibility to start and finish transaction contrary to
DefaultTaskExecutionStrategy.
-
-
Constructor Summary
Constructors Constructor Description ProcessengineTaskRunner()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected voidbeforeRun(TaskService taskService, ProcessTaskModel task)protected java.lang.StringcloseLogAndReadMessages(org.apache.log4j.FileAppender appender)protected java.lang.StringdoRun(TaskService taskService, ProcessTaskModel task)ExecutesrunProcessTask(ProcessTaskModel)viarunProcessTaskInTransaction(ProcessTaskModel)and performs error handling viaprocessRunError(TaskService, ProcessTaskModel, Throwable).protected voidfinishLogging(BusinessProcessModel process, ProcessTaskModel task, org.apache.log4j.FileAppender appender, java.util.Date startDate, java.lang.String returnCode)Deprecated.since 6.3.0protected NodegetNodeForExecution(ProcessTaskModel task)Fetches node for execution.protected ProcessDefinitiongetProcessDefinition(BusinessProcessModel process)voidhandleError(TaskService taskManager, ProcessTaskModel task, java.lang.Throwable error)ProcessEngineLoggingCtxinitLoggingCtx(ProcessTaskModel task)protected java.lang.StringprocessRunError(TaskService taskService, ProcessTaskModel task, java.lang.Throwable e)Processes error that has occurred either during node execution or transaction handling around it.voidrun(TaskService taskService, ProcessTaskModel task)Captures logs and performs actual business logic viadoRun(TaskService, ProcessTaskModel).protected java.lang.StringrunProcessTask(ProcessTaskModel task)Performs actual processing of node business logic.protected java.lang.StringrunProcessTaskInTransaction(ProcessTaskModel task)WrapsrunProcessTask(ProcessTaskModel)into transaction.voidsetModelService(ModelService modelService)voidsetProcessDefinitionFactory(ProcessDefinitionFactory processDefinitionFactory)voidsetProcessParameterHelper(ProcessParameterHelper processParameterHelper)voidsetSessionService(SessionService sessionService)voidsetTransactionTemplate(org.springframework.transaction.support.TransactionTemplate transactionTemplate)voidsetUserService(UserService userService)protected org.apache.log4j.FileAppenderstartLogging(BusinessProcessModel process, ProcessTaskModel task)Deprecated.since 6.3.0voidstopLoggingCtx(TaskLoggingCtx taskCtx)-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface de.hybris.platform.task.TaskRunner
isLoggingSupported
-
-
-
-
Method Detail
-
run
public void run(TaskService taskService, ProcessTaskModel task)
Captures logs and performs actual business logic viadoRun(TaskService, ProcessTaskModel).- Specified by:
runin interfaceTaskRunner<ProcessTaskModel>- See Also:
ProcessEngineLoggingCtx,doRun(TaskService, ProcessTaskModel)
-
doRun
protected java.lang.String doRun(TaskService taskService, ProcessTaskModel task)
ExecutesrunProcessTask(ProcessTaskModel)viarunProcessTaskInTransaction(ProcessTaskModel)and performs error handling viaprocessRunError(TaskService, ProcessTaskModel, Throwable).
-
runProcessTaskInTransaction
protected java.lang.String runProcessTaskInTransaction(ProcessTaskModel task) throws NodeExecutionException
WrapsrunProcessTask(ProcessTaskModel)into transaction.- Throws:
NodeExecutionException- See Also:
runProcessTask(ProcessTaskModel)
-
runProcessTask
protected java.lang.String runProcessTask(ProcessTaskModel task) throws NodeExecutionException
Performs actual processing of node business logic. Intended to be called inside a transaction.- Throws:
NodeExecutionException
-
getNodeForExecution
protected Node getNodeForExecution(ProcessTaskModel task)
Fetches node for execution.
-
processRunError
protected java.lang.String processRunError(TaskService taskService, ProcessTaskModel task, java.lang.Throwable e)
Processes error that has occurred either during node execution or transaction handling around it. Generally switches the process into error state and delegates to optionally existing error node from process definition.
-
beforeRun
protected void beforeRun(TaskService taskService, ProcessTaskModel task)
-
handleError
public void handleError(TaskService taskManager, ProcessTaskModel task, java.lang.Throwable error)
- Specified by:
handleErrorin interfaceTaskRunner<ProcessTaskModel>
-
getProcessDefinition
protected ProcessDefinition getProcessDefinition(BusinessProcessModel process)
-
startLogging
@Deprecated protected org.apache.log4j.FileAppender startLogging(BusinessProcessModel process, ProcessTaskModel task)
Deprecated.since 6.3.0Not used anymore.ProcessEngineLoggingCtxis responsible for logging.- Parameters:
process-task-- Returns:
-
finishLogging
@Deprecated protected void finishLogging(BusinessProcessModel process, ProcessTaskModel task, org.apache.log4j.FileAppender appender, java.util.Date startDate, java.lang.String returnCode)
Deprecated.since 6.3.0Not used anymore.ProcessEngineLoggingCtxis responsible for logging.- Parameters:
process-task-appender-startDate-returnCode-
-
closeLogAndReadMessages
protected java.lang.String closeLogAndReadMessages(org.apache.log4j.FileAppender appender)
-
setTransactionTemplate
public void setTransactionTemplate(org.springframework.transaction.support.TransactionTemplate transactionTemplate)
-
setProcessDefinitionFactory
public void setProcessDefinitionFactory(ProcessDefinitionFactory processDefinitionFactory)
-
setProcessParameterHelper
public void setProcessParameterHelper(ProcessParameterHelper processParameterHelper)
-
setModelService
public void setModelService(ModelService modelService)
-
setUserService
public void setUserService(UserService userService)
-
setSessionService
public void setSessionService(SessionService sessionService)
-
initLoggingCtx
public ProcessEngineLoggingCtx initLoggingCtx(ProcessTaskModel task)
- Specified by:
initLoggingCtxin interfaceTaskRunner<ProcessTaskModel>
-
stopLoggingCtx
public void stopLoggingCtx(TaskLoggingCtx taskCtx)
- Specified by:
stopLoggingCtxin interfaceTaskRunner<ProcessTaskModel>
-
-