Skip to main content



Working with the Trace Viewer through irSDK

**Prerequisites:**none
Namespaces: InRule.Runtime, InRule.Runtime.Testing
Classes: FileSystemRuleApplicationReference, RuleSession, Entity
See Also: Rule Tracing Input and Output through irSDK, Basic Example of Calling the Rule Engine, Creating a RuleSession

The Trace Viewer used with irAuthor and irVerify is also accessible from the SDK. It is available as a popup Window and an embeddable control.

Using the Trace Viewer Window

using (var trace = log.GetExecutionTrace()){

// Call static method to launch default trace viewer
ExecutionTraceWindow.Show(trace);

//If any configuration of the window is required, the static method returns the window object,
// which can be used to set configuration options as shown here.

// Static method returns reference window to the window in case further configuration is required
var window = ExecutionTraceWindow.Show(trace);

// Hide export window
window.ShowExportMenu = false;

// Reusing same detail panel
window.DetailPopupMode = TraceEventDetailPopupMode.ShowInExistingWindow;
}

Embedding the Trace Viewer Control

var log = ruleSession.LastRuleExecutionLog;// Create an instance of the control 
var view = new ExecutionTraceView();

// Specify if you want to see the Export menu (default is visible)
view.ShowExportMenu = false;

// Specify if you want the detail windows to be reused or to create a new window each time
// Details window is displayed when clicking hyperlink or double clicking on the row
view.DetailPopupMode = TraceEventDetailPopupMode.ShowInNewWindow;

// Load the trace into the viewer
// Options include IExecutionTrace, ExecutionLog (used here) or path to trace file
view.Load(log);