1
我使用DroolsCompilerAntTask为Ant构建和构建Drools的无法Ant构建
rules:
[compiler] Unable to resolve ObjectType 'Result' : [Rule name='Test']
时我提示以下错误:对于规则的文件我有
package rules
import com.drools.info.*;
dialect "java"
rule "Test"
when
$r:Result(total == Result.ONE )
then
System.out.println("Test Complete.");
end
在生成过程中解决对象类型.xml
<!-- rule -->
<path id="drools.path" >
<fileset dir="${basedir}/libs">
<include name="*.jar"/>
</fileset>
<pathelement location="${basedir}/build/rules" /> <- this is my path to compiled class files. If I exclude this line I got the above error. If I include this line then I got the (Access is denied) error. Either way is errored out. Are there permanent solution to this?
</path>
<path id="compile.classpath">
</path>
<taskdef name="compiler" classname="org.drools.contrib.DroolsCompilerAntTask" classpathref="drools.path" />
<target name="rules" >
<compiler
binformat="package"
srcdir="${basedir}/src/rules"
tofile="${basedir}/build"
classpathref="compile.classpath" >
<include name="*.drl" />
<include name="*.brl" />
<include name="*.xml" />
<include name="*.dslr" />
</compiler>
</target>
其中Result是来自com.drool.info.Result的类对象 我认为当我编译规则时,我没有添加类文件以及规则可能会导致这种情况?或者有没有办法告诉蚂蚁规则编译器的类文件是相关的?如果这是问题,我该如何解决它?
你能举一个例子吗?我的意思是如何在.rl中包含.class文件或者需要什么 – logger
taskdef中的classpath和classpathref怎么样?如果你使用的是蚂蚁,你需要知道定义东西的属性。 – laune
我问的原因是因为当我将类添加到路径时,我得到了这个错误。 C:\ Users \ John \ workspacetools \ build.xml:65:RuleBaseTask失败:C:\ Users \ John \ workspace \ build(访问被拒绝) – logger