Class DbDecisionState

java.lang.Object
io.camunda.zeebe.engine.state.deployment.DbDecisionState
All Implemented Interfaces:
DecisionState, MutableDecisionState

public final class DbDecisionState extends Object implements MutableDecisionState
  • Constructor Details

  • Method Details

    • findLatestDecisionByIdAndTenant

      public Optional<PersistedDecision> findLatestDecisionByIdAndTenant(org.agrona.DirectBuffer decisionId, String tenantId)
      Description copied from interface: DecisionState
      Query decisions by the given decision id and return the latest version of the decision.
      Specified by:
      findLatestDecisionByIdAndTenant in interface DecisionState
      Parameters:
      decisionId - the id of the decision
      tenantId - the tenant the decision belongs to
      Returns:
      the latest version of the decision, or Optional.empty() if no decision is deployed with the given id
    • findDecisionByTenantAndKey

      public Optional<PersistedDecision> findDecisionByTenantAndKey(String tenantId, long decisionKey)
      Description copied from interface: DecisionState
      Query decisions by the given decision key and return the decision.
      Specified by:
      findDecisionByTenantAndKey in interface DecisionState
      Parameters:
      tenantId - the tenant the decision belongs to
      decisionKey - the key of the decision
      Returns:
      the decision, or Optional.empty() if no decision is deployed with the given key
    • findLatestDecisionRequirementsByTenantAndId

      public Optional<DeployedDrg> findLatestDecisionRequirementsByTenantAndId(String tenantId, org.agrona.DirectBuffer decisionRequirementsId)
      Description copied from interface: DecisionState
      Query decision requirements (DRGs) by the given decision requirements id and return the latest version of the DRG.
      Specified by:
      findLatestDecisionRequirementsByTenantAndId in interface DecisionState
      Parameters:
      tenantId - the tenant the DRG belongs to
      decisionRequirementsId - the id of the DRG
      Returns:
      the latest version of the DRG, or Optional.empty() if no DRG is deployed with the given id
    • findDecisionRequirementsByTenantAndKey

      public Optional<DeployedDrg> findDecisionRequirementsByTenantAndKey(String tenantId, long decisionRequirementsKey)
      Description copied from interface: DecisionState
      Query decision requirements (DRGs) by the given decision requirements key.
      Specified by:
      findDecisionRequirementsByTenantAndKey in interface DecisionState
      Parameters:
      tenantId - the tenant the DRG belongs to
      decisionRequirementsKey - the key of the DRG
      Returns:
      the DRG, or Optional.empty() if no DRG is deployed with the given key
    • findDecisionsByTenantAndDecisionRequirementsKey

      public List<PersistedDecision> findDecisionsByTenantAndDecisionRequirementsKey(String tenantId, long decisionRequirementsKey)
      Description copied from interface: DecisionState
      Query decisions by the given decision requirements (DRG) key.
      Specified by:
      findDecisionsByTenantAndDecisionRequirementsKey in interface DecisionState
      Parameters:
      tenantId - the tenant the DRG belongs to
      decisionRequirementsKey - the key of the DRG
      Returns:
      all decisions that belong to the given DRG, or an empty list if no decision belongs to it
    • clearCache

      public void clearCache()
      Description copied from interface: DecisionState
      Completely clears all caches.
      Specified by:
      clearCache in interface DecisionState
    • storeDecisionRecord

      public void storeDecisionRecord(DecisionRecord record)
      Description copied from interface: MutableDecisionState
      Put the given decision in the state. Update the latest version of the decision if it is newer.
      Specified by:
      storeDecisionRecord in interface MutableDecisionState
      Parameters:
      record - the record of the decision
    • storeDecisionRequirements

      public void storeDecisionRequirements(DecisionRequirementsRecord record)
      Description copied from interface: MutableDecisionState
      Put the given decision requirements (DRG) in the state. Update the latest version of the DRG if it is newer.
      Specified by:
      storeDecisionRequirements in interface MutableDecisionState
      Parameters:
      record - the record of the DRG
    • deleteDecision

      public void deleteDecision(DecisionRecord record)
      Description copied from interface: MutableDecisionState
      Deletes a decision from the state. Updates the latest version of the decision if the deleted version is the latest version and a previous version is available.
      Specified by:
      deleteDecision in interface MutableDecisionState
      Parameters:
      record - the record of the decision
    • deleteDecisionRequirements

      public void deleteDecisionRequirements(DecisionRequirementsRecord record)
      Description copied from interface: MutableDecisionState
      Deletes a decision requirements from the state. Updates the latest version of the decision requirements if the deleted version is the latest version and a previous version is available.
      Specified by:
      deleteDecisionRequirements in interface MutableDecisionState
      Parameters:
      record - the record of the decision requirements