[rules-users] DSL Entry Question
Wolfgang Laun
wolfgang.laun at gmail.com
Fri May 27 10:39:56 EDT 2011
On 27 May 2011 16:24, jstroup <jstroup at regenstrief.org> wrote:
> Hi,
>
> The 5.2 docs list the following example DSL entry
>
> [when][][Tt]here is an? {entity:\w+}=${entity!lc}: ${entity!ucfirst} ()
>
> Oops, there is a spurious '$', the second one. It should be
=${entity!lc}: {entity!ucfirst} ()
> and say the following about what follows the equals sign
>
> "The remaining part of the line after the delimiting equal sign is the
> replacement text for any DSLR text matching the regular expression. It may
> contain variable references, i.e., a variable name enclosed in braces."
>
> What does the colon following the first variable do?
The colon in "...=${entity!lc}: {entity!ucfirst} ()" will remain a colon,
after expansion. It's the colon after a binding variable.
> Also, I'm used to (and actually understand) the following syntax which does
> not prefix { with a $.
>
> [when]There is some {cheese} cheese available=Cheese(type=="{cheese}")
>
> My best guess is that the $ denotes a class name that is specified
> declaratively in the matching DSLR rule as opposed to a field {cheese} that
> is simply a replaceable parameter that matches whatever you type between
> "some" and "cheese available" and looks for Cheese objects of that type.
>
So,
> given the first DSL entry, if my rule text is
>
> when
>
> there is a cheese
>
> the rule will fire if a Cheese object has been inserted. And, conversely
>
> when
>
> There is an Cheese
>
> will also fire.
>
Since both expand to
$cheese: Cheese ()
>
> Am I on the right track here?
>
>
yes, and thanks for the Q.
-W
> Thanks,
>
> Jeff
>
>
>
>
>
>
> --
> View this message in context:
> http://drools.46999.n3.nabble.com/DSL-Entry-Question-tp2993076p2993076.html
> Sent from the Drools: User forum mailing list archive at Nabble.com.
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20110527/fd898f3a/attachment.html
More information about the rules-users
mailing list