[rules-users] DSL questions....
Pegram, Macon
zmpegram at choosehmc.com
Thu Oct 22 10:28:54 EDT 2009
All,
Given the following rule:
rule "Add ABC123 Feature"
when
not MyFeature(testCD == "ABC123")
UserRequest(someValue == "ABC123_FEATURE")
$eligible : FeatureEligible(testCD == "ABC123")
then
insert(new MyFeature($eligible));
end
I'd like to create a DSL. Notice that "testCD" is the same value.
Is it possible to apply a value captured in a DSL and use it in more
than one condition? In the above scenario we want to see if the user
is eligible for the feature ABC123, and check whether or not that
feature has already been added in working memory.
The DSL version of the rule might look something like:
rule "Add ABC123 Feature"
when
User is eligible for "ABC123"
User requests "ABC123_FEATURE"
then
Add feature
end
Would I need to write the DSL for the "ABC123" piece like this?
[when]User is eligible for "{testCD}"=not MyFeature(testCD ==
"{testCD}") $eligible : FeatureEligible(testCD = "{testCD}")
Or will I always need to create 2 statements?
What are the performance implications of using a DSL? Is there extra
overhead at runtime or does all the interpretation occur at rule
compilation?
Thanks!
Macon
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20091022/5bb2e575/attachment.html
More information about the rules-users
mailing list