Class FactsValidationEngine

java.lang.Object
org.idempiere.acct.event.FactsValidationEngine

public class FactsValidationEngine extends Object
Accounting Facts Validation Engine.

Manages registration and firing of FactsValidator listeners

  • Method Details

    • get

      public static FactsValidationEngine get()
      Get singleton instance.
      Returns:
      singleton engine instance
    • addGlobalValidator

      public void addGlobalValidator(FactsValidator validator)
      Register a validator as global (system-level). Global validators are invoked regardless of the AD_Client_ID of the PO being validated.
      Parameters:
      validator - the validator to register as global
    • removeGlobalValidator

      public void removeGlobalValidator(FactsValidator validator)
      Remove a validator from the global list.
      Parameters:
      validator - the validator to remove
    • addFactsValidate

      public void addFactsValidate(String tableName, FactsValidator listener)
      Add an Accounting Facts Validation Listener for a table. The bucket (global vs tenant) is determined once at registration time and remembered, so subsequent changes to the global-validator list do not affect which bucket is used for removal. Adding the same listener to the same table twice is a no-op.
      Parameters:
      tableName - table name
      listener - listener (global or tenant specific)
    • removeFactsValidate

      public void removeFactsValidate(String tableName, FactsValidator listener)
      Remove an Accounting Facts Validation Listener for a table. Uses the bucket key that was recorded at registration time, so removal is always consistent with how the listener was added.
      Parameters:
      tableName - table name
      listener - listener
    • fireFactsValidate

      public String fireFactsValidate(MAcctSchema schema, List<Fact> facts, PO po)
      Fire Accounting Facts Validation event for a table.
      - Calls FactsValidator.factsValidate(MAcctSchema, List, PO) on registered validators.
      - Fires IEventTopics.ACCT_FACTS_VALIDATE OSGi event.
      Parameters:
      schema - accounting schema
      facts - list of accounting facts
      po - PO instance of the event
      Returns:
      error message or null