package drools.rules.funnelid.two
import com.infusionsoft.bpm.services.TestRuleFact;
rule "Test Rule"
dialect "java"
when
$testRuleFact : TestRuleFact( ( contactable.contact.birthday < "29-Dec-1977" ) )
then
$testRuleFact.setTrue( );
end
package drools.rules.funnelid.two
import com.infusionsoft.bpm.services.TestRuleFact;
rule "Test Rule"
dialect "java"
when
$testRuleFact : TestRuleFact( ( contactable.contact.title str[equals] "Owner" && contactable.contact.birthday < "01-Jan-1980" ) || ( contactable.contact.country str[equals] "USA" && contactable.contact.leadSourceIdOverride == "12" ) )
then
$testRuleFact.setTrue( );
End
------------------------------------------
Here's the error I get:
DRL contains errors, no actions will be processed: Unable to Analyse Expression str0.evaluate( contactable.contact.title, "Owner" ) && contactable.contact.birthday < "01-Jan-1980" || str1.evaluate( contactable.contact.country, "USA" ) && contactable.contact.leadSourceIdOverride == "12":
[Error: Comparison operation requires compatible types. Found class java.util.Date and class java.lang.String]
[Near : {... ) && contactable.contact.leadSourceIdOverride == "12" ....}]
^
[Line: 8, Column: 32] : [Rule name='Test Rule']
Some things that cause the error to go away: