Step 2. Add the avSignalEvent to the Employee Details Command Handler
In this step you change the #avFrameworkManager.uWAMEvent_1 eventroutine in the Employee Details command handler to signal that employee details have changed.
1. Locate and open the Employee Details command handler iiiCOM06.
2. Display the Source tab.
3. Locate the #avFrameworkManager.uWAMEvent_1 eventroutine. Add the following code before the Endroutine statement:
Invoke #ThisHandler.avSignalEvent WithId(EMPLOYEE_CHANGED) SendAInfo1(#EMPNO) to(BUSINESSOBJECT)
Your code will look like this:
You use the avSignalEvent method when there is an event you would like other components within the Framework to be notified about:
- You place the event id to be signaled in the WithID parameter and any alphanumeric or numeric values you want to pass in the SendAInfon or SendNInfon parameters, where n is 1,…,5. In this example the event is EMPLOYEE_CHANGED and the employee number is the value to be passed.
- By default the value of the To parameter is FRAMEWORK which means any active component in the framework will receive this signal and will need to test to see if it pertains to them. If you know that the event only pertains to the business object in which this component resides, you should set the parameter To equal to BUSINESSOBJECT so that a very limited set of components are notified of this event. Using this technique will improve performance of your application.
4. Compile the command handler and check it into the server.
5. Close the command handler.