| Summary: | Problems in the use of escapes in the "matches" operator | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [JBoss] JBoss Enterprise BRMS Platform 5 | Reporter: | Alessandro Lazarotti <alazarot> | ||||
| Component: | BRE (Expert, Fusion) | Assignee: | Tihomir Surdilovic <tsurdilo> | ||||
| Status: | CLOSED NEXTRELEASE | QA Contact: | |||||
| Severity: | unspecified | Docs Contact: | |||||
| Priority: | high | ||||||
| Version: | 5.0.2 | CC: | jkrupka | ||||
| Target Milestone: | --- | ||||||
| Target Release: | 5.1.0 GA | ||||||
| Hardware: | Unspecified | ||||||
| OS: | Unspecified | ||||||
| URL: | http://jira.jboss.org/jira/browse/BRMS-412 | ||||||
| Whiteboard: | |||||||
| Fixed In Version: | Doc Type: | Bug Fix | |||||
| Doc Text: | Story Points: | --- | |||||
| Clone Of: | Environment: |
JBoss Enterprise BRMS Platform 5.0.2, JDK 1.6 (sun/oracle)
|
|||||
| Last Closed: | 2010-11-23 08:22:45 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: | |||||
| Attachments: |
|
||||||
|
Description
Alessandro Lazarotti
2010-10-21 17:03:25 UTC
drools-simple-regex.zip is a sample project to simulate that. Attachment: Added: drools-simple-regex.zip Link: Added: This issue is a dependency of JBRULES-2745 With this change, using complex types or simple types by default you still have to escape the matching pattern, for example:
when
$task : BinTask( $bn : bin.name matches "\\w\\w\\d{3}\\w\\w" )
$bin : Bin( $nm : name matches "\\w\\w\\d{3}\\w\\w" )
then
...
If you set the drools.parser.processStringEscapes option:
KnowledgeBuilderConfiguration kbconf = KnowledgeBuilderFactory.newKnowledgeBuilderConfiguration();
kbconf.setProperty("drools.parser.processStringEscapes", "false");
KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder(kbconf);
...
the matches patterns do not have to be escaped, and the patterns can be:
when
$task : BinTask( $bn : bin.name matches "\w\w\d{3}\w\w" )
$bin : Bin( $nm : name matches "\w\w\d{3}\w\w" )
then
...
Draft text for release notes states: https://jira.jboss.org/browse/BRMS-412 There was a problem with the use of escapes when using the "matches"operator. The drools.parser.processStringEscapesoption has been added. Use of this feature means that matched patterns do not have to be escaped. Writer: Added: dlesage Release Notes Docs Status: Added: Documented as Resolved Issue Release Notes Text: Added: test Release Notes Text: Removed: test Release Notes Text: Added: There was a problem with the use of escapes when using the "matches"operator. The drools.parser.processStringEscapesoption has been added. Use of this feature means that matched patterns do not have to be escaped. David, you have to set the drools.parser.processStringEscapes property to false in order for escapes not to be needed. |