public class SignallingTaskHandlerDecorator extends AbstractExceptionHandlingTaskHandler
WorkItemHandler
instance so that an event (signal, error or other) can be sent to the process
instance if and when the wrapped WorkItemHandler
instance throws an exception (during a
WorkItemHandler.executeWorkItem(WorkItem, WorkItemManager)
or
WorkItemHandler.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
wrapped WorkItemHandler
instance throws an exception, the SignallingTaskHandlerDecorator
instance must either be
reset via the clear()
or clearProcessInstance(Long)
methods.
Otherwise, the number of exceptions handled can be changed via the WorkItemHandler#setExceptionCountLimit
method.
Constructor and Description |
---|
SignallingTaskHandlerDecorator(Class<? extends org.kie.api.runtime.process.WorkItemHandler> originalTaskHandlerClass,
String eventType)
Constructs an instance that uses the given
eventType parameter to signal the process instance using the given
KieSession ksession parameter when an instance of the class specified by the
originalTaskHandlerClass throws an exception upon WorkItemHandler.executeWorkItem(WorkItem, WorkItemManager) |
SignallingTaskHandlerDecorator(org.kie.api.runtime.process.WorkItemHandler originalTaskHandler,
String eventType) |
Modifier and Type | Method and 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) |
abortWorkItem, executeWorkItem, getOriginalTaskHandler
public SignallingTaskHandlerDecorator(Class<? extends org.kie.api.runtime.process.WorkItemHandler> originalTaskHandlerClass, String eventType)
eventType
parameter to signal the process instance using the given
KieSession
ksession
parameter when an instance of the class specified by the
originalTaskHandlerClass
throws an exception upon WorkItemHandler.executeWorkItem(WorkItem, WorkItemManager)
originalTaskHandlerClass
- eventType
- public SignallingTaskHandlerDecorator(org.kie.api.runtime.process.WorkItemHandler originalTaskHandler, String eventType)
public void setWorkItemExceptionParameterName(String parameterName)
public String getWorkItemExceptionParameterName()
public void handleExecuteException(Throwable cause, org.kie.api.runtime.process.WorkItem workItem, org.kie.api.runtime.process.WorkItemManager manager)
handleExecuteException
in class AbstractExceptionHandlingTaskHandler
public void handleAbortException(Throwable cause, org.kie.api.runtime.process.WorkItem workItem, org.kie.api.runtime.process.WorkItemManager manager)
handleAbortException
in class AbstractExceptionHandlingTaskHandler
public void setExceptionCountLimit(int limit)
public void clearProcessInstance(Long processInstanceId)
public void clear()
Copyright © 2001–2018 JBoss by Red Hat. All rights reserved.