I am new to drools and tried searching the API doc but couldn't find anything about the comparison keyword 'LIKE'. I have successfully created rules with <, >, <=, >=, ==, != but now I am trying to create a rule using 'LIKE' keyword. I was told by the seniors that it should work like SQL like keyword. Below is my rule from the drl file but I am getting an error about mismatched input 'LIKE' in rule 5495Y
using drools 5.6.0
**From DRL File:**
rule "5495Y"
agenda-group "1"
date-effective "04-Sep-2017"
when
JournalEntry : JournalEntry( (ledgerCd=="COMN") && accountNumber LIKE 1234
&& entryTypeCode == "Y" );
DroolsUtil : DroolsUtil( );
then
JournalEntry.addConsequence("rejectReason","kk like test");
JournalEntry.addConsequence("sendToLedger","N");
DroolsUtil.reclassEntry(JournalEntry,"NOCHG", "5495Y");
end
**Exact Error I am getting:**
[38583,71]: [ERR 102] Line 38583:71 mismatched input 'LIKE' in rule "5495R"
[38596,71]: [ERR 102] Line 38596:71 mismatched input 'LIKE' in rule "5495Y"
[0,0]: Parser returned a null Package
11:09:17,118 ERROR main ReclassAccountingRuleJob:132 - java.lang.Exception: Know
ledgeBuilder has errors. DRL File parsing error
java.lang.Exception: KnowledgeBuilder has errors. DRL File parsing error