[jboss-jira] [JBoss JIRA] Updated: (JBRULES-2397) DroolsCompilerAntTask.java assumes all dsl files will be located in the srcDir

David Haskett (JIRA) jira-events at lists.jboss.org
Tue Jan 5 10:05:38 EST 2010


     [ https://jira.jboss.org/jira/browse/JBRULES-2397?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

David Haskett updated JBRULES-2397:
-----------------------------------

    Description: 
The drools-Ant task currently assumes that all *.dsl files will be located in the srcDir

Below, we use a combination of generated rules (using decision tables), and standard developer-written rules. 

When using rules resources from different locations, we need to specify the full path, relative to the srcDir.

e.g.

================================================

<property name="compile_classpath" refid="maven.compile.classpath" />
<property name="plugin_classpath" refid="maven.plugin.classpath" />

<path id="taskCp">
    <pathelement path="${compile_classpath}" />
</path>

<taskdef name="rulebase" classname="org.drools.contrib.DroolsCompilerAntTask" classpathref="taskCp" />

<rulebase tofile="${project.build.outputDirectory}/rules/provider.knowledge" binformat="knowledge" bintype="knowledge" srcdir="${basedir}/" 

classpathref="ruleBase.classpath">
    <include name="resources/application/rules/matching/provider.drl" />
    <include name="resources/application/rules/matching/provider.rf" />
    <include name="resources/application/rules/matching/providerAddress.dslr" /> 
    <include name="target/generated-resources/drools-maven-plugin/rules/matching/providerRule.drl" />
</rulebase>

================================================

The srcdir is a parent of each of the paths above. When the DroolsCompilerAntTask class sees the .dslr file, it looks for its correspondong dsl file, assuming it to be in the srcdir. This may not always be the case. In the case above, it prevents us from using a combination of  generated rules using decision tables, and dslr generated rules.

There does not seem to be a workaround for this.

A suggestion would be to have an extra parameter e.g. dsldir, which the DroolsCompilerAntTask class could use to determine the location of the dsl file?

Thank you.

  was:
The drools-Ant task currently assumes that all *.dsl files will be located in the srcDir

Below, we use a combination of generated rules (using decision tables), and standard developer-written rules. 

When using rules resources from different locations, we need to specify the full path, relative to the srcDir.

e.g.

{code}

<property name="compile_classpath" refid="maven.compile.classpath" />
<property name="plugin_classpath" refid="maven.plugin.classpath" />

<path id="taskCp">
    <pathelement path="${compile_classpath}" />
</path>

<taskdef name="rulebase" classname="org.drools.contrib.DroolsCompilerAntTask" classpathref="taskCp" />

<rulebase tofile="${project.build.outputDirectory}/rules/provider.knowledge" binformat="knowledge" bintype="knowledge" srcdir="${basedir}/" 

classpathref="ruleBase.classpath">
    <include name="resources/application/rules/matching/provider.drl" />
    <include name="resources/application/rules/matching/provider.rf" />
    <include name="resources/application/rules/matching/providerAddress.dslr" /> 
    <include name="target/generated-resources/drools-maven-plugin/rules/matching/providerRule.drl" />
</rulebase>

{code}

The srcdir is a parent of each of the paths above. When the DroolsCompilerAntTask class sees the .dslr file, it looks for its correspondong dsl file, assuming it to be in the srcdir. This may not always be the case. In the case above, it prevents us from using a combination of  generated rules using decision tables, and dslr generated rules.

There does not seem to be a workaround for this.

A suggestion would be to have an extra parameter e.g. dsldir, which the DroolsCompilerAntTask class could use to determine the location of the dsl file?

Thank you.



> DroolsCompilerAntTask.java assumes all dsl files will be located in the srcDir
> ------------------------------------------------------------------------------
>
>                 Key: JBRULES-2397
>                 URL: https://jira.jboss.org/jira/browse/JBRULES-2397
>             Project: Drools
>          Issue Type: Feature Request
>      Security Level: Public(Everyone can see) 
>            Reporter: David Haskett
>            Assignee: Mark Proctor
>
> The drools-Ant task currently assumes that all *.dsl files will be located in the srcDir
> Below, we use a combination of generated rules (using decision tables), and standard developer-written rules. 
> When using rules resources from different locations, we need to specify the full path, relative to the srcDir.
> e.g.
> ================================================
> <property name="compile_classpath" refid="maven.compile.classpath" />
> <property name="plugin_classpath" refid="maven.plugin.classpath" />
> <path id="taskCp">
>     <pathelement path="${compile_classpath}" />
> </path>
> <taskdef name="rulebase" classname="org.drools.contrib.DroolsCompilerAntTask" classpathref="taskCp" />
> <rulebase tofile="${project.build.outputDirectory}/rules/provider.knowledge" binformat="knowledge" bintype="knowledge" srcdir="${basedir}/" 
> classpathref="ruleBase.classpath">
>     <include name="resources/application/rules/matching/provider.drl" />
>     <include name="resources/application/rules/matching/provider.rf" />
>     <include name="resources/application/rules/matching/providerAddress.dslr" /> 
>     <include name="target/generated-resources/drools-maven-plugin/rules/matching/providerRule.drl" />
> </rulebase>
> ================================================
> The srcdir is a parent of each of the paths above. When the DroolsCompilerAntTask class sees the .dslr file, it looks for its correspondong dsl file, assuming it to be in the srcdir. This may not always be the case. In the case above, it prevents us from using a combination of  generated rules using decision tables, and dslr generated rules.
> There does not seem to be a workaround for this.
> A suggestion would be to have an extra parameter e.g. dsldir, which the DroolsCompilerAntTask class could use to determine the location of the dsl file?
> Thank you.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the jboss-jira mailing list