[jboss-user] [JBoss Seam] - Drools domain specific language files in Seam
joff
do-not-reply at jboss.com
Thu Jul 20 20:37:39 EDT 2006
I've managed to deploy JBoss Rules using Seam quite happily, going along with the docs, but as soon as I try and use a Domain Specific Langage file (.dsl) things come apart:
My components.xml has this:
<component name="myRules"
| class="org.jboss.seam.drools.RuleBase">
| <property name="ruleFiles">drools/myrules.drl</property>
| </component>
| <component name="myWorkingMemory"
| class="org.jboss.seam.drools.ManagedWorkingMemory">
| <property name="ruleBaseName">myRules</property>
| </component>
I deploy my application EAR with both files (myrules.drl and myrules.dsl) inside the drools dir, i.e. application.ear/drools/
The myrules.drl defines the DSL thus:
package com.example.myapp
|
| expander myrules.dsl
|
| rule "My Rule"
| ... etc etc
It works fine in Eclipse, but when I try and use it in my app:
public class MyActionImpl implements MyAction {
|
| @In(create=true)
| WorkingMemory myWorkingMemory;
|
| public void doAction() {
| ....
| myWorkingMemory.assertObject(myObject);
| myWorkingMemory.fireAllRules();
| ....
| }
I get the following exception:
java.lang.IllegalArgumentException: Unable to use expander. Make sure a expander or dsl config is being passed to the parser. [ExpanderResolver was not set].
|
| at org.drools.lang.RuleParser.expander(Unknown Source)
|
| at org.drools.lang.RuleParser.prolog(Unknown Source)
|
| at org.drools.lang.RuleParser.compilation_unit(Unknown Source)
|
| at org.drools.compiler.DrlParser.compile(Unknown Source)
|
| at org.drools.compiler.DrlParser.parse(Unknown Source)
|
| at org.drools.compiler.DrlParser.parse(Unknown Source)
|
| at org.jboss.seam.drools.RuleBase.compileRuleBase(RuleBase.java:38)
|
| at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
|
| at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
|
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
|
| at java.lang.reflect.Method.invoke(Method.java:585)
|
| at org.jboss.seam.util.Reflections.invoke(Reflections.java:16)
|
| at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:35)
|
| at org.jboss.seam.Component.callComponentMethod(Component.java:1418)
|
| at org.jboss.seam.Component.callCreateMethod(Component.java:1406)
|
| at org.jboss.seam.Component.newInstance(Component.java:1396)
|
| at org.jboss.seam.Component.getInstance(Component.java:1311)
|
| at org.jboss.seam.Component.getInstance(Component.java:1294)
etc
Do I need to be including the .dsl file somehow in the components.xml ? Or does this just not work at this stage?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3959745#3959745
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3959745
More information about the jboss-user
mailing list