Step 3 Start Tracing Programmatically

Visual LANSA Framework

Step 3. Start Tracing Programmatically

In this step you will add code to start tracing when the Employee filter is used and end the trace when the filter is no longer used.

 

1.   Add this statement to the uInitialize method routine to start the trace when the filter is initialized:

 

Set #AvFrameworkManager avTrace(TRUE)

 

 

2.   Add a uTerminate method to the filter and a statement to terminate the trace when the filter is no longer used:

MTHROUTINE NAME(uTerminate) OPTIONS(*REDEFINE)

 

Set #AvFrameworkManager avTrace(False)

 

ENDROUTINE

 

  

3.   Compile the filter.

4.   Start the Framework.

5.   Select the iii HR application and then the Employees business object. Notice that the tracing window is now displayed.

6.   Select employees using the filter:

 

7.   Select another business object or application. Notice that the tracing window is closed because the uTerminate method stopped tracing when the filter was no longer used.

8.   Close the Framework.