<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.6000.16809" name=GENERATOR></HEAD>
<BODY>
<DIV dir=ltr align=left><SPAN class=234365514-20032009><FONT face=Arial
size=2>Hi,</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=234365514-20032009><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=234365514-20032009><FONT size=2><FONT
face=Arial> Is it possible to mix dsl language and regular rule syntax in
a rule file? I am trying to do this, but my rules
won't compile. The "unable to expand" error is returned during
compilation. I tried adding </FONT><FONT size=2><FONT
face=Arial>[*][]"{anything}" = "{anything}" to the dsl file to fix this, but
that didnt work. I used this strategy in Drools 4.0.7, but it doesn't seem to
work in Drools 5.0.0 M5. Below I provided a simple example of what I would like
to do.</FONT></FONT></FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=234365514-20032009><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=234365514-20032009><FONT face=Arial
size=2>Thanks,</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=234365514-20032009><FONT face=Arial
size=2>Dan</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=234365514-20032009><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=234365514-20032009><FONT face=Arial
size=4>animal.dslr file</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=234365514-20032009><FONT color=#808000><FONT
color=#808000>
<P align=left><FONT size=2>#created on: Mar 12,
2009<BR></FONT></FONT></FONT><B><FONT color=#960000><FONT color=#960000><FONT
size=2>package</FONT></B></FONT></FONT><FONT size=2>
com.fedex.cc.expertsystem.test<BR><B><FONT color=#960000><FONT
color=#960000>import</B></FONT></FONT></FONT><FONT size=2>
com.fedex.cc.expertsystem.fact.*</FONT></P>
<P align=left><FONT size=2></FONT></P><B><FONT color=#960000><FONT
color=#960000>
<P align=left><FONT size=2>expander</FONT></B></FONT></FONT><FONT size=2>
animal.dsl</FONT></P>
<P align=left><FONT size=2></FONT></P><B><FONT color=#960000><FONT
color=#960000>
<P align=left><FONT size=2>rule</FONT></B></FONT></FONT><FONT size=2>
</FONT><FONT color=#008000><FONT color=#008000 size=2>"Set dog's
ownership"<BR></FONT></FONT><B><FONT color=#960000
size=2>no-loop<BR></FONT></B><FONT size=2><B><FONT color=#960000><SPAN
class=234365514-20032009> </SPAN>when<BR><SPAN
class=234365514-20032009>
</SPAN></FONT></B>There <B><FONT color=#960000><FONT
color=#960000>is</B></FONT></FONT></FONT><FONT size=2> an animal lover <B><FONT
color=#960000><FONT color=#960000>and</B></FONT></FONT></FONT><FONT size=2> dog
<B><FONT color=#960000><FONT color=#960000>in</B></FONT></FONT></FONT><FONT
size=2> the system<BR><SPAN class=234365514-20032009>
</SPAN></FONT><B><FONT color=#960000><FONT color=#960000><FONT
size=2>then</FONT></B></FONT></FONT><FONT size=2> <BR><SPAN
class=234365514-20032009><STRONG><FONT
color=#960000>
</FONT></STRONG></SPAN>The person owns the dog<BR></FONT><B><FONT
color=#960000><FONT color=#960000><FONT size=2>end</FONT></P></B></FONT></FONT>
<P align=left><FONT size=2></FONT></P><B><FONT color=#960000><FONT
color=#960000>
<P align=left><FONT size=2>rule</FONT></B></FONT></FONT><FONT size=2>
</FONT><FONT color=#008000><FONT size=2>"Tell us person doesnt like
dogs"<BR><SPAN class=234365514-20032009>
</SPAN></FONT></FONT><B><FONT color=#960000><FONT color=#960000><FONT
size=2>when</FONT></B></FONT></FONT><FONT size=2> <BR><SPAN
class=234365514-20032009><STRONG><FONT
color=#960000>
</FONT></STRONG></SPAN>person : Person(animalLover == <B>false</B>)<BR><SPAN
class=234365514-20032009> </SPAN></FONT><B><FONT
color=#960000><FONT size=2>then</FONT><SPAN class=234365514-20032009><FONT
size=2> <BR>
</FONT></SPAN></FONT></B><FONT size=2>System.out.println(<FONT
color=#008000><FONT color=#008000>"Person does not like
dog"</FONT></FONT>);<BR></FONT><B><FONT color=#960000><FONT color=#960000><FONT
size=2>end</FONT></FONT></FONT></B></P>
<P align=left><B><FONT><FONT><FONT face=Arial size=4><SPAN
class=234365514-20032009></SPAN></FONT></FONT></FONT></B><B><FONT
color=#960000><FONT color=#960000><FONT size=2><FONT face=Arial><FONT
color=#0000ff><FONT size=4><FONT color=#000000>a</FONT><SPAN
class=234365514-20032009><FONT color=#000000>nimal.dsl
file</FONT><BR></SPAN></FONT></FONT></FONT></FONT></FONT></FONT></B><B><FONT
color=#960000><FONT color=#960000><FONT size=2><BR>[condition][]There is an
animal lover and dog in the system=person : Person(animalLover == true) dog :
Dog()<BR>[consequence][]The person owns the
dog=dog.setOwnerLastName(person.getLastName());
update(dog);</P></FONT></B></FONT></FONT></SPAN></DIV>
<DIV> </DIV>
<DIV align=left><FONT face=Arial size=2>Daniel Quinn</FONT></DIV>
<DIV align=left><FONT face=Arial size=2>Fedex - Custom Critical</FONT></DIV>
<DIV align=left><FONT face=Arial size=2>Software Specialist I</FONT></DIV>
<DIV align=left><FONT face=Arial size=2>234.310.4090(x2586)</FONT></DIV>
<DIV> </DIV><BR>
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> rules-users-bounces@lists.jboss.org
[mailto:rules-users-bounces@lists.jboss.org] <B>On Behalf Of </B>Jeff
Davis<BR><B>Sent:</B> Friday, March 20, 2009 10:29 AM<BR><B>To:</B>
rules-users@lists.jboss.org<BR><B>Subject:</B> [rules-users] Error running
DroolsCompilerAntTask in CR1<BR></FONT><BR></DIV>
<DIV></DIV>Hi,
<DIV><BR></DIV>
<DIV>I upgraded everything from M5 to CR1 last night, but noticed that my ant
task no longer worked and was returning an error (it had worked previously under
M5, and I confirmed by switching everything back to test). The error I now
receive is:</DIV>
<DIV><BR></DIV>
<DIV>
<DIV>[compiler] java.util.zip.ZipException: error in opening zip file</DIV>
<DIV>[compiler] at java.util.zip.ZipFile.open(Native Method)</DIV>
<DIV>[compiler] at
java.util.zip.ZipFile.<init>(ZipFile.java:203)</DIV>
<DIV>[compiler] at
java.util.zip.ZipFile.<init>(ZipFile.java:234)</DIV>
<DIV>[compiler] at
org.apache.tools.ant.AntClassLoader.getResourceURL(AntClassLoader.java:1028)</DIV>
<DIV>[compiler] at
org.apache.tools.ant.AntClassLoader$ResourceEnumeration.findNextResource(AntClassLoader.java:147)</DIV>
<DIV>[compiler] at
org.apache.tools.ant.AntClassLoader$ResourceEnumeration.nextElement(AntClassLoader.java:130)</DIV>
<DIV>[compiler] at
org.apache.tools.ant.util.CollectionUtils$CompoundEnumeration.nextElement(CollectionUtils.java:198)</DIV>
<DIV>[compiler] at
sun.misc.CompoundEnumeration.nextElement(CompoundEnumeration.java:43)</DIV>
<DIV>[compiler] at
org.drools.util.ChainedProperties.loadProperties(ChainedProperties.java:233)</DIV>
<DIV>[compiler] at
org.drools.util.ChainedProperties.<init>(ChainedProperties.java:119)</DIV>
<DIV>[compiler] at
org.drools.util.ChainedProperties.<init>(ChainedProperties.java:41)</DIV>
<DIV>[compiler] at
org.drools.util.ChainedProperties.<init>(ChainedProperties.java:35)</DIV>
<DIV>[compiler] at
org.drools.RuleBaseConfiguration.init(RuleBaseConfiguration.java:376)</DIV>
<DIV>[compiler] at
org.drools.RuleBaseConfiguration.<init>(RuleBaseConfiguration.java:234)</DIV>
<DIV>[compiler] at
org.drools.common.AbstractRuleBase.<init>(AbstractRuleBase.java:149)</DIV>
<DIV>[compiler] at
org.drools.reteoo.ReteooRuleBase.<init>(ReteooRuleBase.java:144)</DIV>
<DIV>[compiler] at
org.drools.reteoo.ReteooRuleBase.<init>(ReteooRuleBase.java:121)</DIV>
<DIV>[compiler] at
org.drools.RuleBaseFactory.newRuleBase(RuleBaseFactory.java:58)</DIV>
<DIV>[compiler] at
org.drools.RuleBaseFactory.newRuleBase(RuleBaseFactory.java:38)</DIV>
<DIV>[compiler] at
org.drools.contrib.DroolsCompilerAntTask.createWithPackageBuilder(DroolsCompilerAntTask.java:241)</DIV>
<DIV>[compiler] at
org.drools.contrib.DroolsCompilerAntTask.execute(DroolsCompilerAntTask.java:170)</DIV>
<DIV>[compiler] at
org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)</DIV>
<DIV>[compiler] at
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)</DIV>
<DIV>[compiler] at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)</DIV>
<DIV>[compiler] at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)</DIV>
<DIV>[compiler] at
java.lang.reflect.Method.invoke(Method.java:585)</DIV>
<DIV>[compiler] at
org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)</DIV>
<DIV>[compiler] at
org.apache.tools.ant.Task.perform(Task.java:348)</DIV>
<DIV>[compiler] at
org.apache.tools.ant.Target.execute(Target.java:357)</DIV>
<DIV>[compiler] at
org.apache.tools.ant.Target.performTasks(Target.java:385)</DIV>
<DIV>[compiler] at
org.apache.tools.ant.Project.executeSortedTargets(Project.java:1337)</DIV>
<DIV>[compiler] at
org.apache.tools.ant.Project.executeTarget(Project.java:1306)</DIV>
<DIV>[compiler] at
org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)</DIV>
<DIV>[compiler] at
org.apache.tools.ant.Project.executeTargets(Project.java:1189)</DIV>
<DIV>[compiler] at
org.apache.tools.ant.Main.runBuild(Main.java:758)</DIV>
<DIV>[compiler] at
org.apache.tools.ant.Main.startAnt(Main.java:217)</DIV>
<DIV>[compiler] at
org.apache.tools.ant.launch.Launcher.run(Launcher.java:257)</DIV>
<DIV>[compiler] at
org.apache.tools.ant.launch.Launcher.main(Launcher.java:104)</DIV>
<DIV><BR></DIV>
<DIV>My build.xml is:</DIV>
<DIV><BR></DIV>
<DIV>
<DIV><project name="test" default="compile"></DIV>
<DIV><BR></DIV>
<DIV><SPAN class=Apple-tab-span style="WHITE-SPACE: pre"></SPAN><path
id="drools.path.task"></DIV>
<DIV><SPAN class=Apple-tab-span style="WHITE-SPACE: pre"></SPAN><fileset
dir="C:\Apps\drools-5.0.0.CR1-bin"></DIV>
<DIV><SPAN class=Apple-tab-span style="WHITE-SPACE: pre"></SPAN><include
name="drools-compiler-5.0.0.CR1.jar"/></DIV>
<DIV><SPAN class=Apple-tab-span style="WHITE-SPACE: pre"></SPAN><include
name="drools-ant-5.0.0.CR1.jar"/></DIV>
<DIV><SPAN class=Apple-tab-span style="WHITE-SPACE: pre"></SPAN><include
name="drools-core-5.0.0.CR1.jar"/></DIV>
<DIV><SPAN class=Apple-tab-span style="WHITE-SPACE: pre"></SPAN><include
name="drools-decisiontables-5.0.0.CR1.jar"/></DIV>
<DIV><SPAN class=Apple-tab-span style="WHITE-SPACE: pre"></SPAN><include
name="drools-api-5.0.0.CR1.jar"/></DIV>
<DIV><SPAN class=Apple-tab-span
style="WHITE-SPACE: pre"></SPAN></fileset></DIV>
<DIV><SPAN class=Apple-tab-span style="WHITE-SPACE: pre"></SPAN><fileset
dir="C:\Apps\drools-5.0.0.CR1-bin\lib"></DIV>
<DIV><SPAN class=Apple-tab-span style="WHITE-SPACE: pre"></SPAN><include
name="*.jar"/></DIV>
<DIV><SPAN class=Apple-tab-span
style="WHITE-SPACE: pre"></SPAN></fileset></DIV>
<DIV><SPAN class=Apple-tab-span
style="WHITE-SPACE: pre"></SPAN></path></DIV>
<DIV><SPAN class=Apple-tab-span style="WHITE-SPACE: pre"></SPAN></DIV>
<DIV><SPAN class=Apple-tab-span style="WHITE-SPACE: pre"></SPAN><path
id="drools.path"></DIV>
<DIV><SPAN class=Apple-tab-span style="WHITE-SPACE: pre"></SPAN><pathelement
path="target\classes"/></DIV>
<DIV><SPAN class=Apple-tab-span style="WHITE-SPACE: pre"></SPAN><fileset
dir="C:\Apps\drools-5.0.0.CR1-bin"></DIV>
<DIV><SPAN class=Apple-tab-span style="WHITE-SPACE: pre"></SPAN><include
name="drools-ant-5.0.0.CR1.jar"/></DIV>
<DIV><SPAN class=Apple-tab-span style="WHITE-SPACE: pre"></SPAN><include
name="drools-decisiontables-5.0.0.CR1.jar"/></DIV>
<DIV><SPAN class=Apple-tab-span style="WHITE-SPACE: pre"></SPAN><include
name="drools-api-5.0.0.CR1.jar"/></DIV>
<DIV><SPAN class=Apple-tab-span
style="WHITE-SPACE: pre"></SPAN></fileset></DIV>
<DIV><SPAN class=Apple-tab-span
style="WHITE-SPACE: pre"></SPAN></path></DIV>
<DIV><BR></DIV>
<DIV><SPAN class=Apple-tab-span style="WHITE-SPACE: pre"></SPAN><taskdef
name="compiler" classname="org.drools.contrib.DroolsCompilerAntTask"
classpathref="drools.path.task" /></DIV>
<DIV><BR></DIV>
<DIV> <target name="create.rules.package" ><SPAN
class=Apple-tab-span style="WHITE-SPACE: pre"> </SPAN></DIV>
<DIV> <compiler</DIV>
<DIV>
srcdir="src\main\rules"</DIV>
<DIV>
tofile="target\package\packge.pkg"</DIV>
<DIV>
classpathref="drools.path"></DIV>
<DIV> <include
name="Sample.drl" /></DIV>
<DIV> </compiler></DIV>
<DIV> </target></DIV>
<DIV> </DIV>
<DIV> <target name="clean"></DIV>
<DIV><SPAN class=Apple-tab-span style="WHITE-SPACE: pre"></SPAN><delete
includeemptydirs="true"></DIV>
<DIV><SPAN class=Apple-tab-span style="WHITE-SPACE: pre"></SPAN><fileset
dir="target"/></DIV>
<DIV><SPAN class=Apple-tab-span
style="WHITE-SPACE: pre"></SPAN></delete></DIV>
<DIV><SPAN class=Apple-tab-span
style="WHITE-SPACE: pre"></SPAN></target></DIV>
<DIV><SPAN class=Apple-tab-span style="WHITE-SPACE: pre"></SPAN></DIV>
<DIV><SPAN class=Apple-tab-span style="WHITE-SPACE: pre"></SPAN><target
name="compile" depends="clean"></DIV>
<DIV><SPAN class=Apple-tab-span style="WHITE-SPACE: pre"></SPAN><mkdir
dir="target/classes"/></DIV>
<DIV><SPAN class=Apple-tab-span style="WHITE-SPACE: pre"></SPAN><mkdir
dir="logs"/></DIV>
<DIV><SPAN class=Apple-tab-span style="WHITE-SPACE: pre"></SPAN><javac
destdir="target/classes" debug="on" source="1.5" target="1.5"></DIV>
<DIV><SPAN class=Apple-tab-span style="WHITE-SPACE: pre"></SPAN><src
path="src\main\java"/></DIV>
<DIV><SPAN class=Apple-tab-span style="WHITE-SPACE: pre"></SPAN><classpath
refid="drools.path.task"/></DIV>
<DIV><SPAN class=Apple-tab-span
style="WHITE-SPACE: pre"></SPAN></javac></DIV>
<DIV><SPAN class=Apple-tab-span
style="WHITE-SPACE: pre"></SPAN></target></DIV>
<DIV><BR></DIV>
<DIV><SPAN class=Apple-tab-span style="WHITE-SPACE: pre"></SPAN><target
name="init"></DIV>
<DIV><SPAN class=Apple-tab-span style="WHITE-SPACE: pre"></SPAN><mkdir
dir="target/classes"/></DIV>
<DIV><SPAN class=Apple-tab-span style="WHITE-SPACE: pre"></SPAN><mkdir
dir="target"/></DIV>
<DIV><SPAN class=Apple-tab-span style="WHITE-SPACE: pre"></SPAN><mkdir
dir="target/wsdl2javasource"/></DIV>
<DIV><SPAN class=Apple-tab-span
style="WHITE-SPACE: pre"></SPAN></target></DIV>
<DIV></project></DIV>
<DIV><BR></DIV>
<DIV>If anyone has any ideas, they would be much appreciated!</DIV>
<DIV><BR></DIV>
<DIV>Thanks!</DIV>
<DIV><BR></DIV>
<DIV>jeff</DIV></DIV></DIV></BODY></HTML>