Help Desk Ticket Reference: https://c.na7.visual.force.com/apex/Case_View?id=500A00000078xLk&sfdc.override=1 Steps to Reproduce: Run the project attached with BRMS 5.1 runtime Workaround Description: - Define as system property drools.dialect.mvel.strict=false securitylevel_name: Public Unable to build expression for 'from' if used generic types on collections. The exception (below) is fired: "Unable to build expression for 'from' : sun.reflect.generics.reflectiveObjects.ParameterizedTypeImpl cannot be cast to java.lang.Class 'input.payrollComponentsForNiLetter.entrySet' : [Rule name='Basic Pay for NI aggregation'] java.lang.IllegalArgumentException: Could not parse knowledge. at com.sample.DroolsTest.readKnowledgeBase(DroolsTest.java:68) at com.sample.DroolsTest.main(DroolsTest.java:31)" The attached project demonstrates the error. The same is working on Drools 5.1.1 community
Adding drools-clips.jar (like made in drools-5.1.1 community)into classpath it works.
Additional note: I don't know why, but putting drools-clips above drools-compiler in classpath order, the project uses drools-clips and work fine, but if you put drools-compiler above drools-clips in classpath order, you have the exception
The only thing I can think of why drools-clips would make any difference here is that it brings in a different version of mvel with it that gets loaded before the one in the classpath already. Can you please verify?
No, there is not a differente mvel version. I see the problem, drools-clips sets in classpath: "drools.dialect.mvel.strict = false" (look the MANIFEST/drools.default.packagebuilder.conf on drools-clips.jar) Adding drools.dialect.mvel.strict = false as system properties the sample attached works without drools-clips.jar in classpath. I think it would be better if it working out-of-box(strict false by default?)
we want to enforce static typing (because it equals less errors) as such having drools.dialect.mvel.strict set to true by default is the correct way to go.
Workaround Description: Removed: Remove the generic types Added: - Define as system property drools.dialect.mvel.strict=false
ok, for now I updated the workaround to "Define as system property drools.dialect.mvel.strict=false"
Don't think there are any code changes necessary for this Jira. I do see a need to document this, so if you want please change it to a documentation Jira, assign to Darrin Mison with description of what should be added to docs for BRMS 5.2 (let me know if you need help with that). Otherwise I think this can be closed.
Tiho, Please provide contents and then hand over to Lee C. for doc.
GSS prioritizes this 'medium'. Customer is slow to respond, it's an old case.
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: Building expressions for 'from' does not working when using generic types with collections. The workaround is to define as system property drools.dialect.mvel.strict=false". This issue will be resolved in a future release.
Technical note updated. If any revisions are required, please edit the "Technical Notes" field accordingly. All revisions will be proofread by the Engineering Content Services team. Diffed Contents: @@ -1 +1 @@ -Building expressions for 'from' does not working when using generic types with collections. The workaround is to define as system property drools.dialect.mvel.strict=false". This issue will be resolved in a future release.+Building expressions for 'from' does not working when using generic types with collections. The workaround is to define as system property drools.dialect.mvel.strict=false".
Technical note updated. If any revisions are required, please edit the "Technical Notes" field accordingly. All revisions will be proofread by the Engineering Content Services team. Diffed Contents: @@ -1 +1 @@ -Building expressions for 'from' does not working when using generic types with collections. The workaround is to define as system property drools.dialect.mvel.strict=false".+Building expressions for 'from' does not working when using generic types with collections. The workaround is to define a system property drools.dialect.mvel.strict=false".
Technical note updated. If any revisions are required, please edit the "Technical Notes" field accordingly. All revisions will be proofread by the Engineering Content Services team. Diffed Contents: @@ -1 +1 @@ -Building expressions for 'from' does not working when using generic types with collections. The workaround is to define a system property drools.dialect.mvel.strict=false".+Building expressions for 'from' does not work when using generic types with collections. The workaround is to define a system property drools.dialect.mvel.strict=false".
Technical note updated. If any revisions are required, please edit the "Technical Notes" field accordingly. All revisions will be proofread by the Engineering Content Services team. Diffed Contents: @@ -1 +1 @@ -Building expressions for 'from' does not work when using generic types with collections. The workaround is to define a system property drools.dialect.mvel.strict=false".+Building expressions for 'from' did not work when using generic types with collections in BRMS 5.2.0. This issue is not present in BRMS 5.3.0.
This product has been discontinued or is no longer tracked in Red Hat Bugzilla.