Interface EngineExtension
public interface EngineExtension
Provides functionality that the case engine calls when dealing with specific case archetypes (like approval cases, etc).
TODO better name
-
Method Summary
Modifier and TypeMethodDescriptionbooleanDoes this extension use stages at all?voidfinishCaseClosing(@NotNull CaseEngineOperation operation, @NotNull OperationResult result) Called after the case-closing state has been successfully persisted.@NotNull Collection<String>Returns the case archetype OID(s) this extension handles.@NotNull AuditingExtensionReturns an object that helps with audit records creation.intgetExpectedNumberOfStages(@NotNull CaseEngineOperation operation) Returns the number of stages the case is expected to go through.default voidprepareCaseClosing(@NotNull CaseEngineOperation operation, @NotNull OperationResult result) Called before the case-closing state is persisted.@NotNull StageClosingResultprocessStageClosing(CaseEngineOperation operation, OperationResult result) Does the specific stage closing activities (including determination of the case processing continuation).@NotNull StageOpeningResultprocessStageOpening(CaseEngineOperation operation, OperationResult result) May provide new work items and/or pre-computed stage result.@NotNull WorkItemCompletionResultprocessWorkItemCompletion(@NotNull CaseWorkItemType workItem, @NotNull CaseEngineOperation operation, @NotNull OperationResult result) Processes work item completion.
-
Method Details
-
getArchetypeOids
Returns the case archetype OID(s) this extension handles. -
prepareCaseClosing
default void prepareCaseClosing(@NotNull @NotNull CaseEngineOperation operation, @NotNull @NotNull OperationResult result) throws SchemaException, ObjectNotFoundException, ExpressionEvaluationException, ConfigurationException, CommunicationException, SecurityViolationException Called before the case-closing state is persisted. Implementations may execute retry-safe business logic required before the case may proceed to closing. If this method fails, the case remains open. Logic executed here must be safe under case-engine retries, e.g. in-memory, idempotent, or repository-transactional and repeatable. -
finishCaseClosing
void finishCaseClosing(@NotNull @NotNull CaseEngineOperation operation, @NotNull @NotNull OperationResult result) throws SchemaException, ObjectAlreadyExistsException, ObjectNotFoundException, ExpressionEvaluationException, ConfigurationException, CommunicationException, SecurityViolationException Called after the case-closing state has been successfully persisted. This hook is intended for post-commit finalization. Failures here do not mean that the case should remain open. -
getExpectedNumberOfStages
Returns the number of stages the case is expected to go through. E.g. for approval cases, it is determined from the approval schema. Must return 1 ifdoesUseStages()is false. -
doesUseStages
boolean doesUseStages()Does this extension use stages at all? If not, there is only a single stage (numbered 1). -
processStageOpening
@NotNull @NotNull StageOpeningResult processStageOpening(CaseEngineOperation operation, OperationResult result) throws SchemaException May provide new work items and/or pre-computed stage result.- Throws:
SchemaException
-
processStageClosing
@NotNull @NotNull StageClosingResult processStageClosing(CaseEngineOperation operation, OperationResult result) Does the specific stage closing activities (including determination of the case processing continuation). -
processWorkItemCompletion
@NotNull @NotNull WorkItemCompletionResult processWorkItemCompletion(@NotNull @NotNull CaseWorkItemType workItem, @NotNull @NotNull CaseEngineOperation operation, @NotNull @NotNull OperationResult result) throws SchemaException Processes work item completion. May update the case! Note: Work item is already updated (output written, closed).- Throws:
SchemaException
-
getAuditingExtension
Returns an object that helps with audit records creation.
-