The Exchange 5.5 Event Service: Building Routing and Approval Applications - PowerPoint PPT Presentation

1 / 34
About This Presentation
Title:

The Exchange 5.5 Event Service: Building Routing and Approval Applications

Description:

Take action if not handled in X days. Voting/Tracking ... oMessage.Fields.Item(PR_EVENT_SCRIPT) = bstrEventScript. oMessage.Update ' ... – PowerPoint PPT presentation

Number of Views:49
Avg rating:3.0/5.0
Slides: 35
Provided by: jimr7
Category:

less

Transcript and Presenter's Notes

Title: The Exchange 5.5 Event Service: Building Routing and Approval Applications


1
(No Transcript)
2
The Exchange 5.5 Event Service Building Routing
And Approval Applications (Part 2) Jim
Reitz Program ManagerExchange Team Microsoft
Corporation
3
Different Kinds Of Workflow
  • Ad-hoc, unstructured
  • One-off document review, voting
  • Team process automation
  • Issue tracking, document approval
  • Line-of-business, production
  • Claims processing, Loan applications
  • Inter-Organization
  • E-commerce, supply-chain initiatives

4
Workflow Simple Client-Based
  • Outlook Voting Buttons
  • Office Routing Slip

5
ISV Workflow Products
  • Complete, out-of-box solutions
  • Many designed for both Administrative and
    Production applications
  • Forms Outlook, Web/HTML, etc.
  • Most feature GUI design tools
  • Resources
  • http//msdnisv.microsoft.com/developer/thirdparty
  • Search on Workflow

6
Microsoft Exchange Routing Objects
  • Basic building blocks
  • For simple tracking/approval applications
  • Messaging-based
  • Server-side execution
  • Centralized business logic
  • Supports thick or thin clients
  • Automates expiration and notification
  • Exchange Server 5.5 SP1 or later
  • Built on 5.5 Event Service
  • Application code uses CDO 1.2x

7
What Kinds Of Applications Can I Develop?
  • Simple sequential or parallel routing
  • Multi-step approval of docs or forms
  • Expiration handling
  • Take action if not handled in X days
  • Voting/Tracking
  • Server-side support for Outlook voting buttons
    and tracking table
  • Hybrid
  • VB Script allows integration with SQL, MTS, MSMQ,
    custom COM objects, etc.

8
Demo
9
Messaging-Based Architecture
10
Enabling A Folder For Routing
  • Create and install default Routing Map
  • Create and install Routing Scripts
  • Bind the Routing Agent to the folder

Folder
Agent Binding
Routing Script
Default Routing Map
EXRTENG.DLL
11
Routing Maps
  • Sequential list of Actions
  • Ordered via line numbers
  • Actions can be intrinsic (Flags0), or script
    (Flags2)
  • Actions have zero or more parameters
  • Each parameter is a column

ActivityID
Activity
Flags
Parameter 1
Parameter 2
1000
Send
2
Bob Smith
IPM.Note
1010
Wait
0
10080
1020
ORSplit
0
IsTimeout
1030
Goto
0
5000
1040
Receive
2
FALSE
1050
Consolidate
2
FALSE
1060
goto
0
10000
5000
CustomExpiry
2
Manager
IPM.Alert
10000
Terminate
0
12
Maps - Intrinsic Actions
  • ORSplit
  • Alternate branch execution (IF statement)
  • Evaluates boolean VB Script function
  • TRUE goto next row
  • FALSE skip a row
  • ANDSplit
  • Parallel branch execution
  • Creates sub-processes starting at listed Activity
    ID numbers

13
Maps - Intrinsic Actions
  • GOTO
  • Jumps to specified Activity ID number
  • WAIT
  • Waits for specified number of minutes, then
    executes next row
  • NEW
  • Create new process instance
  • Begin executing at specified Activity ID number
  • TERMINATE
  • Ends current process instance
  • Returns control to parent process

14
Script Actions
  • One script contains all functions used by routing
    within a given folder
  • VB Script only
  • Action functions
  • Referenced in Maps
  • Public Sub name must start with Route_
  • Must return Boolean
  • Utility functions
  • Normal VB Script naming rules
  • Cant be referenced in a Map
  • Script stored on Binding hidden message
  • PR_EVENT_SCRIPT (H7102001E)

15
Default Script Actions
  • ROUTING.VBS
  • Compiled into sample applications
  • Routing Wizard sample
  • Agent Editor sample
  • Stored as Text resource
  • Source code on TechNet
  • http//technet.microsoft.com/reg/download/exchang
    e/misc/routingsrc.exe
  • Designed for simple yes/no approval
  • Extend functionality by adding or modifying VB
    Script functions

16
How It Works - New Item
17
How It Works - In Process
18
Routing Object Internals
  • Routing Engine (ExRtEng.DLL)
  • Agent that runs on 5.5 Event Service
  • Custom COM event handler (C)
  • Executes sequential process maps
  • Manages and tracks current state for each
    instance of a process
  • Executes intrinsic and script actions
  • Calls out to Active Script host as needed
  • Manages process/subprocess chains

19
Exchange Routing Objects
RouteDetails
ProcInstance
Map
Row
Log
Participant
VoteTable
WorkItem
Map
Row
VoteTable
intrinsic object passed to script at runtime
objects you (typically) create
20
Intrinsic ObjectsPassed to Script Action
  • RouteDetails.ProcInstance
  • The currently executing process instance
  • RouteDetails.Msg
  • The application item from the current process
    instance, as a CDO Message object
  • RouteDetails.Folder
  • The current folder, as a CDO Folder object
  • RouteDetails.WorkItem
  • Used to create a new message (workitem) with
    RouteDetails.Msg as an embedded message

21
Changing The Default Scripts
Modify to perform custom role lookups or make
routing decisions Sub Route_Send bstrRNames Comm
a-delimited string of recipient names ltBLANKgt
is originator, one recipient is
serial boolPIM Include Item in Final
Report? bstrText Body of Text or ltFINALIZEgt for
Final Report boolAttach ltATTACHgt send PIM as
attachment ltName of OWA Servergt send link to
PIM bstrRole ltROLEgt recipient name is a
Role ltRECIPgt recipient name(s) are e-mail
address boolSuccess Return true or false to trace
functions
22
Changing The Default Scripts
  • Modify to control appearance of outgoing routing
    slips or notification messages
  • This is a utility function - doesnt appear
    directly in a routing map
  • Function InitializeMsg
  • bstrText Message body text for routing slip
  • bstrSubject Subject of routing slip
  • Return Boolean success or failure

23
Debugging Routing Scripts
  • Microsoft Script Debugger
  • Must set breakpoint in script
  • STOP keyword in VB Script
  • Exchange Agent Log
  • Set Script.Response string
  • Viewable from Outlook
  • Default ROUTING.VBS
  • Const TRACE_FLAG True
  • Const TRACE_LOG True

24
Tips
  • Install latest Exchange Service Packs
  • 5.5 SP3 recommended
  • Outlook 98 or Outlook 2000
  • Enable Server Scripting add-in
  • Workflow developers need permission on
    EventConfig_ltServerNamegt folder
  • Give permission carefully
  • Workflow scripts execute with full Exchange admin
    privileges
  • Target low to medium-volume applications

25
Relative Roles
  • Simple mechanism uses directory
  • Existing Manager attribute
  • Custom Roles via linked Distribution Lists
  • ProcInstance.Participant
  • Participant.RoleName ltstringgt
  • Participant.MemberName ltemail addressgt
  • Participant.ResolveRole returns e-mail address of
    the role performer
  • Role Administrator Sample App
  • ASP interface to create/edit custom roles
  • Exchange 5.5 SP1 or SP2 CD

26
Programmatically Binding A Routing Agent
  • Exchange Event Service Config Library
    ESCONF.DLL
  • Create binding to Routing Engine
  • Get binding message
  • Add script text to PR_EVENT_SCRIPT
  • Create map and save on binding message
  • Commit changes

27
Binding A Routing Agent - 1
  • Const PR_EVENT_SCRIPT H7102001E
  • Const SCRIPT_LOCATION "D\SRC\ROUTING\ROUTING.VB
    S"
  • Dim oSession, oEvents, oMessage As Object
  • Dim oBindings, oBinding, oBoundFolder, oMap As
    Object
  • Set oSession CreateObject("MAPI.Session")
  • oSession.logon
  • ' Bind an Events object to current session
  • Set oEvents CreateObject("MSExchange.Events")
  • oEvents.Session oSession
  • Assume oMyFolder exists get Bindings
    collection on it
  • Set oBoundFolder oEvents.BoundFolder(oMyFolder,
    True)
  • Set oBindings oBoundFolder.Bindings

28
Binding A Routing Agent - 2
  • Make sure there are no other agents in this
    folder
  • If oBindings.Count gt 0 Then
  • MsgBox ("Existing Agents in this Folder.
    Press OK to quit.")
  • Set oEvents Nothing
  • oSession.logoff
  • End
  • End If
  • Create binding to Routing Engine handler
  • Set oBinding oBindings.Add
  • oBinding.Name "Routing Objects Sample"
  • oBinding.Active True
  • oBinding.EventMask 1 2 4 8 all four
    event types
  • oBinding.HandlerClassID "69E64151-B371-11D0-BCD
    9- 00AA00C1AB1C"
  • oBinding.SaveChanges

29
Binding A Routing Agent - 3
  • Get binding message so we can put properties on
    it
  • Set oMessage oSession.Getmessage(oBinding.EntryI
    D, Null)
  • ' Read the standard script actions from the file
    ROUTING.VBS
  • Open SCRIPT_LOCATION For Input As 1
  • bstrEventScript Input(LOF(1), 1)
  • Close 1
  • oMessage.Fields.Item(PR_EVENT_SCRIPT)
    bstrEventScript
  • oMessage.Update
  • ' Create a new Map object
  • Set oMap CreateObject("ExRt.Map")
  • Fill it with Rows (omitted from this sample
    see SDK)
  • ' Bind the map into the hidden message object
  • oMap.SaveMap oMessage

30
Binding A Routing Agent - 4
  • ' Note must "dirty" the CDO message before
    calling update
  • oMessage.Subject "Routing Object Samples"
  • oMessage.Update
  • ' Must call SaveCustomChanges since changed
    custom props
  • oBinding.SaveCustomChanges oMessage
  • ' Commit changes to the bindings collection
  • oBoundFolder.SaveChanges
  • ' Clean up
  • Set oEvents Nothing
  • oSession.logoff

31
Routing Documentation
  • http//msdn.microsoft.com/library
  • /Platform SDK
  • /Messaging and Collaboration
  • /Microsoft Exchange Server
  • /Exchange Server Programmers Reference
  • /Guide
  • /Exchange Server Scripting and Routing
  • Latest documentation
  • Supercedes help files shipped in Service Packs

32
Routing Objects Samples
  • Agent Editor
  • Source Code TechNethttp//technet.microsoft.com/
    download/exchange/misc/aesource.exe
  • Source Code Platform SDKExchange Server
    Programmers Reference/Guide/Sample Applications
  • Routing Wizard
  • Compiled Exchange 5.5 SP1 or SP2
    CDltdrivegt\SERVER\SUPPORT\COLLAB\SAMPLER\ROUTING
  • Source code TechNethttp//technet.microsoft.com/
    download/exchange/misc/rwsource.exe

33
Routing Objects Samples
  • Outlook Ad-Hoc Routing Form
  • Source code TechNet http//technet.microsoft.com/
    download/exchange/misc/routing.exe

34
(No Transcript)
Write a Comment
User Comments (0)
About PowerShow.com