|
Home > Archive > BizTalk Server General > January 2006 > Business Rules Engine and object properties
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 |
Business Rules Engine and object properties
|
|
| Craig Vermeer 2006-01-16, 5:54 pm |
| Hello,
I have a question on using the Business Rules engine in BizTalk 2004.
I want design a business rule policy where I pass in two objects of the
same type, and evaluate the the values of certain properties on both of
those objects from within the Business Rules Engine.
Here's an example: I have a class called MyClass, and want to pass the
instances newMyClass and oldMyClass into the Rules Engine. From within
the Business Rules composer, I want a rule that's like this:
if(newMyClass.Name Is Not Equal To oldMyClass.Name)
Then
"Blah"
Now, I can setup my vocabulary to have two instances of MyClass, and
pass those into my Policy. However, I can't seem to evaluate the
properties on MyClass from within the Business Rule Composer. Is it
simply a matter of setting up a definition within my Vocabulary that
points to the property? If so, how do I tell the definition that I want
it to be the property from the newMyClass instance, rather than the
oldMyClass instance?
Any help is appreciated. I've tried searching around for some good
Business Rule Composer tutorials, but have found precious few resources.
If anyone has links to good resources on using the BRE, that would be
appreciated, as well.
Thanks,
Craig Vermeer
| |
| Tomas Restrepo \(MVP\) 2006-01-16, 8:50 pm |
| Hi Craig,
> I have a question on using the Business Rules engine in BizTalk 2004.
>
> I want design a business rule policy where I pass in two objects of the
> same type, and evaluate the the values of certain properties on both of
> those objects from within the Business Rules Engine.
>
> Here's an example: I have a class called MyClass, and want to pass the
> instances newMyClass and oldMyClass into the Rules Engine. From within
> the Business Rules composer, I want a rule that's like this:
>
> if(newMyClass.Name Is Not Equal To oldMyClass.Name)
> Then
> "Blah"
>
> Now, I can setup my vocabulary to have two instances of MyClass, and pass
> those into my Policy. However, I can't seem to evaluate the properties on
> MyClass from within the Business Rule Composer. Is it simply a matter of
> setting up a definition within my Vocabulary that points to the property?
> If so, how do I tell the definition that I want it to be the property from
> the newMyClass instance, rather than the oldMyClass instance?
>
> Any help is appreciated. I've tried searching around for some good
> Business Rule Composer tutorials, but have found precious few resources.
> If anyone has links to good resources on using the BRE, that would be
> appreciated, as well.
AFAIK, you don't need to tell the BRE to differenciate between the two. As
long as the two facts (i.e. the two .NET objects are asserted to the BRE
before evaluating the policy), the BRE runtime will know what to do by just
saying:
IF myClass.Name is Not equal to myClass.Name
THEN
....
as the engine will evaluate match all facts (including your two instances of
myClass) to see if they match the definition.
I thing Charles Young explains it a little more clearly in his "Comparing
the WWF rules engine and the BizTalk BRE" article
(http://geekswithblogs.net/cyoung/articles/56488.aspx). Check out the part
that reads "Forward Chaining in MS BRE".
--
Tomas Restrepo
tomasr@mvps.org
http://www.winterdom.com/
| |
| Craig Vermeer 2006-01-17, 5:58 pm |
| Great, that helps. I'll take another pass at implementing my rules
based on this info. I think, as the blog entry said, that I just need
to start thinking a little less procedurally 
Tomas Restrepo (MVP) wrote:
> Hi Craig,
>
>
>
> AFAIK, you don't need to tell the BRE to differenciate between the two. As
> long as the two facts (i.e. the two .NET objects are asserted to the BRE
> before evaluating the policy), the BRE runtime will know what to do by just
> saying:
>
> IF myClass.Name is Not equal to myClass.Name
> THEN
> ....
>
> as the engine will evaluate match all facts (including your two instances of
> myClass) to see if they match the definition.
>
> I thing Charles Young explains it a little more clearly in his "Comparing
> the WWF rules engine and the BizTalk BRE" article
> (http://geekswithblogs.net/cyoung/articles/56488.aspx). Check out the part
> that reads "Forward Chaining in MS BRE".
>
>
|
|
|
|
|