ApplyDebit BadApplyDebit and CheckNegativeBalance Rules
It’s important to understand how conflict resolution and run to completion (RTC) cycles work.
When a Debit event is asserted into the Rete network, TIBCO BusinessEvents checks rules with the Debit event in their scope.
- The
ApplyDebit rule has the Debit event in its scope, and also an account ID. It’s priority 1 so it will execute before any other lower priority rule. The engine checks the rule conditions.
- If the Rete network also contains an Account instance whose ID matches the ID in the debit event, the rule executes. If the account is suspended, a message to that effect displays in the console. Otherwise, the account is debited. A message displays in the console to this effect.
- If the Rete network does not contain a matching Account instance, then other rules in the agenda — those that have debit events in their scope — are eligible to execute. BadApplyDebit is the only rule with the Debit event in its scope, so it is eligible and it executes. It sends a message to the console that no matching account is found.
- The CheckNegativeBalance rule has an Account concept in its scope. When an account is debited the Account concept is changed, and so the CheckNegativeBalance rule becomes "newly true." The effect is similar to assertion of a new entity into the Rete Network. If the debit has made the account balance negative, this rule sets the status to Suspended.
Learning Points
If you understand what triggers rules to execute, and why a rule may not execute, you can design rules more effectively.
For a reminder, carefully reread Understanding Conflict Resolution and Run to Completion Cycles in TIBCO BusinessEvents Architect’s Guide.
More Information
- See all references provided for Adding the InitializeScorecard Rule Function
- See Runtime Inferencing Behavior in TIBCO BusinessEvents Architect’s Guide.
Copyright © TIBCO Software Inc. All Rights Reserved.