Bug 995018 - Compiler failure when dialect is not specified in DRL
Compiler failure when dialect is not specified in DRL
Status: CLOSED CURRENTRELEASE
Product: JBoss BRMS Platform 6
Classification: JBoss
Component: Business Central (Show other bugs)
6.0.0
Unspecified Unspecified
unspecified Severity high
: ER4
: 6.0.0
Assigned To: Walter Medvedeo
Jiri Locker
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-08-08 08:13 EDT by Jiri Locker
Modified: 2014-08-06 16:19 EDT (History)
5 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2014-08-06 16:19:27 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Jiri Locker 2013-08-08 08:13:05 EDT
Description of problem:

Saving this rule in workbench:

rule 'Dummy rule'
//dialect 'mvel'
when
  a : Applicant()
then
  System.out.println(a);
end

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):
CR1 (community)

How reproducible:
always

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

Actual results:
Applicant cannot be resolved to a type

Expected results:
No error or better explanation if the rule is really invalid.

Additional info:
Comment 3 Edson Tirelli 2013-09-16 15:37:10 EDT
Mario, lets talk about this one and try to solve it ourselves, asking Michael if we need any guidance.
Comment 4 Pedro Zapata 2013-09-17 12:04:32 EDT
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.
Comment 5 Mario Fusco 2013-09-17 12:59:35 EDT
I just enforced this constraint on the KieBuilder 

https://github.com/droolsjbpm/drools/commit/b9ff47c815714d2c5b1840b8e9a4ccaf2a3d3e24

Now if you try to compile a java class with no package declaration it will raise a compilation error.
Comment 6 Walter Medvedeo 2013-09-17 17:45:45 EDT
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
Comment 11 Jiri Locker 2013-10-18 05:21:42 EDT
Fixed in ER4.

Note You need to log in before you can comment on or make changes to this bug.