[rules-users] Why this rule did't work?

zgbigman hsl9798 at 163.com
Mon Aug 31 05:01:37 EDT 2009


I'm trying to formulate a condition like: 

package com.sample

import org.hibernate.Session;
import com.sample.entity.TempEntity;

global java.util.List myGlobalList;


rule "Hello World"
	when 
		$hibernateSession : Session();
		$tmp1 :TempEntity($bin1 :bin) from $hibernateSession.createQuery("from
TempEntity").list()
		$tmp2 : TempEntity($bin2 : bin) from myGlobalList
		//eval($bin == ((TempEntity)(myGlobalList.get(0))).getBin())
		eval($bin1 == $bin2)
	then
		System.out.println("success");
end

I'm trying to find an Entity by bin from DB.
there is only one entity  in the "myGlobalList". NO complie error but it
shows the following:

log4j:WARN No appenders could be found for logger
(org.hibernate.cfg.Environment).
log4j:WARN Please initialize the log4j system properly.
Hibernate: 
    select
        tempentity0_.bin as bin0_,
        tempentity0_.bank_name as bank2_0_,
        tempentity0_.bank_id as bank3_0_,
        tempentity0_.card_name as card4_0_,
        tempentity0_.card_length as card5_0_,
        tempentity0_.card_type as card6_0_ 
    from
        bin tempentity0_

what should I do if i want this rule works?
-- 
View this message in context: http://www.nabble.com/Why-this-rule-did%27t-work--tp25218669p25218669.html
Sent from the drools - user mailing list archive at Nabble.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20090831/7bfeacc9/attachment.html 


More information about the rules-users mailing list