Bug 1053413

Summary: Business Central throws validation error with "$" while using enumeration in Guided Rule Editor
Product: [Retired] JBoss BRMS Platform 6 Reporter: Musharraf Hussain <mhussain>
Component: Business CentralAssignee: Toni Rikkola <trikkola>
Status: CLOSED DUPLICATE QA Contact: Lukáš Petrovický <lpetrovi>
Severity: high Docs Contact:
Priority: high    
Version: 6.0.0CC: etirelli, mbaluch, mhussain
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: All   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-01-16 13:48:11 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Musharraf Hussain 2014-01-15 08:27:04 UTC
Description of problem:
Let's say an enumeration is defined in a class in the following fashion:
~~~
public class EnumeratedFact {

     private EnumeratedFact.TestEnum enum;
     private String firstName;
     private String lastName;
...
     public enum TestEnum {
     ...

     }
...
~~~
Now, in order to use it to draft a rule through Guided Rule Editor while attempting to "Import" the enumeration in "Config" tab, the enumeration is displayed having the "$" sign in the class name instead of "." . Java uses "$" internally for inner classes, hence Business Central should use "." instead. Now, while writing the rule in form of a "Add free form drl" option, where the rule is written that uses the enurmeration having the name like "EnumeratedFact.TestEnum.XYZ" . As soon as the rule is saved and the Guided Rule Editor refreshes the rule , it converts the enumeration appearing in the form of having a "$" sign in it's class name, like "EnumeratedFact$TestEnum.XYZ". This causes a validation error for that rule in Business Central.
~~~
ERROR [org.drools.compiler.kie.builder.impl.AbstractKieModule] (pool-18-thread-3) Unable to build KieBaseModel:defaultKieBase
Unable to Analyse Expression 
...
[Error: unable to resolve method using strict-mode: org.drools.core.spi.KnowledgeHelper.EnumeratedFact$TestEnum()]
[Near : {... EnumeratedFact$TestEnum.XYZ ....}]
~~~

Unfortunately, there doesn't seem to exist any workaround for this issue, except of using DRL editors to write a rule with such an enumeration.

Version-Release number of selected component (if applicable):
- Red Hat JBoss BRMS 6.0.0 Beta

How reproducible:
- Follow the description above

Steps to Reproduce:
1. Follow the description above
2.
3.

Actual results:
- The enumeration appears having a "$" sign in the name

Expected results:
- The enumeration should appear with the naming convention like "EnumeratedFact.TestEnum"

Additional info:
-NA

Comment 5 Toni Rikkola 2014-01-16 13:48:11 UTC

*** This bug has been marked as a duplicate of bug 1047879 ***