Package org.idempiere.acct.event
Class FactsValidationEngine
java.lang.Object
org.idempiere.acct.event.FactsValidationEngine
Accounting Facts Validation Engine.
Manages registration and firing of FactsValidator listeners
-
Method Summary
Modifier and TypeMethodDescriptionvoidaddFactsValidate(String tableName, FactsValidator listener) Add an Accounting Facts Validation Listener for a table.voidaddGlobalValidator(FactsValidator validator) Register a validator as global (system-level).fireFactsValidate(MAcctSchema schema, List<Fact> facts, PO po) Fire Accounting Facts Validation event for a table.
- CallsFactsValidator.factsValidate(MAcctSchema, List, PO)on registered validators.
- FiresIEventTopics.ACCT_FACTS_VALIDATEOSGi event.static FactsValidationEngineget()Get singleton instance.voidremoveFactsValidate(String tableName, FactsValidator listener) Remove an Accounting Facts Validation Listener for a table.voidremoveGlobalValidator(FactsValidator validator) Remove a validator from the global list.
-
Method Details
-
get
Get singleton instance.- Returns:
- singleton engine instance
-
addGlobalValidator
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
Remove a validator from the global list.- Parameters:
validator- the validator to remove
-
addFactsValidate
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 namelistener- listener (global or tenant specific)
-
removeFactsValidate
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 namelistener- listener
-
fireFactsValidate
Fire Accounting Facts Validation event for a table.
- CallsFactsValidator.factsValidate(MAcctSchema, List, PO)on registered validators.
- FiresIEventTopics.ACCT_FACTS_VALIDATEOSGi event.- Parameters:
schema- accounting schemafacts- list of accounting factspo- PO instance of the event- Returns:
- error message or null
-