Content Selection Framework - Extending the EEE

This is Interesting: Free IT Magazines  
Home > Archive > Content Selection Framework > August 2006 > Extending the EEE





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Extending the EEE
J.F. Larente

2006-07-10, 7:17 pm

Does anyone have sample code for using the Expression Evaluator Engine
outside of the CSF pipeline context?

We're trying to use it to evaluate some custom rules and have never used it
before in that capacity.

Thanks!
J.F.


Madhur Joshi

2006-08-18, 1:18 am

I've pasted some sample vbs code below.
It uses the expression evaluation engine along with arbitrary dictionaries.
You can easily translate it into equivalent .Net code.
Hope that helps,

madhur


set evaluator = CreateObject("Commerce.ExpressionEvaluator")

sExpr = "<CLAUSE OPER='less-than'>" & _
"<PROPERTY ID='my.age' TYPE='number' MULTIVAL='false'/>"& _
"<IMMED-VAL TYPE='number'>21</IMMED-VAL>" & _
"</CLAUSE>"

set mainDict = CreateObject("Commerce.Dictionary")

' will return null because the result is undefined
WSCRIPT.Echo evaluator.EvalXML( sExpr, mainDict)

set myDict = CreateObject("Commerce.Dictionary")

' you can add more dictionaries if you want to target somthing besides my
set mainDict("my") = myDict

myDict("age") = 20

' will return true because my age is less than 21
WSCRIPT.Echo evaluator.EvalXML( sExpr, mainDict)

myDict("age") = 25

' will return false because my age is greater than 21
WSCRIPT.Echo evaluator.EvalXML( sExpr, mainDict)


Thanks,

madhur

This posting is provided "AS IS" with no warranties, and confers no rights.
You assume all risk for your use. © 2002 Microsoft Corporation.
All rights reserved.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
Please reply to the newsgroups only.
--------------------
From: "J.F. Larente" <jflarente@cactus.ca>
Subject: Extending the EEE
Date: Mon, 10 Jul 2006 15:36:46 -0400


Does anyone have sample code for using the Expression Evaluator Engine
outside of the CSF pipeline context?

We're trying to use it to evaluate some custom rules and have never used it
before in that capacity.

Thanks!
J.F.



Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com