Package dev.dsf.bpe.v2.error.impl
Class AbstractErrorHandler
java.lang.Object
dev.dsf.bpe.v2.error.impl.AbstractErrorHandler
- All Implemented Interfaces:
ErrorBoundaryEventErrorHandler
,ErrorHandler
,ExceptionErrorHandler
- Direct Known Subclasses:
AbstractMessageActivityErrorHandler
,DefaultExecutionListenerErrorHandler
,DefaultServiceTaskErrorHandler
,DefaultUserTaskListenerErrorHandler
public abstract class AbstractErrorHandler
extends Object
implements ErrorBoundaryEventErrorHandler, ExceptionErrorHandler
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected String
createErrorMessageFromException
(ProcessPluginApi api, Variables variables, Exception exception) protected org.hl7.fhir.r4.model.Task.TaskOutputComponent
createTaskErrorOutput
(ProcessPluginApi api, Variables variables, String errorMessage) protected List
<org.hl7.fhir.r4.model.Task> getTasks
(ProcessPluginApi api, Variables variables, Exception exception) handleErrorBoundaryEvent
(ProcessPluginApi api, Variables variables, ErrorBoundaryEvent event) Logs the givenErrorBoundaryEvent
and returns the event without modification.handleException
(ProcessPluginApi api, Variables variables, Exception exception) Logs the givenException
, updates all receivedTask
resource withTask.TaskStatus.INPROGRESS
toTask.TaskStatus.FAILED
and adds aTask.TaskOutputComponent
of typeCodeSystems.BpmnMessage.error()
.protected void
updateFailedIfInprogress
(ProcessPluginApi api, Variables variables, String errorMessage, List<org.hl7.fhir.r4.model.Task> tasks) protected void
updateTaskAndHandleException
(ProcessPluginApi api, Variables variables, org.hl7.fhir.r4.model.Task task)
-
Constructor Details
-
AbstractErrorHandler
public AbstractErrorHandler()
-
-
Method Details
-
handleErrorBoundaryEvent
public ErrorBoundaryEvent handleErrorBoundaryEvent(ProcessPluginApi api, Variables variables, ErrorBoundaryEvent event) Logs the givenErrorBoundaryEvent
and returns the event without modification.- Specified by:
handleErrorBoundaryEvent
in interfaceErrorBoundaryEventErrorHandler
- Parameters:
api
- notnull
variables
- notnull
event
- notnull
- Returns:
null
to stop event propagation
-
handleException
Logs the givenException
, updates all receivedTask
resource withTask.TaskStatus.INPROGRESS
toTask.TaskStatus.FAILED
and adds aTask.TaskOutputComponent
of typeCodeSystems.BpmnMessage.error()
.Exceptions thrown while updating the
Task
resources to status failed are logged.Returns the given
Exception
resulting in a deleted i.e. stopped process instance.- Specified by:
handleException
in interfaceExceptionErrorHandler
- Parameters:
api
- notnull
variables
- notnull
exception
- notnull
- Returns:
null
to prevent the process from being stopped
-
getTasks
protected List<org.hl7.fhir.r4.model.Task> getTasks(ProcessPluginApi api, Variables variables, Exception exception) -
updateFailedIfInprogress
protected void updateFailedIfInprogress(ProcessPluginApi api, Variables variables, String errorMessage, List<org.hl7.fhir.r4.model.Task> tasks) -
createTaskErrorOutput
protected org.hl7.fhir.r4.model.Task.TaskOutputComponent createTaskErrorOutput(ProcessPluginApi api, Variables variables, String errorMessage) -
createErrorMessageFromException
protected String createErrorMessageFromException(ProcessPluginApi api, Variables variables, Exception exception) -
updateTaskAndHandleException
protected void updateTaskAndHandleException(ProcessPluginApi api, Variables variables, org.hl7.fhir.r4.model.Task task)
-