Products | Versions |
---|---|
TIBCO BusinessEvents Enterprise Edition | - |
Not Applicable | - |
How to handle multiple types of events using the same Preprocessor RuleFunction.
void rulefunction RuleFunctions.Loader.TxnsEnvPreprocessor {
attribute {
validity = ACTION;
}
scope {
Event eve;
}
body {
if (eve instanceof Events.Core.Transaction) {
Events.Core.Transaction txn = eve;
System.debugOut("Transaction received:" + txn.TranType);
}
else if (eve instanceof Events…) {
}
}
+++++++++++++++++++++++
The other option would be to use inheritance in a similar fashion. Inheritance is demonstrated in the FraudDetection example project as well.
BE Getting Started guide > Chap. 2 > Project Design Tutorial.