imperative logic is disable, it promotes bad rules, we don't plan to add it back in. We suggest you call a function that encapsulates this logic.

Mark
[EMAIL PROTECTED] wrote:
Hello,
I would like to conditionally attempt logging in the consequence of each rule 
but it does not like the 'if' statement.

Without the 'if', it works fine. It appears to work fine for the java dialect as well - only complains for MVEL dialect. It does not appear to be related to the logger instance because even "if (true)" causes similar Exception.
I also tried with and without the curly braces.


global org.apache.commons.logging.Log logger

rule Language
    dialect "mvel"
        salience 800
        when
        $pd : ParticipantDetails( $ptLanguage : 
participant.languagePreferenceCD  )
        $nd : NurseDetails( languages not contains $ptLanguage )        
        then    
if (logger.isDebugEnabled()) logger.debug("LanguageMismatch - ptId: " + $pd.participant.id + ", Lang: " + $ptLanguage + ", staffId: " + $nd.staffId ); [...] end



* (1,28) unable to resolve method using strict-mode: java.lang.Object.if(...)
Exception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'primaryNurseAssignmentService' defined in class path resource [...] nested exception is org.drools.rule.InvalidRulePackage: Unable to build expression for 'consequence' ' if (logger.isDebugEnabled()) logger.debug("LanguageMismatch - ptId: " + $pd.participant.id + ", Lang: " + $ptLanguage + ", staffId: " + $nd.staffId );


Should what I am attempting work?
Thanks,
Mark _______________________________________________
rules-users mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/rules-users


_______________________________________________
rules-users mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/rules-users

Reply via email to