[rules-users] Problem in writing rule and apply DSL

braveheart85 andrea.pacifico.85 at gmail.com
Tue Nov 12 10:53:07 EST 2013


Hello guys,

I really need your help.
I'm writing a DSL file in order to allow my application user to write their
simple rules.
I have queries of this typology:

$a: Data( )
$b: Year( ) from $a.years
$c: Person( ) from $b.persons

dsl mapping (inline version):

there are persons=$a: Data( ) $b: Year( ) from $a.years $c: Person( ) from
$b.persons

now if i would add attribute to person i can't, for example to get persons
over 18 years old.
If i write:

there are persons
- age more than 18

drools engine try to add attribute to Data object, probably because it is
first object in line.
To resolve this problem i should write query something like:

$c: Person( ) from ( Year( ).persons from Data( ).years )

In this way i can add attribute to Person instead of Data. Unfortunatly i
don't know how can i get it.
Someone can help me please.

Best Regards





--
View this message in context: http://drools.46999.n3.nabble.com/Problem-in-writing-rule-and-apply-DSL-tp4026751.html
Sent from the Drools: User forum mailing list archive at Nabble.com.


More information about the rules-users mailing list