Platform SDK: Exchange Server |
A new item arriving in the folder is the primary event that creates a new process or advances the state of an executing process. When the engine's OnMessageCreated event fires, the engine tries to correlate the new message to one of the existing process instances being executed. If the item is successfully correlated to a process instance, the state of that process is updated and the engine executes the next step in that process's map.
If the new item does not correlate to any existing process instance, a new process instance is created. To accomplish this, the engine performs several steps to transform the new item into a process instance:
The following diagram summarizes how the routing engine creates a new Process Instance Message (PIM):
A newly arrived item in a monitored folder can contain its own process map. A Microsoft Outlook custom form, for example, could use routing objects from within its script to create a map on a new item. When posted to the folder, the map on the new WorkItem is used instead of the default map for the folder. In this case, an "ad-hoc" process is said to have been defined for the item.
When a new Process Instance Message is created, the engine begins executing the first activity in the PIM's map. If the activity calls for custom (VBScript) actions, the functions are found in the script that has been installed in the folder. Normally, this script consists of the default VBScript actions (see Script Actions) provided with Microsoft Exchange routing objects, but it could also be a customized version of these commands or even a totally new set of custom commands.
Execution of the map continues sequentially until it terminates. The execution sequence is controlled by the use of flow-control-oriented Intrinsic Actions.