Bug 724649 (BRMS-554)

Summary: Unable to create a test scenario for a rule that matches an empty string
Product: [JBoss] JBoss Enterprise BRMS Platform 5 Reporter: Alessandro Lazarotti <alazarot>
Component: BRM (Guvnor)Assignee: manstis
Status: VERIFIED --- QA Contact: Lukáš Petrovický <lpetrovi>
Severity: unspecified Docs Contact:
Priority: low    
Version: 5.1.0 GA, BRMS 5.1.1.ER1CC: atangrin, manstis, rwagner
Target Milestone: ---   
Target Release: BRMS 5.3.0.GA   
Hardware: Unspecified   
OS: Unspecified   
URL: http://jira.jboss.org/jira/browse/BRMS-554
Whiteboard:
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.
Story Points: ---
Clone Of: Environment:
JDK 1.6 sun/oracle, BRMS 5.2, Fedora 12, Firefox 3.5.6
Last Closed: Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Attachments:
Description Flags
Case_362267_Test.JPG none

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.