Help Desk Ticket Reference: https://c.na7.visual.force.com/apex/Case_View?id=500A0000007BKuR&sfdc.override=1 securitylevel_name: Public Compilation of rules should fail when is not used quotes in a String attribute It is mandatory that Strings are placed between quotes. Guvnor/BRMS or DRL's plain text should fail if you forgot the quotes but currently it just fails the build if you put a value different of numerics: f : Fact( stringAttribute == ab ) It will fail. The same must occur for: f : Fact( stringAttribute == 12 ) ... but it does not happen and the rule is never matched. It is very important keep the same behaviour for both cases. The rule's author needs to know about it before the package is built.
Link: Added: This issue relates to JBRULES-3080
Customer ticket for this BZ is still open. High Priority is justified.
Please set the help desk ticket reference in the correct field in BZ using the SalesForce functionality. Thanks!
Hi, we don't have a "Target Release" yet. When is it supposed to be fixed?
There is some confusion going on here. When a constraint uses operations between different types of data, the engine will try to coerce them into compatible types. So in the state example: f : Fact( stringAttribute == 12 ) The engine identifies the incompatible (but valid) types, and try to coerce the constant 12 (number) into a compatible type to compare to the attribute. So, the engine automatically converts 12 into "12" and then compare to the string attribute. This is the expected behavior. On the other example though: f : Fact( stringAttribute == ab ) Unless ab is a previously declared variable, it is not a valid type, so a compilation error is raised and no coercion is attempted. This is not a bug.
"So,the engine automatically converts 12 into "12"" - yes Edson, it is the point. It does not convert 12 to "12" (maybe it is converting to some char code). So the rule: f : Fact( stringAttribute == 12 ) ... never is fired if the fact has the property as really "12"
Sorry Alessandro, I misunderstood the description of the problem. Indeed I just tested 5.3.x and it is not firing the rule, so it is a bug. Asking Mario to take a look.
Mario Fusco <mario.fusco> updated the status of jira JBRULES-3080 to Resolved
I just fixed it on the 5.3.x. It was already fixed (as a side effect of a new feature) on the master.
Update status to ON_QA. Please verify them against ER6.
This issue is fixed in ER, thank you.
Technical note added. If any revisions are required, please edit the "Technical Notes" field accordingly. All revisions will be proofread by the Engineering Content Services team. New Contents: Compilation of rules should fail when quotes are not used for string attributes. This did not happen when numerical values were used as string attributes without quotes, and the rules using numerical values were never matched.
This product has been discontinued or is no longer tracked in Red Hat Bugzilla.