autodest example (Article # 204)
View products that this article applies to.
Problem:
The fcSDK documentation for AutoDest does not currently have any usage examples.
keywords:
AutoDest AutoDestination Auto-Destination Auto-Dest
Resolution:
Here is a link to our online docs to follow along:
http://www.fchoice.com/user_guides/fcSDK/2.2.0/html/fcSDK~FChoice.Foundation.Clarify.AutoDest.AutoDestRule_members.html
The fcSDK autodest is compatible with Clarify's AutoDest mechanism. I am not sure how familiar you are with AutoDest but I will assume you have read Clarify's AutoDest documentation.
AutoDest rules are stored in table_rule. The important fields in this table are : title, operation, and rule_text.
Title - usually maps to the object type the rule will be run against
Operation - Basically a name for the autodest rule
Rule_text - The destination rule to be tested.
The typical pattern for executing rules stored in the database is the following (Example is in C#):
using FChoice.Foundation.Clarify.AutoDest;
...
AutoDestRule r = AutoDestRule.RetrieveRule("case","EMC_DISPATCH");
string[] queues = r.EvaluateRule("5");
Note: This executes the "EMC_DISPATCH" operation against an object of type "case" then Evaluates the rule for an object with an id_number of "5" the queues varible will contain a string array of queues this rule could be dispatched into.
If you need to run/test rules that are not stored in the database you should use the RunRule() method:
string siteId = "1";
string ruleText = @"(cust_loc2case:title = ""Emailed Case"") -> ""Email"";";
string[] queues = AutoDestRule.RunRule("site", ruleText, siteId);
Note: The double quotes are only necessary for C#.
Applies To: