Platform SDK: Exchange Server |
This section presents a brief overview of the Microsoft Exchange Event Service agents and the Microsoft Exchange Server Routing objects.
You can configure the Microsoft Exchange Event Service to monitor the New Message, Changed Message, Deleted Message, or Timer events in a folder by placing (binding) an event service agent to that folder. When the Event Service detects an event that has a registered agent, it calls the Microsoft Exchange Server Scripting Agent to execute the script associated with the agent.
Microsoft Exchange Server Routing objects are provided by the EXRTOBJ COM component and build on the scripting agent to simplify the development of routing applications.
Routing agents, unlike Event Service agents, can only monitor the New Message or Timer events in a folder. When the Event Service detects an event, it uses the EXRTOBJ component to execute the registered map in that folder. The map is much like a program. It contains the routing logic directives for the application's flow, and the routing engine executes the map, one row at a time.
Use the Routing Wizard, which comes with Microsoft Exchange 5.5 SP1, to create the initial map on a folder. Since the Routing Wizard can only create simple (parallel or sequential) maps, use the sample to modify this initial map if you need a more-complex map.
For further information on the Routing Objects, see Exchange Server Routing.
The main form of the sample contains three tabs that display information on a folder agent. In most cases you can edit the information displayed on these tabs. The first tab displays information about the script that is associated with an agent. The second tab displays information about the Routing Map. This tab is enabled if you are editing a Routing Agent. The final tab displays information about agent properties. Use this tab to select to which events the agent is bound, its active status, and its name.
To use the agent editor you first select the folder you want to work on. Select an agent (or create a new one), then edit the properties, scripts or maps, and save the agent and map. If you attempt to close an unsaved script or map, AEditor prompts you to save it.
Note: You can edit Event Agents and Routing Agents but you can not edit Custom Agents.
The AEditor sample uses two different types of permissions: Folder Permissions and Event Service Permissions. Any combination of these can be granted by the system administrator, as follows.
You can export a map to a Comma Separated File (CSV) which, by default, has a MAP extension. You can then read from or write to this file using any application that supports CSV files, such as Microsoft Excel. You can create maps in Excel, save them as a CSV file, import them into the map grid, and save them to the folder or binding.
The sample handles commas in a string by enclosing the string in quote (") marks. It handles the new-line character by converting it to '\n'. The sample converts these special characters when it exports and imports a map. Therefore, exporting a map and then importing and exporting the same map to a different file name produces identical files.
Therefore, if you are creating a map in Excel and you are creating a string with a newline, you must use '\n' in place of the new-line character.