Drools + Hibernate如何用对象术语编写规则

时间:2019-09-05 19:18:18

标签: hibernate drools

嗨,我有使用休眠会话的该drl规则:-

 rule 
    email optout action 1" salience 200
      when
       $ot: OTOptPref(dntEmail == true, srcSystem=="CIS")
       $st: STOptPref() from hibernateSession.createQuery("from STOptPref p where p.emailId=:emailId ").setString("emailId",$ot.emailId).list()
       then
        $ot.setLogMessage("Data originated from CIS,no changes applied");
        System.out.println(" 1 The game "+$ot.getLogMessage());
      end

需要有关如何以对象形式编写它的帮助,仅避免查询?尝试这样的事情不起作用:

 rule "email optout action 1" salience 200
      when
       $ot: OTOptPref()
       $st: STOptPref( $ot.isDntEmail() == true,emailId == $ot.getEmailId())    
      then
         $ot.setLogMessage("Data originated from CIS,no changes applied");
         System.out.println(" 1 The game "+$ot.getLogMessage());
      end

0 个答案:

没有答案