Bug 1035267

Summary: "Rule Template" Improve validation message when "template data" is not filled out
Product: [Retired] JBoss BRMS Platform 6 Reporter: Amana <ajuricic>
Component: Business CentralAssignee: manstis
Status: CLOSED CURRENTRELEASE QA Contact: Tomas David <tdavid>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.0.0   
Target Milestone: ER6   
Target Release: 6.0.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-08-06 20:18:00 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:

Description Amana 2013-11-27 12:16:58 UTC
There is the following set:

1) A rule template which uses a "$X" variable of type "Integer" in the THEN clause.
2) The $X variable has not been filled out in Template Data. So it is null/empty.
3) The following error is thrown by clicking on "Validate" button:
________________________________________________________
Unable to Analyse Expression ...; drools.insert(fact0);: [Error: unable to resolve method using strict-mode: org.drools.spi.KnowledgeHelper.$X_na()][Near:
{...}

] ^ [Line: 2, Column:26]
________________________________________________________

As soon as one row in the template data with the X populated with a int/Integer is entered, validation works properly.

If this is the expected behaviour by not populating a variable in template data, so that message should be changed since it is too generic. It should advise that "template data" or "variable X" is not populated.

Comment 2 manstis 2013-11-27 12:46:40 UTC
This is not a bug, but by design. 

We delegate validation of Rule Templates to drools-compiler, that returns the given messages. We could however improve validation of Rule Templates to check if any template variables are defined and no data present; in which case we could provide a more user-friendly message.

Comment 4 JBoss JIRA Server 2013-12-02 14:02:22 UTC
Michael Anstis <michael.anstis> updated the status of jira GUVNOR-2065 to Resolved

Comment 5 Tomas David 2014-01-16 14:02:26 UTC
Verified on BRMS 6.0.0.ER7.