Bug 727784

Summary: Unable to construct expressions containing 'from' using Rules API
Product: [JBoss] JBoss Enterprise BRMS Platform 5 Reporter: Tomas Schlosser <tschloss>
Component: BRE (Expert, Fusion)Assignee: Nobody <nobody>
Status: CLOSED UPSTREAM QA Contact:
Severity: high Docs Contact:
Priority: medium    
Version: BRMS 5.2.0-ER1   
Target Milestone: ---   
Target Release: BRMS 5.3.0.GA   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Previously, an error prevented rules using the API from including 'from' in the Rule. This has been resolved by changing a line of code in drools/drools-compiler/src/main/java/org/drools/lang/api/PatternDescrBuilder.java:</para> <para> From: </para> <screen> public SourceDescrBuilder&lt;?&gt; from(); </screen> <para> To: </para> <screen>public SourceDescrBuilder&lt;PatternDescrBuilder&lt;P&gt;&gt; from();</screen> <para>
Story Points: ---
Clone Of: Environment:
Last Closed: 2025-02-10 03:14:06 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:
Embargoed:

Description Tomas Schlosser 2011-08-03 08:48:26 UTC
Description of problem:
When trying to construct a new rule containing 'from' I can't continue constructing the rule due to error:
"The method rhs(String) is undefined for the type capture#3-of ?"

How reproducible:
KnowledgeDescr descr =
    DescrFactory.newPackage().name("org.jboss.qa.drools.rulesapi")

    .newDeclare().type("String")
    .newAnnotation("role").value("event").end()
    .end()

    .newRule().name("from rule")
    .lhs()
    .pattern("String").id("s", false).from().entryPoint("EventStream").end()
    .end()
    .rhs("System.out.println(")

    .end().getDescr();


Additional info:
The end() after pattern doesn't help (neither removing, nor adding more)

Comment 1 Tomas Schlosser 2011-08-04 07:54:06 UTC
Just a little change is required:
drools/drools-compiler/src/main/java/org/drools/lang/api/PatternDescrBuilder.java

change:
45:    public SourceDescrBuilder<?> from();

to:
45:    public SourceDescrBuilder<PatternDescrBuilder<P>> from();

Comment 2 JBoss JIRA Server 2012-01-19 22:06:44 UTC
Edson Tirelli <ed.tirelli> updated the status of jira JBRULES-3354 to Resolved

Comment 3 JBoss JIRA Server 2012-01-19 22:06:44 UTC
Edson Tirelli <ed.tirelli> made a comment on jira JBRULES-3354

Done.

Comment 4 JBoss JIRA Server 2012-01-19 22:06:51 UTC
Edson Tirelli <ed.tirelli> updated the status of jira JBRULES-3354 to Closed

Comment 5 Edson Tirelli 2012-01-19 22:07:17 UTC
Fixed. Thanks.

Comment 7 Tomas Schlosser 2012-01-30 14:27:09 UTC
It is fixed now. Thank you Edson

Comment 8 lcarlon 2012-05-03 02:56:18 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:
Previously, an error prevented rules using the API, from including 'from' in the Rule.

Comment 9 lcarlon 2012-05-30 05:33:51 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,12 @@
-Previously, an error prevented rules using the API, from including 'from' in the Rule.+Previously, an error prevented rules using the API from including 'from' in the Rule. This has been resolved by changing a line of code in drools/drools-compiler/src/main/java/org/drools/lang/api/PatternDescrBuilder.java:</para>
+<para>
+From:
+</para>
+<screen>
+public SourceDescrBuilder<?> from();
+</screen>
+<para>
+To:
+</para>
+<screen>public SourceDescrBuilder<PatternDescrBuilder<P>> from();</screen>
+<para>

Comment 10 lcarlon 2012-06-15 00:02:39 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:
@@ -3,7 +3,7 @@
 From:
 </para>
 <screen>
-public SourceDescrBuilder<?> from();
+public SourceDescrBuilder&lt;?&gt; from();
 </screen>
 <para>
 To:

Comment 11 lcarlon 2012-06-15 00:08:35 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:
@@ -8,5 +8,5 @@
 <para>
 To:
 </para>
-<screen>public SourceDescrBuilder<PatternDescrBuilder<P>> from();</screen>
+<screen>public SourceDescrBuilder&lt;PatternDescrBuilder&lt;P&gt;&gt; from();</screen>
 <para>

Comment 17 Red Hat Bugzilla 2025-02-10 03:14:06 UTC
This product has been discontinued or is no longer tracked in Red Hat Bugzilla.