advanced business rules (part2)
DESCRIPTION
TRANSCRIPT
© 2010 Dovetail Software Inc.
Advanced Rulemanager &Business Rules
(Part 2)
Join the conversation: http://backnoise.com/?rulemanager
© 2010 Dovetail Software Inc.Join the conversation at: http://backnoise.com/rulemanager
BackChannel
Join the conversation:http://backnoise.com/?rulemanager
© 2010 Dovetail Software Inc.Join the conversation at: http://backnoise.com/rulemanager
Me
Gary Sherman, Clarify
© 2010 Dovetail Software Inc.Join the conversation at: http://backnoise.com/rulemanager
Previously, on Days of Our Lives…
• Intro to Rulemanager and Business Rules• Advanced Business Rules (Part 1)
Both presentations are available on the Rulemanager wiki: http://rulemanager.wikispaces.com
© 2010 Dovetail Software Inc.
CUSTOM NOTIFICATION METHODS
© 2010 Dovetail Software Inc.Join the conversation at: http://backnoise.com/rulemanager
Baseline notification methods
• Email • Notifier• Tone Pager• Digital Pager• Text Pager• None• Forward to my Supervisor
© 2010 Dovetail Software Inc.Join the conversation at: http://backnoise.com/rulemanager
1990 called and wants their pagers back
• Email • Notifier• Tone Pager• Digital Pager• Text Pager• None• Forward to my Supervisor
© 2010 Dovetail Software Inc.Join the conversation at: http://backnoise.com/rulemanager
1990 called and wants their pagers back
Rulemanager uses an external app to send pages
This means we can take over that method
And we can do whatever we want!
© 2010 Dovetail Software Inc.Join the conversation at: http://backnoise.com/rulemanager
Paging Application Configuration
Clarify Rulemanager:SvcConfig.exe (Windows)Rulemansvc.env (UNIX)
Dovetail Rulemanager:<add key="NotificationConfig.PagerApplicationPath" value=“c:\mypager.bat" />
© 2010 Dovetail Software Inc.Join the conversation at: http://backnoise.com/rulemanager
Paging Application
{paging application} -p <pager_type> -t <employees pager number> -m <message to be sent> -e <employees email address>
pager_clerk.exe -p SKY_WORD -t 512-123-4567 -m “This is a message” -e “[email protected]”
© 2010 Dovetail Software Inc.Join the conversation at: http://backnoise.com/rulemanager
Paging Application
{paging application} -p <pager_type> -t <employees pager number> -m <message to be sent> -e <employees email address>
pager types:text pager: SKY_WORDdigital pager: DIGITALtone pager: SKY_PAGER
© 2010 Dovetail Software Inc.Join the conversation at: http://backnoise.com/rulemanager
My Paging Application
• DOS batch file• Powershell script • UNIX shell script• Java or .NET executable• cbbatch script• Javascript script• Ruby script
© 2010 Dovetail Software Inc.Join the conversation at: http://backnoise.com/rulemanager
My Paging Application
• Send an SMS message • Send an email to a user’s mobile device (email
to SMS gateway)• Make a phone (voice) call• Send a direct Twitter message• Send an Instant Message• Send a message to a beeper
(in case you’re still stuck in 1990) • Third party APIs and services make this easy
© 2010 Dovetail Software Inc.Join the conversation at: http://backnoise.com/rulemanager
Additional Nicety – Modify the UI
© 2010 Dovetail Software Inc.Join the conversation at: http://backnoise.com/rulemanager
Which Message?If sending to a text pager, then the full message
is used.
Tip
If sending to a tone or digital pager, then the abbreviated message is used.
© 2010 Dovetail Software Inc.Join the conversation at: http://backnoise.com/rulemanager
Custom Notification Methods
There are a couple of examples on the rulemanager wiki
http://rulemanager.wikispaces.com
© 2010 Dovetail Software Inc.Join the conversation at: http://backnoise.com/rulemanager
Lets see this in action…
© 2010 Dovetail Software Inc.
CUSTOM BUSINESS RULE EVENTS
© 2010 Dovetail Software Inc.Join the conversation at: http://backnoise.com/rulemanager
Example
Fire a business rule when the Priority of a Case is changed
© 2010 Dovetail Software Inc.Join the conversation at: http://backnoise.com/rulemanager
Custom Events
© 2010 Dovetail Software Inc.Join the conversation at: http://backnoise.com/rulemanager
User-Defined Business Rule Events
Steps
1. Add your event to the business rule GUI2. Create a business rule for your event3. Optional: Create an act_entry for your event4. Create time bomb for your event
© 2010 Dovetail Software Inc.Join the conversation at: http://backnoise.com/rulemanager
Add your event to the business rule GUI
© 2010 Dovetail Software Inc.Join the conversation at: http://backnoise.com/rulemanager
Add your event to the business rule GUI
© 2010 Dovetail Software Inc.Join the conversation at: http://backnoise.com/rulemanager
Create a business rule for your event
Object: CaseEvent: Change PriorityCondition: Action: Notify someone
© 2010 Dovetail Software Inc.Join the conversation at: http://backnoise.com/rulemanager
Create time bomb (ClearBasic)dim TimeBombRecord as New Recorddim TimeBombSave as New BulkSave
TimeBombRecord.RecordType = "time_bomb"
TimeBombRecord.SetField "focus_lowid", caseRecord.GetField("objid")TimeBombRecord.SetField "focus_type", 0TimeBombRecord.SetField "escalate_time", "1/1/1753 "TimeBombRecord.SetField "end_time", App.CurrentDateTimeBombRecord.SetField "flags", 65601538
‘Optional fieldTimeBombRecord.SetField "time_period", actRecord.GetField("objid")
TimeBombSave.InsertRecord TimeBombRecordTimeBombSave.RelateRecordsToId TimeBombRecord, "employee", _
App.EmployeeObjid, "cmit_creator2employee"TimeBombSave.Save
© 2010 Dovetail Software Inc.Join the conversation at: http://backnoise.com/rulemanager
Time Bomb Flags
flags = (n * 65536) + 2
for our example of event id 1001:(1001 * 65536) + 2 = 65601538
© 2010 Dovetail Software Inc.Join the conversation at: http://backnoise.com/rulemanager
User-Defined Events
The User-Defined Business Rule Events document on the rulemanager wiki has all the gory details that I just covered.
http://rulemanager.wikispaces.com
© 2010 Dovetail Software Inc.Join the conversation at: http://backnoise.com/rulemanager
Lets see this in action…
© 2010 Dovetail Software Inc.
ADDITIONAL CUSTOMIZATIONS
© 2010 Dovetail Software Inc.Join the conversation at: http://backnoise.com/rulemanager
Adding new object types to Biz Rules
For example, create business rules for your custom object, such as
• widget• license_key• build
© 2010 Dovetail Software Inc.Join the conversation at: http://backnoise.com/rulemanager
Adding new object types to Biz Rules
© 2010 Dovetail Software Inc.Join the conversation at: http://backnoise.com/rulemanager
Adding new object types to Biz Rules
• Customize the Business Rules form (472)– Add a new entry to the Object Type List– Add your custom events to the event List
• Add your custom rule properties • Add your custom recipient aliases• Create your business rule• Create your custom time bomb
© 2010 Dovetail Software Inc.Join the conversation at: http://backnoise.com/rulemanager
Adding new object types to Biz Rules
Refer to the Adding new Object Types to Business Rules document on the rulemanager wiki: http://rulemanager.wikispaces.com
© 2010 Dovetail Software Inc.Join the conversation at: http://backnoise.com/rulemanager
Adding Event Creation Times
Examples:Fire an action -30 days from
contract expiration dateFire an action -30 days from
license key expiration dateFire an action 180 days from
a site’s last onsite visit date
© 2010 Dovetail Software Inc.Join the conversation at: http://backnoise.com/rulemanager
Adding Event Creation Times
© 2010 Dovetail Software Inc.Join the conversation at: http://backnoise.com/rulemanager
Adding Event Creation Times
• Customize the Business Rule Action Form (474), adding a new entry to the List
• Add a Property Name Object for this new Event Creation (@USERTIME150)
© 2010 Dovetail Software Inc.Join the conversation at: http://backnoise.com/rulemanager
Adding Event Creation Times
The User-Defined Business Rule Event Creation Times document on the rulemanager wiki has all the details.
http://rulemanager.wikispaces.com
© 2010 Dovetail Software Inc.Join the conversation at: http://backnoise.com/rulemanager
Adding Custom Calendars
For example, fire a rule based on the business hours of a queue
© 2010 Dovetail Software Inc.Join the conversation at: http://backnoise.com/rulemanager
Adding Custom Calendars
© 2010 Dovetail Software Inc.Join the conversation at: http://backnoise.com/rulemanager
Adding Custom Calendars
• Edit the Business Rule Actions form (474)• Add your new business calendar to the List• Create a new rule property for the path to find
the new business calendar entry• Create a new rule property for the time zone
for the calendar
© 2010 Dovetail Software Inc.Join the conversation at: http://backnoise.com/rulemanager
Adding Custom Calendars
The creating user-defined calendars page on the rulemanager wiki has all the details.
http://rulemanager.wikispaces.com
© 2010 Dovetail Software Inc.
TIME BOMBS
© 2010 Dovetail Software Inc.Join the conversation at: http://backnoise.com/rulemanager
What the heck is a Time Bomb?
A time bomb is the mechanism used to tell Rulemanager that something happened in the system
© 2010 Dovetail Software Inc.Join the conversation at: http://backnoise.com/rulemanager
What the heck is a Time Bomb?
A time bomb is simply a row inserted into the time_bomb table
© 2010 Dovetail Software Inc.Join the conversation at: http://backnoise.com/rulemanager
Different kinds of Time Bombs
Rule Scheduling Time BombIndicates an end-user event, such as Case Create
Rule Time BombReflect the upcoming action of a business rule
Message Time BombInternal communication to rulemanager, such as telling it to re-cache information
© 2010 Dovetail Software Inc.Join the conversation at: http://backnoise.com/rulemanager
Time Bomb Flow
An event happens in the system (such as case is created)A new time bomb is createdRulemanager looks at all of the business rules in the system,
to see if this event matches to any business rulesIf a start event matches, then Rulemanager evaluates the rule
conditionsIf all of the conditions match, then a new time bomb is
created for the rule action (this may be now, or in the future)
When this time bomb expires, then the business rule action is fired
© 2010 Dovetail Software Inc.Join the conversation at: http://backnoise.com/rulemanager
Time Bomb Data
The flags field indicates:• which kind of time bomb it is• What event occurredThe escalate field says when this time bomb will
“go off”Other data :• objid of the “act_entry” for this event• objid and type of focus object (case 268435457)
© 2010 Dovetail Software Inc.Join the conversation at: http://backnoise.com/rulemanager
Time Bomb Data
The Business Rule Time Bombs document onthe rulemanager wiki has all the gory details
http://rulemanager.wikispaces.com
© 2010 Dovetail Software Inc.
TROUBLESHOOTING
© 2010 Dovetail Software Inc.Join the conversation at: http://backnoise.com/rulemanager
Common Issues
Rules not firing at allRules firing at wrong timeRules fire, but notifications are not setBad Time Bombs
© 2010 Dovetail Software Inc.Join the conversation at: http://backnoise.com/rulemanager
Troubleshooting
Tip
© 2010 Dovetail Software Inc.Join the conversation at: http://backnoise.com/rulemanager
Logging is your friend
Clarify Rulemanager: set the Logging Level to Verbosemake sure the admin email address is set
Dovetail Rulemanager : set the logging level to DEBUGlog warnings and errors to a separate log filesend email to admin on errors
© 2010 Dovetail Software Inc.Join the conversation at: http://backnoise.com/rulemanager
Rules fire, but notifications are not set
Check:• User’s email address• User’s Notification Preferences• User’s Business Hours• User’s Site’s Business Hours
© 2010 Dovetail Software Inc.Join the conversation at: http://backnoise.com/rulemanager
Bad Time Bomb
A bad time bomb will have it’s expiration date set way in the future (1/1/2999)
This allows you to diagnose itTypically caused by custom time bombsReview log file (search the logs for the time
bomb’s objid)Review the data in the time_bomb record
© 2010 Dovetail Software Inc.
FUTURE SHOWS
© 2010 Dovetail Software Inc.Join the conversation at: http://backnoise.com/rulemanager
Future Sessions (under consideration)
• Performance Tuning of Rulemanager• Monitoring• cbbatch• Your Ideas?
© 2010 Dovetail Software Inc.Join the conversation at: http://backnoise.com/rulemanager
Learn More
Wiki:http://rulemanager.wikispaces.com/
© 2010 Dovetail Software Inc.
Questions, Comments, Queries?
http://backnoise.com/?rulemanager