Hi,
I needed a way to use commerce server objects to evaluate expressions. I
want use ExpressionEvaluator object to evaluate target expressions and
catalog expressions, but couldn't find the way to evaluate this
expressions.
I want the evaulation's result to be assigned to
ExpressionEvaluator.ExpressionResult object. But I don't set to
TarrgetingProfileCollection of the ExpressionResults' parameters. For this
reason ExpressionResult returns the "UndefinedResult" value, but the
expected values are "true" or "false".
Below i have upplied the code that i expect to return boolean value, but
it
returns "UndefinedResult"
UserObjectProfile profile = CurrentUser.GetUserProfile(true);
Microsoft.CommerceServer.Runtime.Profiles.Profile userprofile =
CommerceContext.Current.ProfileSystem.GetProfile("{" +
profile.Id.ToString()
+ "}", "UserObject");
TargetingProfileCollection profiles = new TargetingProfileCollection();
profiles.Add("Profile",userprofile);
MarketingExpressionEvaluator expressionEvaluator = new
MarketingExpressionEvaluator(connectionString,
CommerceContext.Current.DebugContext);
MarketingExpressionEvaluator.ExpressionResult result =
expressionEvaluator.Evaluate(expressinid, profiles);


|