Package org.jbpm.bpmn2.handler
Class SignallingTaskHandlerDecorator
- java.lang.Object
-
- org.jbpm.bpmn2.handler.AbstractExceptionHandlingTaskHandler
-
- org.jbpm.bpmn2.handler.SignallingTaskHandlerDecorator
-
- All Implemented Interfaces:
org.kie.api.runtime.process.WorkItemHandler
public class SignallingTaskHandlerDecorator extends AbstractExceptionHandlingTaskHandler
This class will wrap aWorkItemHandler
instance so that an event (signal, error or other) can be sent to the process instance if and when the wrappedWorkItemHandler
instance throws an exception (during aWorkItemHandler.executeWorkItem(WorkItem, WorkItemManager)
orWorkItemHandler.abortWorkItem(WorkItem, WorkItemManager)
method. In order to prevent an endless loop, the signal will only be sent once. If the signal should be sent the next time the same wrappedWorkItemHandler
instance throws an exception, theSignallingTaskHandlerDecorator
instance must either be reset via theclear()
orclearProcessInstance(Long)
methods.Otherwise, the number of exceptions handled can be changed via the
This class is not thread-safe.WorkItemHandler#setExceptionCountLimit
method.
-
-
Constructor Summary
Constructors Constructor Description SignallingTaskHandlerDecorator(Class<? extends org.kie.api.runtime.process.WorkItemHandler> originalTaskHandlerClass, String eventType)
Constructs an instance that uses the giveneventType
parameter to signal the process instance using the givenKieSession
ksession
parameter when an instance of the class specified by theoriginalTaskHandlerClass
throws an exception uponWorkItemHandler.executeWorkItem(WorkItem, WorkItemManager)
SignallingTaskHandlerDecorator(Class<? extends org.kie.api.runtime.process.WorkItemHandler> originalTaskHandlerClass, String eventType, int exceptionCountLimit)
SignallingTaskHandlerDecorator(org.kie.api.runtime.process.WorkItemHandler originalTaskHandler, String eventType)
SignallingTaskHandlerDecorator(org.kie.api.runtime.process.WorkItemHandler originalTaskHandler, String eventType, int exceptionCountLimit)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clear()
void
clearProcessInstance(Long processInstanceId)
String
getWorkItemExceptionParameterName()
void
handleAbortException(Throwable cause, org.kie.api.runtime.process.WorkItem workItem, org.kie.api.runtime.process.WorkItemManager manager)
void
handleExecuteException(Throwable cause, org.kie.api.runtime.process.WorkItem workItem, org.kie.api.runtime.process.WorkItemManager manager)
void
setExceptionCountLimit(int limit)
void
setWorkItemExceptionParameterName(String parameterName)
-
Methods inherited from class org.jbpm.bpmn2.handler.AbstractExceptionHandlingTaskHandler
abortWorkItem, executeWorkItem, getOriginalTaskHandler
-
-
-
-
Constructor Detail
-
SignallingTaskHandlerDecorator
public SignallingTaskHandlerDecorator(Class<? extends org.kie.api.runtime.process.WorkItemHandler> originalTaskHandlerClass, String eventType)
Constructs an instance that uses the giveneventType
parameter to signal the process instance using the givenKieSession
ksession
parameter when an instance of the class specified by theoriginalTaskHandlerClass
throws an exception uponWorkItemHandler.executeWorkItem(WorkItem, WorkItemManager)
- Parameters:
originalTaskHandlerClass
-eventType
-
-
SignallingTaskHandlerDecorator
public SignallingTaskHandlerDecorator(org.kie.api.runtime.process.WorkItemHandler originalTaskHandler, String eventType)
-
SignallingTaskHandlerDecorator
public SignallingTaskHandlerDecorator(Class<? extends org.kie.api.runtime.process.WorkItemHandler> originalTaskHandlerClass, String eventType, int exceptionCountLimit)
-
SignallingTaskHandlerDecorator
public SignallingTaskHandlerDecorator(org.kie.api.runtime.process.WorkItemHandler originalTaskHandler, String eventType, int exceptionCountLimit)
-
-
Method Detail
-
setWorkItemExceptionParameterName
public void setWorkItemExceptionParameterName(String parameterName)
-
getWorkItemExceptionParameterName
public String getWorkItemExceptionParameterName()
-
handleExecuteException
public void handleExecuteException(Throwable cause, org.kie.api.runtime.process.WorkItem workItem, org.kie.api.runtime.process.WorkItemManager manager)
- Specified by:
handleExecuteException
in classAbstractExceptionHandlingTaskHandler
-
handleAbortException
public void handleAbortException(Throwable cause, org.kie.api.runtime.process.WorkItem workItem, org.kie.api.runtime.process.WorkItemManager manager)
- Specified by:
handleAbortException
in classAbstractExceptionHandlingTaskHandler
-
setExceptionCountLimit
public void setExceptionCountLimit(int limit)
-
clearProcessInstance
public void clearProcessInstance(Long processInstanceId)
-
clear
public void clear()
-
-