[JBoss JIRA] Created: (JBRULES-1588) collect fails when using treeset
by pchar (JIRA)
collect fails when using treeset
--------------------------------
Key: JBRULES-1588
URL: http://jira.jboss.com/jira/browse/JBRULES-1588
Project: JBoss Drools
Issue Type: Bug
Security Level: Public (Everyone can see)
Affects Versions: 4.0.6
Reporter: pchar
Assigned To: Mark Proctor
Hi All,
i've a simple rules that retract objects form the WM
rule "Retract From TreeSet"
when
$tree: TreeSet() from collect (Message() )
then
System.out.println($tree.first());
retract($tree.first());
end
after the firts run the following exception is thrown
org.drools.FactException: Retract error: handle not found for object: [Hello World]. Is it in the working memory?
[Hello World]
at org.drools.base.DefaultKnowledgeHelper.retract(DefaultKnowledgeHelper.java:120)
at com.sample.Rule_Retract_From_TreeSet_0.consequence(Rule_Retract_From_TreeSet_0.java:9)
at com.sample.Rule_Retract_From_TreeSet_0ConsequenceInvoker.evaluate(Rule_Retract_From_TreeSet_0ConsequenceInvoker.java:22)
at org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:550)
at org.drools.common.DefaultAgenda.fireNextItem(DefaultAgenda.java:514)
at org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:471)
at org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:433)
at com.sample.DroolsTest.main(DroolsTest.java:36)
org.drools.spi.ConsequenceException: org.drools.FactException: Retract error: handle not found for object: [Hello World]. Is it in the working memory?
at org.drools.base.DefaultConsequenceExceptionHandler.handleException(DefaultConsequenceExceptionHandler.java:14)
at org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:554)
at org.drools.common.DefaultAgenda.fireNextItem(DefaultAgenda.java:514)
at org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:471)
at org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:433)
at com.sample.DroolsTest.main(DroolsTest.java:36)
Caused by: org.drools.FactException: Retract error: handle not found for object: [Hello World]. Is it in the working memory?
at org.drools.base.DefaultKnowledgeHelper.retract(DefaultKnowledgeHelper.java:120)
at com.sample.Rule_Retract_From_TreeSet_0.consequence(Rule_Retract_From_TreeSet_0.java:9)
at com.sample.Rule_Retract_From_TreeSet_0ConsequenceInvoker.evaluate(Rule_Retract_From_TreeSet_0ConsequenceInvoker.java:22)
at org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:550)
... 4 more
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
17 years, 7 months
[JBoss JIRA] Created: (JBRULES-1578) Guided rules report error due to incorrect quotes around rule attribute values
by Shahad Ahmed (JIRA)
Guided rules report error due to incorrect quotes around rule attribute values
------------------------------------------------------------------------------
Key: JBRULES-1578
URL: http://jira.jboss.com/jira/browse/JBRULES-1578
Project: JBoss Drools
Issue Type: Bug
Security Level: Public (Everyone can see)
Components: drools-brms, Eclipse IDE
Affects Versions: 4.0.4, 4.0.3
Environment: Windows XP SP2, Sun JRE 1.5.0_13
Reporter: Shahad Ahmed
Assigned To: Mark Proctor
In version 4.0.4, when using the guided editor in the eclipse plug-in or in the BRMS, if you set any of the rule attributes Duration, Enabled, Auto-focus, or Lock-on-active in a rule, then an error is reported when you save the rule in eclipse, or validate the rule in the BRMS.
The problem can be illustrated by the following rule created in the guided editor:
WHEN
Integer [p]
+ intValue [is equal to][20]
THEN
Retract[p]
OPTIONS
Lock-on-active [x]
Setting the attribute lock-on-active results in the following error in eclipse, or when validating the rule or building the rule package in the BRMS:
Format Name Message
brl test2 unknown:2:12 mismatched token: [@6,25:30='"true"',<20>,2:12]; expecting type THEN
The problem appears to be due to drools incorrectly adding quotes around some of the rule attribute values in the translated drl version of guided rules. For example, the corresponding drl for the rule above in the "Generated DRL" tab of the eclipse guided rule editor is incorrect as the lock-on-active attribute value true is in quotes (i.e. "true"):
rule "test"
auto-focus "true"
dialect "mvel"
when
p : Integer( intValue == "10" )
then
retract( p );
end
It appears that for the enabled, auto-focus and lock-on-active attributes the Boolean value of the argument is always incorrectly quoted in the generated DRL, and for Duration the integer value is also quoted in the generated DRL. Similarly in the BRMS guided editor, when you choose to view a rule or package source the attributes are quoted and the package will not build in the BRMS, giving an error similar to the error above.
Note that although the eclipse plug-in reports an error, the generated .brl and .package files are read and built by a PackageBuilder without an error. However, the problem is more severe in the BRMS as the rule package will not build and always gives the error shown earlier.
Looking at the source code, the problem may be in the toString() method of the following class in the drools-compiler project:
drools-compiler\src\main\java\org\drools\brms\client\modeldriven\brl\RuleAttribute.java
In 4.0.4, the toString method only ensures the no-loop and salience attribute values are not quoted, but always quotes values of attributes Duration, Enabled, Auto-focus, or Lock-on-active. I can see that this problem has been partially fixed in the trunk now as the toString method now ensures the Enabled attribute is not quoted, but I believe it still fails to ensure that the Duration, auto-focus and lock-on-active attributes values are not quoted. I fixed the problem in my own build by modifying the toString method as follows:
public String toString() {
StringBuffer ret = new StringBuffer();
ret.append( this.attributeName );
if ( NOLOOP.equals( attributeName ) )
{
ret.append( " " );
ret.append( this.value == null ? "true" : this.value );
}
else if (SALIENCE.equals( this.attributeName ) ||
DURATION.equals( this.attributeName ))
{
ret.append( " " );
ret.append( this.value );
}
else if (ENABLED.equals( this.attributeName ) ||
AUTO_FOCUS.equals( this.attributeName ) ||
LOCK_ON_ACTIVE.equals( this.attributeName ))
{
ret.append( " " );
ret.append( this.value.equals("true") ? "true" : "false" );
}
else if ( this.value != null ) {
ret.append( " \"" );
ret.append( this.value );
ret.append( "\"" );
}
return ret.toString();
}
Regards
Shahad
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
17 years, 7 months
[JBoss JIRA] Created: (JBRULES-1575) Guided editor missing "and less than (or equal to)" option in drop-down list
by Shahad Ahmed (JIRA)
Guided editor missing "and less than (or equal to)" option in drop-down list
----------------------------------------------------------------------------
Key: JBRULES-1575
URL: http://jira.jboss.com/jira/browse/JBRULES-1575
Project: JBoss Drools
Issue Type: Bug
Security Level: Public (Everyone can see)
Components: drools-brms
Affects Versions: 4.0.4
Environment: Windows XP SP2, Sun JRE 1.5.0_14
Reporter: Shahad Ahmed
Assigned To: Mark Proctor
I think there's a missing logical "and less than (or equal to)" connective in one of the drop-down lists in the guided editor in the eclipse plug-in and BRMS in version 4.0.4. The problem can be seen when trying to formulate the following constraint on an Integer object in the guided editor - the square brackets on lines 3 and 4 below represent drop-down lists and text boxes.
1. WHEN
2. Integer
3. + intValue [is greater than ] [10]
4. [and less than (or equal to)] [20]
The problem is that the drop-down list that contains the list of logical connective in line 4 above, does not contains the "and less than (or equal to)" option, but instead has two occurrences of "or less than (or equal to)".
Looking at the source code, it appears there is a typo in the following file in the drools-jbrms project:
drools-jbrms\src\main\java\org\drools\brms\client\modeldriven\HumanReadable.java
In the class static initializer, I think you have to change the line with condition "&& <=" to:
operatorDisplayMap.put( "&& <=", "and less than (or equal to)" );
Regards
Shahad
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
17 years, 7 months
[JBoss JIRA] Created: (JBRULES-1576) Cannot download model assets from BRMS using Internet Explorer 7
by Shahad Ahmed (JIRA)
Cannot download model assets from BRMS using Internet Explorer 7
----------------------------------------------------------------
Key: JBRULES-1576
URL: http://jira.jboss.com/jira/browse/JBRULES-1576
Project: JBoss Drools
Issue Type: Bug
Security Level: Public (Everyone can see)
Components: drools-brms
Affects Versions: 4.0.4
Environment: Windows XP SP2, Sun JRE 1.5.0_13
Reporter: Shahad Ahmed
Assigned To: Mark Proctor
I cannot download model or decision table (i.e. spreadsheet) assets from the BRMS when using Microsoft Internet Explorer 7 (IE7). However, the same assets can be downloaded using Mozilla Firefox 2.0.
I uploaded and saved a jar file as a model asset into the defaultPackage that is created when you first start the BRMS. However, when I attempt to download the model from the BRMS using the Download button on the model asset page nothing happens, although an error icon appears at the bottom left of the IE7 browser window. When you double-click on the error icon it reports the following javascript error:
Line: 223
Char: 25
Error: Invalid Argument
Code: 0
http://localhost:8080/drools-jbrms/org.drools.brma.JBRMS/ E852FBEB98D9E331BF1DBDCE27A5C06F.cache.html
I get the same error when trying to download decision tables that I've previously uploaded.
Looking at the source code, I think I've found the problem, although it not really a bug in the code, but probably IE7 itself. The issues is in the following class in the drools-jbrms project:
drools-jbrms\src\main\java\org\drools\brms\client\packages\AssetAttachmentFileWidget.java
Look at the initWidgets method and then find the following onClick in the anonymous inner class ClickListner:
dl.addClickListener( new ClickListener() {
public void onClick(Widget w) {
Window.open( GWT.getModuleBaseURL() + "asset?" + HTMLFileManagerFields.FORM_FIELD_UUID + "=" + uuid,
"downloading...", "resizable=no,scrollbars=yes,status=no" );
It appears the three dots in the message "downloading..." cause a problem for IE7. If you remove the "..." everything works fine in IE7 and Firefox. I verified this by changing the above code to:
dl.addClickListener( new ClickListener() {
public void onClick(Widget w) {
Window.open( GWT.getModuleBaseURL() + "asset?" + HTMLFileManagerFields.FORM_FIELD_UUID + "=" + uuid,
"downloading", "resizable=no,scrollbars=yes,status=no" );
I'm afraid I haven't investigating why the dots are in issue in IE7, but I know it doesn't like spaces in pop-up window names, and I'm guessing dots aren't supported either.
Regards
Shahad
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
17 years, 7 months
[JBoss JIRA] Created: (JBRULES-1580) BRMS ruleflow upload page incorrectly states that .rf files should be uploaded
by Shahad Ahmed (JIRA)
BRMS ruleflow upload page incorrectly states that .rf files should be uploaded
------------------------------------------------------------------------------
Key: JBRULES-1580
URL: http://jira.jboss.com/jira/browse/JBRULES-1580
Project: JBoss Drools
Issue Type: Bug
Security Level: Public (Everyone can see)
Components: drools-brms, Manual
Affects Versions: 4.0.4
Environment: n/a
Reporter: Shahad Ahmed
Assigned To: Mark Proctor
In a BRMS 4.0.4 ruleflow asset upload page, I think the description at the bottom of the page incorrectly says to upload .rf files when it should in fact be .rfm files:
"Ruleflows allow flow control between rules. The eclipse plugin provides a graphical editor. Upload ruleflow .rf files for inclusion in this package."
There is a similar typo in the drools manual section 6.8.4 paragraph 2:
"Alternatively, you can upload the .rf file to the BRMS (as a ruleflow asset) and it will automatically be included in packages that are deployed from it."
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
17 years, 7 months