> On Thursday 05 May 2005 18:54, S. Isaac Dealey wrote: >> The last few days I've been focusing my energies pretty >> heavily on a >> RuleManager.cfc engine for setting up arbitrary business >> rules using >> XML and CFC's. So the same engine would be useful for >> email filters,
> Is that BizXML or something of your own devising ? Hi Tom, It's designed to use schema-less xml with a collection of CFC's... Each CFC in the criteria package contains its own information about how to display, evaluate and localize individual criteria. For example, I'm currently working with the Text criteria, (rulecriteria.text.cfc) -- individual criteria CFC's are stored under the /ontap/_components/_cfc/ directory and the rulemanager.cfc (in the root cfc directory) handles adding or removing packages of criteria CFC's. So the directory structure looks like this: /_cfc/rulemanager.cfc /_cfc/rulecriteria.cfc /_cfc/rulecriteria/text.cfc - extends /_cfc/rulecriteria.cfc /_cfc/rulecriteria/date.cfc - extends /_cfc/rulecriteria.cfc /_cfc/rulecriteria/percent.cfc - extends /_cfc/rulecriteria.cfc So... if I'm working on a special implementation that needs additional criteria types, I can add or remove packages from the RuleManager object with RuleManager.addPackage("rulecriteria.myproject") or RuleManager.removePackage("myproject.rulecriteria"). So I could remove the default criteria types by using RuleManager.removeCriteria("rulecriteria"). The individual criteria CFC's then provide localized text for the user interface if the rulemanager will allow end-users to edit rules directly and contain the CFML logic used to generate and evaluate criteria nodes of the specified type. So an XML packet might look like this: <ruleset> <rule ruleid="..." name="My Email Filter" description="optional description"> <criteria type="rulecriteria.text" property="subject" format="contains" expression="cialis" /> <criteria type="rulecriteria.or" /> <criteria type="rulecriteria.text" property="subject" format="contains" expression="viagra" /> </rule> </ruleset> The rulemanager.cfc then brokers the relationship between the application and the individual criteria types, so when you evaluate a rule it walks through the criteria nodes, checks to see if it's instantiated a criteria object for the type, then executes criteria.test(criterianode,ruleContext) against that criteria object. Forms for and descriptions of individual rules / criteria are handled similarly, i.e. RuleManager.describe(ruleid) loops over the criteria for the rule and gets a localized description from the criteria object, and RuleManager.getCriteriaForm(type,ruleid,criteria) fetches an appropriate html form from the criteria object (as an html library structure so that other components or templates may modify the form as needed). RuleManager.setRuleCriteria(ruleid,criteria,data) - where data is usually the form collection, handles updating the XML packet, but it gets the new node (as a string of text) from the individual criteria type CFC. I'm still fleshing out the details ... I'm not entirely happy with them currently... the attributes for the rule node are a nitpicky detail for me -- I'd like to have <rule id="..." name="..." description="..." /> because to me that seems the most clean/intuitive, but "name" and "id" could cause conflicts with the name and id properties of an html form if input elements are given those names. So for that reason I might use <rule ruleid="..." rulename="..." ruledescription="..." /> but this just seems really ugly to me... and of course, I don't want to use "rulename" in the form and "name" in the xml packet... so... it's an annoying issue -- seems like it shouldn't be an issue at all, but it's very frustrating. I'd not heard of bizXML but wasn't able to find any good references to it on google.com ... you have a url? s. isaac dealey 954.522.6080 new epoch : isn't it time for a change? add features without fixtures with the onTap open source framework http://www.fusiontap.com http://coldfusion.sys-con.com/author/4806Dealey.htm ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Logware (www.logware.us): a new and convenient web-based time tracking application. Start tracking and documenting hours spent on a project or with a client with Logware today. Try it for free with a 15 day trial account. http://www.houseoffusion.com/banners/view.cfm?bannerid=67 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:205848 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54