Class NoopApprovalHandle

java.lang.Object
dev.agenor.core.hitl.NoopApprovalHandle
All Implemented Interfaces:
ApprovalHandle

public final class NoopApprovalHandle extends Object implements ApprovalHandle
Default ApprovalHandle used when no HITL provider (e.g. agenor-runtime-ext) is on the classpath.

Query methods return an empty result; decision-submitting methods fail fast with a message pointing at the missing module, rather than silently doing nothing.

Since:
0.25.0
  • Constructor Details

    • NoopApprovalHandle

      public NoopApprovalHandle()
  • Method Details

    • approve

      public void approve(String requestId)
      Description copied from interface: ApprovalHandle
      Approves the pending request identified by requestId.
      Specified by:
      approve in interface ApprovalHandle
      Parameters:
      requestId - UUID of the pending request
    • reject

      public void reject(String requestId, String reason)
      Description copied from interface: ApprovalHandle
      Rejects the pending request identified by requestId.
      Specified by:
      reject in interface ApprovalHandle
      Parameters:
      requestId - UUID of the pending request
      reason - human-readable explanation; must not be null
    • modify

      public void modify(String requestId, Object newPayload)
      Description copied from interface: ApprovalHandle
      Approves the pending request with a modified payload.
      Specified by:
      modify in interface ApprovalHandle
      Parameters:
      requestId - UUID of the pending request
      newPayload - revised action payload; must not be null
    • submit

      public void submit(String requestId, ApprovalDecision decision)
      Description copied from interface: ApprovalHandle
      Submits an arbitrary ApprovalDecision for the pending request.
      Specified by:
      submit in interface ApprovalHandle
      Parameters:
      requestId - UUID of the pending request
      decision - the decision to submit; must not be null
    • getPendingRequests

      public List<ApprovalRequest> getPendingRequests()
      Description copied from interface: ApprovalHandle
      Returns a snapshot of approval requests that are still pending.
      Specified by:
      getPendingRequests in interface ApprovalHandle
      Returns:
      immutable list of pending ApprovalRequests