Testing and Debugging Projects : Overview

Overview
You can run and debug projects in TIBCO BusinessEvents Studio, using test data to understand how TIBCO BusinessEvents rules behave in response to inputs. Debugger shows potential problems in execution of rules and rule functions. You can also simply test a project by running it against test data. You can run multiple engines at the same time, for example, one engine’s processing unit might run an inference agent while another’s runs a cache agent.
The TIBCO BusinessEvents Decision Manager add-on product also uses a tester feature, Table Analyzer, to enable technical and non-technical users to test rules, rule functions, and decision tables. See TIBCO BusinessEvents Decision Manager documentation for details.
Debugging
TIBCO BusinessEvents Debugger allows you to control the execution of a project by setting breakpoints, stepping through your code, suspending launched programs, examining the contents of variables, providing rule input, and so on.
TIBCO BusinessEvents Debugger integrates with the Eclipse Java development toolkit debugger. Much of the functionality is standard Eclipse debugger functionality. See the Eclipse help for details on features such as breakpoint preferences and other functionality. This chapter explains only the TIBCO BusinessEvents-specific features.
You can debug local projects using their CDD and EAR files, and you can also debug remote engines.
Declarative Programming and Stepping  Step into, step over, and step return may not behave as you might expect. In a declarative rule language like TIBCO BusinessEvents, unlike with a procedural language, there is no predetermined path through the code. The inference engine logic determines the next action (next rule) based on various conditions and settings, not the rule itself.
Testing Projects
Running projects to test them works in a way similar to debugging, without the ability to add break points and so on. For testing purposes, you choose options to run the engine, rather than to debug the engine.
Launch Configurations
Before you debug or test a project, you define settings needed to launch the engine, using a launch configuration file.
You can add multiple launch configurations for one project, each configured for a different purpose. For example, you may want to test the effect of different startup arguments. Or if you are using cache OM, you could create one configuration for the processing unit (PU) that runs an inference agent, and one for the PU that runs the cache agent.
Test Data
When you test or debug an engine, you must assert test data directly to working memory. The test data in the working memory triggers rules in the normal way, so you can observe conflict resolution and run to completion cycles in the engine.
You can provide test data to the engine in two ways:
Test Data  You can create and save concept and event instance data for later use. You can then assert this data selectively when running or debugging the engine.
Rule Data  You can provide data as it is expected by rules in the Rule Data tab of the Debugger perspective. See Working with Rule Data.
See Creating and Working With Test Data.
The Rule Agenda and Variable Views
When you run the debugger and reach a a breakpoint in a rule or rule function the execution is suspended. You can now examine the state of things:
The Rule Agenda view displays rules to be executed from the rule agenda, excluding the current rule (where execution is suspended due to the breakpoint).
For example, Event1 is asserted, Event1, which causes Rule1 to execute. Rule1 creates an instance of Concept1. Rule2, Rule3, and Rule4 have Event1 and Concept1 in scope, and their conditions are satisfied by the instance of Event1 and Concept1. If a breakpoint suspends execution in Rule2, then you see Rule3 and Rule4 in the Rule Agenda view.
For details about how the rule agenda is built, see Understanding Conflict Resolution and Run to Completion Cycles in TIBCO BusinessEvents Architect’s Guide.
Viewing and Understanding Results
After every run, TIBCO BusinessEvents creates a consolidated results file in XML format. It has detailed information on the test run. This results XML file is easy to view and compare.
An editor also appears that displays the results in TIBCO BusinessEvents Studio.
See Viewing the Results.