Hi Guillaume,

It's not a *packaging problem*, my dbhelper objetct is in the classpath, so in the drl file i'm
able to view it.

The problem is that if i use the technique you describe ( to put the dbhelper object ) in drools
global entry i'm not able to write rules like:

rule "Rule1"
   when
       me : Exchange( status == Exchange.ACTIVE, in : in != null );
       db : DbHelper ( );
eval( db.exist( in.valueOf("/ACTION/@name"), "STRING", "attribute", "name", "metadb" ) );
   then
       jbi.fault( "<ERROR> The value is already present in db </ERROR>" );
   end

The only think i need is to use the dbhelper object in Left part of the rule, and this seems to work very well if the dbhelper object is asserted in memory, on the other side i'm not sure this is possible if the object is in *global* area of working memory.

I've just tried to have my helper as you describe, but i'm not able to write a drools rule that use it in left side part.

BTW could you pust a full xbean.xml for the example so i could see also the namespace declaration for that part:

<util:map id="globals">
 <entry key="helper" value-ref="helper" />
</util:map>


BTW my diff are already here:

https://issues.apache.org/activemq/browse/SM-888

but it seem that were not accepted.

Andrea



Guillaume Nodet ha scritto:
Have you tried embedding your specific DbHelper in your SU instead of
repackaging the component ? It may prove easier.

Anyway, what does 1 lead to ? Did you had to change the DbHelper for that ?
Maybe you can post a diff so that we can review and discuss it ?

On Fri, Feb 22, 2008 at 11:52 AM, Andrea Zoppello <[EMAIL PROTECTED]> wrote:
Hi all,

 Actually i'm using a customized version of servicemix-drools for the
 following reasons:

 1) I need to use db helper objects both in LHS, and in RHS of my drl files.

 2) I need to specify a defaultTargetService URI if no rule would be true.

 At the moment i'm trying to apply the approach described here, to see if
 it could feet my needs:

  http://gnodet.blogspot.com/2007/06/accessing-databases-in-servicemix.html

 but i found some problems:

 1) the syntax described seems to be not correct, i don't know which is
 the right value for
 util namespace used.

 2) With this approach Drools Db helper cannot be used on the LHS side of
 the rules.

 Any idea??
 Until i don't resolve this i'm forced to mantain my own version that
 simple assert a db helper
 object in the working memory..

 Andrea





Reply via email to