Bug 724196 (BRMS-139)

Summary: regexp in DSL not working
Product: [JBoss] JBoss Enterprise BRMS Platform 5 Reporter: Jaroslaw Kijanowski <kijanowski>
Component: BRM (Guvnor)Assignee: manstis
Status: VERIFIED --- QA Contact: Jiri Locker <jlocker>
Severity: medium Docs Contact:
Priority: high    
Version: 5.0.0 GACC: atangrin, manstis
Target Milestone: ---   
Target Release: BRMS 5.3.0.GA   
Hardware: Unspecified   
OS: Unspecified   
URL: http://jira.jboss.org/jira/browse/BRMS-139
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
When using the guided editor to enter a regular expression that included curly braces in a DSL sentence, the expression was incorrectly parsed with the first closing curly brace in the regular expression incorrectly recognized as the closing brace for the variable definition. The issue has been resolved and the curly braces used in regular expressions are recognized correctly.
Story Points: ---
Clone Of: Environment:
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:

Description Jaroslaw Kijanowski 2009-06-10 16:51:49 UTC
securitylevel_name: Public

Comment 1 Jaroslaw Kijanowski 2009-06-10 16:52:07 UTC
Link: Added: This issue depends GUVNOR-365


Comment 2 Anne-Louise Tangring 2011-09-13 17:47:23 UTC
The guvnor-365 is completed and will be in Drools 5.3.

Comment 3 manstis 2011-10-18 11:02:01 UTC
This was fixed for GUVNOR-365

Comment 4 Jiri Locker 2011-11-14 20:14:44 UTC
One more thing to be fixed -- displaying the sentence in the Condition (LHS) dialog in Guided editor. Consider this DSL entry:

> [when][]When a person exists with social security number {chooseSSN:\d{3}-\d{2}-\d{4}} = Person(ssn == "{chooseSSN}")

Label for this sentence looks as following:

> When a person exists with social security number chooseSSN-\d2-\d4

Obviously the first right brace '}' in the regex is incorrectly recongnized as a closing brace of the variable definition and the rest of the regex is displayed.

Comment 5 manstis 2011-11-22 21:43:13 UTC
OK, fixed and back-ported to 5.3.x branch. 

I did take the liberty of making the text appear as below, so DSL parameters are more clear (especially in DSL sentences with multiple parameters). Let me know if you want the braces removed - it seemed a good idea to me:-

> [when][]When a person exists with social security number {chooseSSN:\d{3}-\d{2}-\d{4}} who is {gender} = Person(ssn == "{chooseSSN}", gender == "{gender})

Label for this sentence looks as following:

> When a person exists with social security number {chooseSSN} who is {gender}

Comment 6 Jiri Locker 2011-12-16 15:49:32 UTC
Verified in BRMS 5.3.0.DEV6.

Comment 8 lcarlon 2012-05-31 05:35:45 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:
When using the guided editor to enter a regular expression that included curly braces in a DSL sentence, the expression was incorrectly parsed with the first closing curly brace in the regular expression was incorrectly recognized as the closing brace for the variable definition.

Comment 9 lcarlon 2012-05-31 05:37:12 UTC
    Technical note updated. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    Diffed Contents:
@@ -1 +1 @@
-When using the guided editor to enter a regular expression that included curly braces in a DSL sentence, the expression was incorrectly parsed with the first closing curly brace in the regular expression was incorrectly recognized as the closing brace for the variable definition.+When using the guided editor to enter a regular expression that included curly braces in a DSL sentence, the expression was incorrectly parsed with the first closing curly brace in the regular expression was incorrectly recognized as the closing brace for the variable definition. The issue has been resolved and the curly braces used in regular expressions are recognized correctly.

Comment 10 lcarlon 2012-06-15 00:55:12 UTC
    Technical note updated. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    Diffed Contents:
@@ -1 +1 @@
-When using the guided editor to enter a regular expression that included curly braces in a DSL sentence, the expression was incorrectly parsed with the first closing curly brace in the regular expression was incorrectly recognized as the closing brace for the variable definition. The issue has been resolved and the curly braces used in regular expressions are recognized correctly.+When using the guided editor to enter a regular expression that included curly braces in a DSL sentence, the expression was incorrectly parsed with the first closing curly brace in the regular expression incorrectly recognized as the closing brace for the variable definition. The issue has been resolved and the curly braces used in regular expressions are recognized correctly.