[rules-users] DSL Bug?

rjr201 rich.j.riley at gmail.com
Mon Feb 11 10:57:38 EST 2013


I've had the following problem when creating a DSL. Not sure if it's a bug,
but it confused me for a good 40 minutes so thought I'd mention it here in
case others have the same problem.. 

If I create a DSL like this: 

[when]There is a fact {fact_name}{fact_label}={fact_label}:{fact_name}()

And create a rule in the guided editor that has Object as the {fact_name}
and $obj as the {fact_label} I get: 

1.	|	rule "rule"
2.	|	    dialect "mvel"
3.	|	    when
4.	|	        Object$obj:()
5.	|	    then
6.	|	end

as the source.

At first I thought it was to do with putting quotation marks around the
{}'s. But I've since found that if I put a space between {fact_name} and
{fact_label} I get the expected result of: 

1.	|	rule "rule"
2.	|	    dialect "mvel"
3.	|	    when
4.	|	        $obj:Object()
5.	|	    then
6.	|	end

Again, sorry if this is down to my limited understanding of DSLs. Any
further insights into why this happens or any other quirks of DSLs would be
greatly appreciated as I'm going to be spending a lot of time with them in
the not too distant future.. 

Rich. 



--
View this message in context: http://drools.46999.n3.nabble.com/DSL-Bug-tp4022209.html
Sent from the Drools: User forum mailing list archive at Nabble.com.


More information about the rules-users mailing list