Red Hat Bugzilla – Bug 995018
Compiler failure when dialect is not specified in DRL
Last modified: 2014-08-06 16:19:27 EDT
Description of problem:
Saving this rule in workbench:
rule 'Dummy rule'
a : Applicant()
triggers incremental build, which results with following error:
13:47:12,285 ERROR [org.drools.compiler.kie.builder.impl.AbstractKieModule] (pool-15-thread-4) Unable to build KieBaseModel:defaultKieBase
Rule Compilation error : [Rule name='Dummy rule']
defaultpkg/Rule_Dummy_rule307182425.java (6:243) : Applicant cannot be resolved to a type
If you uncomment dialect option and save the rule the build will succeed. If you remove content of RHS the build will succeed too.
What about the error message? It doesn't help at all. Could that be improved?
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. open Dummy rule in mortgages project
2. replace the content with rule in Description
3. save the rule and wait until incremental build finishes
Applicant cannot be resolved to a type
No error or better explanation if the rule is really invalid.
Mario, lets talk about this one and try to solve it ourselves, asking Michael if we need any guidance.
If a class has no package, it can't be imported.
On data modeler, we just have to force all classes to have a package. It's no longer possible to define a POJO in the default package.
The mortgate example in the uf-playground repo needs to be updated with this as well.
I just enforced this constraint on the KieBuilder
Now if you try to compile a java class with no package declaration it will raise a compilation error.
Data modeler objects creation was modified in order to prevent the creation of data objects without package.
master branch: http://github.com/droolsjbpm/kie-wb-common/commit/569c667bb
6.0.x branch: http://github.com/droolsjbpm/kie-wb-common/commit/1ced2efe7
Fixed in ER4.