[rules-dev] is there a way to get "declare"s out of the working memory?

strug strug at web.de
Sun Oct 18 06:30:45 EDT 2009


Hi Michael,


Michael Neale wrote:
> 
> So the fact referred in the query is a declared fact type which is in
> another DRL?
> 

Yes, my problem is with "try b" (see above) the declared type seems to be
not known. My drl files look like this:

calc_total_dri_amount.drl:

package platform.calculations;

declare TotalDriAmount
  amount : Money 
  person  : Person
end

rule "calc_total_dri_amount"
  when
    ..
  then
    TotalDriAmount totalDriAmount = new TotalDriAmount();
    totalDriAmount.setAmount(new Money(2000));
    totalDriAmount.setPerson(new Person("xx");
    insertLogical(totalDriAmount);
end

Next, I add a query into that knowledgebase with s.th. like:

import platform.calculations.*;
query "calc total dri amount"
  totalDriAmount : TotalDriAmount()
end

But this results in the error while building the knowledge base, i.e. before
even a single rule was fired:
Unable to resolve ObjectType 'TotalDriAmount' : [Rule name='calc total dri
amount'] 

Any help?

Thanks, Leif
-- 
View this message in context: http://www.nabble.com/is-there-a-way-to-get-%22declare%22s-out-of-the-working-memory--tp25933286p25945557.html
Sent from the drools - dev mailing list archive at Nabble.com.



More information about the rules-dev mailing list