Software is an agent that acts in the best interest of its user and possesses at least three of the following characteristics:
Reacts to its environment
Able to communicate
Able to learn
The sample solution is an example of multiple agents working together to reach a common goal: updating the user. In this case, the agent solution assumes the top four items in the list of characteristics. It consists of a windows service located on a remote sales representative's laptop a windows service located on a central Web server and a Web service that is used by the remote agent to retrieve data from the central server.
Remote and server agents both utilize Microsoft's FileSystemWatcher class to automatically monitor the file system for updates. Remote agents monitor new files to update the user's configuration file. Server agents monitor the results in the update of an xml file that lists all the available files and their attributes.
Using Microsoft's Background Intelligent Transfer Service (BITS) to transfer files allows the remote agent to not only function independently, but also to efficiently communicate with an outside data source. The impact on the sales representative is minimized because BITS automatically adjusts the transfer rate. Most important, the files will be transferred to the user despite network interruptions.
BITS allows you to receive notifications when a job is transferred or encounters an error. This enables the remote agent to process the transfer job asynchronously. Whenever an error is encountered, the error is logged and the job canceled. When the job is transferred, it is marked complete so that the user can see the transferred files.
Remote agents have the ability to monitor new leads added to the central database. When a new record is discovered, the contact information for that opportunity is displayed to the salesperson through a popup dialog.