How to use MarketingExpressionEvaluator.Evaluate ?

This is a discussion on How to use MarketingExpressionEvaluator.Evaluate ? within the Commerce server forums in Microsoft Tools category; 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() + ...

Go Back   Application Development Forum > Microsoft Tools > Commerce server

Object Mix

Register FAQ Calendar Search Today's Posts Mark Forums Read
  #1  
Old 02-26-2008, 11:48 AM
Ziver MALHASOGLU
Guest
 
Default How to use MarketingExpressionEvaluator.Evaluate ?

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);


Reply With Quote
Reply


Thread Tools
Display Modes


All times are GMT -5. The time now is 06:53 AM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
vB Ad Management by =RedTyger=

In an effort to better serve ads to our visitors, cookies are used on objectmix.com. For more information, check out our Privacy Policy.