Business Central throws validation error with "$" while using enumeration in Guided Rule Editor
Issue
- Let's say an enumeration is defined in a class in the following fashion. It has been archived in a Jar and the Jar is uploaded into Business Central's
Artifact repositorylocation , so that it is available in order to draft a rule inGuided Rule Editor.
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 enumeration 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 ....}]
- What is the root cause of this issue and how to fix it?
Environment
- Red Hat JBoss BRMS (BRMS)
- 6.0.0 Beta
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.
Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.
