Partager via


ExpressionEval Object

For the latest version of Commerce Server 2007 Help, see the Microsoft Web site.

Use this object to evaluate one or more expressions against a specified context. In addition, use this object to parse and evaluate user-defined expressions written as Extensible Markup Language (XML) fragments.

ProgID:

Commerce.ExpressionEvaluator (Externally creatable)

COM Class Name:

ExpressionEval

Type Library Name:

Microsoft Commerce Server Expression System Type Library

DLL Name:

exprarch.dll

Threading Model:

Both

[C++]

COM Interface Name:

IExpressionEval

Interface ID Constant:

IID_IExpressionEval

Header File:

ExprArchDLL.h, exprarch.h

In C++, the properties and methods of the ExpressionEval object are accessed through the IExpressionEval interface.

Methods

Method

Description

Connect

Establishes communication between the ExpressionEval object and an expression store.

CreateEvalContext

Creates a new ExprEvalContext object in the context cache.

Eval

Evaluates an expression.

EvalInContext

Evaluates an expression in a context previously loaded into the context cache.

EvalXML

Evaluates the specified XML text as an expression.

FlushAll

Removes all expressions from the expression cache.

FlushExpr

Removes the specified expression from the expression cache.

LoadAll

Reads all expressions from the expression store and loads them into the expression cache.

LoadExpr

Reads the specified expression from the expression store and loads it into the expression cache.

ParseXML

Parses the specified XML text to determine if it represents a valid expression.

Properties

Property

Description

ExprCount

Retrieves the number of expressions loaded into the expression cache.

This property is read-only.

Remarks

Expressions are stored in a database referred to as the Expression Store and accessed through an ExpressionStore object. When it is created, the ExpressionEval object initializes an expression cache and a context cache. Expressions must be compiled and loaded into the expression cache before being evaluated. To improve evaluation performance, use the LoadExpr or LoadAll method to preload expressions into the expression cache.

An expression is evaluated against data contained in a set of profiles. The profiles may be ProfileObject objects, Dictionary objects, or other objects that support property access through the IDispatch interface. The set of profiles is referred to as an evaluation context. If an evaluation context will be used across multiple expressions, create a stored context in the context cache using the CreateEvalContext method to increase efficiency.

The Connect method must be called before loading or evaluating expressions.

See Also

Other Resources

Targeting Objects

Expression Recordset

ExpressionStore Object

ProfileObject Object

Targeting Objects