[rules-users] DSL Usage in Eclipse

dme1 mehtad at hotmail.com
Tue Sep 4 17:26:59 EDT 2012


Hi,

I am trying to create DSL and use the DSL in the Eclipse Guided Editor. I am
facing some difficulties in using DSL in the Guided Editor and have listed
these below. Would appreciate someone can advise how to get over there.

1. When using the DSL Editor, the DSL file containes [condition] and
[consequence] instead of [when], [then] (See below). Due to this the Guided
Editor does not show the "Conditions" or "Actions" (when pressing Ctrl+Space
Bar). The rule however executes correctly (and shows correctly in the DRL
Viewer) so the issue seems to be with the Guided Editor only

http://drools.46999.n3.nabble.com/file/n4019575/dsleditor2.jpg 

http://drools.46999.n3.nabble.com/file/n4019575/DSLEditor.jpg 

2. If I have the DSLs broken into multiple DSL files, then the Guided Editor
does not recognize this. Even the "DRL Viewer gives an error (the error does
not occur if I combine the 2 DSLs into a single DSL). See below. Again the
code works so seems to be an error with the Editor only.

http://drools.46999.n3.nabble.com/file/n4019575/multiple_expander1.jpg 

http://drools.46999.n3.nabble.com/file/n4019575/multiple_expander2.jpg 

3. Using the DSL below, if I enter the "when" part in the DSLR 
(E.g.rule "Validate Fight Type"
    //include attributes such as "salience" here...
    when
        //conditions
        For a Flight with
        	- flight type is 'LH')
Then the Guided Editor for the Action/Then part stops working (i.e. I do not
get any hints when pressing Ctrl+Space in the action part in the Guided
Editor). If I however remove the entries in the Condition/When section of
the rule, the Action now shows the correct hints.

http://drools.46999.n3.nabble.com/file/n4019575/dsl.jpg 

4. Finally if I create a DSL for the basic operators and use them in the
DSLR, the DSLR is not formed correctly (You can see the "-" in the field of
the Object in the last image). Based on the documentation this should have
just added the field with the "-", and if I remove the "-" it is treated as
a separate condition instead of a field of the Object - this part is as
expected.

Below I have the DSL and the "DRL View" of the Rules/DSLR.

http://drools.46999.n3.nabble.com/file/n4019575/basic_operators.jpg 

http://drools.46999.n3.nabble.com/file/n4019575/basic_operators2.jpg 

http://drools.46999.n3.nabble.com/file/n4019575/basic_operators3.jpg 

Thanks,
dme






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


More information about the rules-users mailing list