Bug 724649 (BRMS-554) - Unable to create a test scenario for a rule that matches an empty string
Summary: Unable to create a test scenario for a rule that matches an empty string
Keywords:
Status: VERIFIED
Alias: BRMS-554
Product: JBoss Enterprise BRMS Platform 5
Classification: JBoss
Component: BRM (Guvnor)
Version: 5.1.0 GA,BRMS 5.1.1.ER1
Hardware: Unspecified
OS: Unspecified
low
unspecified
Target Milestone: ---
: BRMS 5.3.0.GA
Assignee: manstis
QA Contact: Lukáš Petrovický
URL: http://jira.jboss.org/jira/browse/BRM...
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-02-17 03:35 UTC by Alessandro Lazarotti
Modified: 2018-11-14 16:51 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
It was previously not possible to create a test scenario for a rule that matched an empty string. This has been resolved by ensuring the "empty" test scenario fact fields are initialized to an empty String instead of a null.
Clone Of:
Environment:
JDK 1.6 sun/oracle, BRMS 5.2, Fedora 12, Firefox 3.5.6
Last Closed:
Type: Bug


Attachments (Terms of Use)
Case_362267_Test.JPG (58.34 KB, image/jpeg)
2011-02-17 03:40 UTC, Alessandro Lazarotti
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker BRMS-554 0 Major Closed Unable to create a test scenario for a rule that matches an empty string 2012-11-15 18:06:33 UTC
Red Hat Issue Tracker GUVNOR-1195 0 Critical Resolved Test Scenarios: Unable to create a scenario for a rule that matches an empty string 2012-11-15 18:06:33 UTC

Description Alessandro Lazarotti 2011-02-17 03:35:30 UTC
Help Desk Ticket Reference: https://c.na7.visual.force.com/apex/Case_View?id=500A00000045DJH&sfdc.override=1
Steps to Reproduce: Create a package like:
package defaultPackage

declare INPUT
	DATA: String
end

declare OUTPUT
	STATUS: String
end


rule "Case_362267_Rule"
	dialect "mvel"
	when
		INPUT( DATA matches "^$" )
	then
		OUTPUT fact0 = new OUTPUT();
		fact0.setSTATUS( "OK" );
		insert(fact0 );
end

Create a test scenario like the attachment and try to run. 
securitylevel_name: Public

When a empty value is set in the text field of a given fact, the test scenario fails if you would like match a rule by a empty String in the fact.
For Guvnor, a empty text field is a NULL value, not a empty String value.

Comment 1 Alessandro Lazarotti 2011-02-17 03:40:01 UTC
Attachment: Added: Case_362267_Test.JPG


Comment 2 Alessandro Lazarotti 2011-02-17 03:46:10 UTC
Link: Added: This issue related GUVNOR-1195


Comment 3 Rick Wagner 2011-08-25 18:19:52 UTC
GSS prioritizes this 'low'.  Work around exists, no immediate need for customer.

Comment 6 manstis 2011-11-09 22:47:16 UTC
Fixed in master and back-ported to 5.3.x.

Comment 8 lcarlon 2012-05-30 06:11:03 UTC
Hi Michael,

for the release notes could you let me know how this issue was resolved?

We need to be able to let customers know about any changes in the code that could affect their systems.

Thanks
Lee

Comment 9 manstis 2012-05-30 10:26:42 UTC
Hi Lee,

The solution was to ensure "empty" Test Scenario Fact fields were initialized to an empty String instead of a null that was causing the problem. There remains a BZ (AFAIK) that was unfixed for 5.3 about being able to check for "an empty string" and "null" as two different "values".

With kind regards,

Mike

Comment 10 lcarlon 2012-05-31 00:28:51 UTC
Thanks Mike!

Comment 11 lcarlon 2012-05-31 00:32:58 UTC
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
It was previously not possible to create a test scenario for a rule that matched an empty string. This has been resolved by ensuring the "empty" test scenario fact fields are initialized to an empty String instead of a null.


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