[JBoss JIRA] Created: (JBRULES-1058) nested accessors with Sets - "not contains" is not a valid operator for MVEL
by Mark McNally (JIRA)
nested accessors with Sets - "not contains" is not a valid operator for MVEL
----------------------------------------------------------------------------
Key: JBRULES-1058
URL: http://jira.jboss.com/jira/browse/JBRULES-1058
Project: JBoss Rules
Issue Type: Bug
Security Level: Public (Everyone can see)
Components: Drl Parser/Builder
Affects Versions: 4.0.0.GA
Reporter: Mark McNally
Assigned To: Mark Proctor
Following does not work:
rule StateMatch
when
$ca:CandidateAssociation(nurseDetails.stateLicensures excludes patientDetails.state )
then
retract( $ca );
end
public class CandidateAssociation {
private PatientDetails patientDetails;
private NurseDetails nurseDetails;
private int overlapHours;
public CandidateAssociation( PatientDetails patientDetails, NurseDetails nurseDetails) {
super();
this.patientDetails = patientDetails;
this.nurseDetails = nurseDetails;
overlapHours = participantDetails.getNumberOverlapHourCnt(nurseDetails);
}
[...]
}
public class NurseDetails {
private Set stateLicensures = new HashSet();
[...]
}
public class PatientDetails {
private String state;
[...]
}
Edson suggested that the problem is that "not contains" is not a valid operator for MVEL.
Also Noticed that the following workaround did not work:
rule State
dialect "mvel"
when
$ca:CandidateAssociation( eval ( ! nurseDetails.stateLicensures.contains( patientDetails.state ) ) )
then
retract( $ca );
end
This produced this Exception:
org.drools.rule.InvalidRulePackage: Unable to determine the used declarations : [Rule name=State, agendaGroup=MAIN, salience=0, no-loop=false]
at org.drools.rule.Package.checkValidity(Package.java:408)
at org.drools.common.AbstractRuleBase.addPackage(AbstractRuleBase.java:288)
at [...]
--
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
18 years, 11 months
[JBoss JIRA] Created: (JBRULES-1047) class Cast Exception when using OR (||)
by Arjun Dhar (JIRA)
class Cast Exception when using OR (||)
---------------------------------------
Key: JBRULES-1047
URL: http://jira.jboss.com/jira/browse/JBRULES-1047
Project: JBoss Rules
Issue Type: Bug
Security Level: Public (Everyone can see)
Affects Versions: 4.0.0.GA
Environment: Windows, X86
Reporter: Arjun Dhar
Assigned To: Mark Proctor
Priority: Trivial
When I define a rule:
When
cntct:Contact (initialized==true)
exr:Relation( contact==cntct,
active:active==$1,
relationName=="Old")
Then
contact.getStatus().setStatus(true);
contact.getStatus().addToReasonTrace(drools.getRule().getName());
end
..The bove works.
BUT, when I do the following:
When
cntct:Contact (initialized==true)
exr:Relation( contact==cntct,
active:active==$1,
relationName=="Old")
|| Relation( contact==cntct,
active:active==$1,
relationName==null)
Then
contact.getStatus().setStatus(true);
contact.getStatus().addToReasonTrace(drools.getRule().getName());
end
... The script compiles anda stateless Session is created successfully,
but at
runtime/execution it fails with the exception:
java.lang.ClassCastException: com.arjun.brms.businessObjects.Contact
org.drools.rule.EvalCondition.isAllowed(EvalCondition.java:75)
org.drools.reteoo.EvalConditionNode.assertTuple (EvalConditionNode.java:141)
org.drools.reteoo.SingleTupleSinkAdapter.propagateAssertTuple
(SingleTupleSinkAdapter.java:20)
org.drools.reteoo.JoinNode.assertTuple(JoinNode.java:120)
org.drools.reteoo.SingleTupleSinkAdapter.propagateAssertTuple
(SingleTupleSinkAdapter.java:20)
org.drools.reteoo.JoinNode.assertObject(JoinNode.java:162)
org.drools.reteoo.CompositeObjectSinkAdapter.propagateAssertObject
(CompositeObjectSinkAdapter.java:317)
org.drools.reteoo.AlphaNode.assertObject (AlphaNode.java:130)
org.drools.reteoo.CompositeObjectSinkAdapter.propagateAssertObject
(CompositeObjectSinkAdapter.java:308)
org.drools.reteoo.AlphaNode.assertObject(AlphaNode.java:130)
org.drools.reteoo.CompositeObjectSinkAdapter.propagateAssertObject
(CompositeObjectSinkAdapter.java:308)
org.drools.reteoo.ObjectTypeNode.assertObject(ObjectTypeNode.java:168)
org.drools.reteoo.Rete.assertObject(Rete.java:168)
org.drools.reteoo.ReteooRuleBase.assertObject(ReteooRuleBase.java :190)
org.drools.reteoo.ReteooWorkingMemory.doInsert(ReteooWorkingMemory.java:70)
org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:848)
org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java :822)
org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:623)
Class diagram:
~~~~~~~~~~~~~~~~
Contact<-- bi-directional association -->List<Relation>
=============================================================================
Edson comments (Response) :
-----------------------------------------
It is a bug since a more friendly message should be raised at compile time stating that your "contact" declaration is not available in one of your logical branches.
Having said that, what you want to do is make your OR take priority over the implicit AND and as such, you need to add () around the OR:
When
contact:Contact (initialized==true)
exr: ( Relation( contact==cntct,
active:active==$1,
relationName=="Old")
or Relation( contact==cntct,
active:active==$1,
relationName==null) )
Then
contact.getStatus().setStatus(true);
contact.getStatus().addToReasonTrace(drools.getRule().getName());
end
Having said that, better yet for you would not to use the OR CE, but to use restriction connectives. This would be the most efficient (and clean) way of writing your rule:
When
contact:Contact (initialized==true)
exr: Relation( contact==cntct,
active:active==$1,
relationName =="Old" || == null )
Then
contact.getStatus().setStatus(true);
contact.getStatus().addToReasonTrace(drools.getRule().getName());
end
As a syntax sugar, you could also write:
exr: Relation( contact==cntct,
active:active==$1,
relationName in ( "Old", null ) )
Can you please open a JIRA with your test case for the bug?
Thank you,
Edson
-------------------
Note: The above suggestion worked, no runtime errors with 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
18 years, 11 months
[JBoss JIRA] Created: (JBADMCON-151) The web-console tree does not appear at all on firefox 2.0.0.5 using JRE jre1.6.0_02 libjavaplugin_oji.so plugin
by Frederic Hornain (JIRA)
The web-console tree does not appear at all on firefox 2.0.0.5 using JRE jre1.6.0_02 libjavaplugin_oji.so plugin
----------------------------------------------------------------------------------------------------------------
Key: JBADMCON-151
URL: http://jira.jboss.com/jira/browse/JBADMCON-151
Project: JBoss Admin Console
Issue Type: Bug
Environment: Server Side
Version
Version: 4.0.5GA(build: CVSTag=Branch_4_0 date=200610162340)
Version Name: Zion
Built on: October 16 2006
Environment
Start date: Wed Aug 22 09:13:47 CEST 2007
Host: Oops
Base Location: file:/jboss/jboss-portal-2.6/server/
Base Location (local): /jboss/jboss-portal-2.6/server
Running config: 'default
Hardware
#CPU: 1
OS: Linux 2.6.20-2925.9.fc7xen (i386)
JVM Environment
Free Memory: 49 MB
Max Memory: 506 MB
Total Memory: 126 MB
#Threads: 42
JVM Version: 1.6.0-b105 (Sun Microsystems Inc.)
JVM Name: Java HotSpot(TM) Server VM
Client Side
Hardware
#CPU: 1
OS: Linux 2.6.20-2925.9.fc7xen (i386)
Software
firefox 2.0.0.5
JVM Env
Sun JRE jre1.6.0_02
Reporter: Frederic Hornain
Priority: Minor
Hi,
Well, I have set the Java plugin on firefox as described below but I did not managed to see the web-console applets.
it is always a blank page on the left frame and the JBoss™ Application Server information on the right frame.
ln -s /usr/java/latest/plugin/i386/ns7/libjavaplugin_oji.so /home/user/.mozilla/plugins/libjavaplugin_oji.so
Thanks in advance for your help.
BR
Fred
--
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
18 years, 11 months
[JBoss JIRA] Created: (JBRULES-1083) Brackets are not always optional for non-existential quantifier "not"
by Markus Reitz (JIRA)
Brackets are not always optional for non-existential quantifier "not"
----------------------------------------------------------------------
Key: JBRULES-1083
URL: http://jira.jboss.com/jira/browse/JBRULES-1083
Project: JBoss Rules
Issue Type: Bug
Security Level: Public (Everyone can see)
Components: Drl Parser/Builder
Affects Versions: 4.0.0.GA
Reporter: Markus Reitz
Assigned To: Mark Proctor
Priority: Minor
According to the documentation, brackets are optional as illustrated by
Example 6.37. No Busses
not Bus()
In case of the rule (class SpecialString in http://jira.jboss.com/jira/browse/JBRULES-1079)
package test
rule "Brackets"
when
not exists(x : SpecialString() and
forall(y : SpecialString(this!=x)
SpecialString(this==y, text=="Universe")))
then
System.out.println("Condition satisfied");
end
this is not true. Trying to load this rule leads to
org.drools.rule.InvalidRulePackage: [8,8]: unknown:8:8 Unexpected token 'exists'
at org.drools.rule.Package.checkValidity(Package.java:408)
at org.drools.common.AbstractRuleBase.addPackage(AbstractRuleBase.java:288)
at DroolsTest.<init>(Unknown Source)
at DroolsTest.main(Unknown Source)
When brackets are added:
package test
rule "Brackets"
when
not(exists(x : SpecialString() and
forall(y : SpecialString(this!=x)
SpecialString(this==y, text=="Universe"))))
then
System.out.println("Condition satisfied");
end
rule loading works without any exceptions.
--
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
18 years, 11 months
[JBoss JIRA] Created: (JBRULES-1086) InitialFact should not be shadowed
by Anh Vuong (JIRA)
InitialFact should not be shadowed
----------------------------------
Key: JBRULES-1086
URL: http://jira.jboss.com/jira/browse/JBRULES-1086
Project: JBoss Rules
Issue Type: Bug
Security Level: Public (Everyone can see)
Affects Versions: 4.0.0.GA
Reporter: Anh Vuong
Assigned To: Mark Proctor
If the app uses its own classLoader, Exception IllegalAccessError will be thrown when inserting fact. Here is the stack trace:
2007 Aug 15, 09:08:13:193 Exception IllegalAccessError
java.lang.IllegalAccessError: class org.drools.reteoo.InitialFactImplShadowProxy cannot access its superclass org.drools.reteoo.Init
ialFactImpl
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at org.drools.rule.MapBackedClassLoader.fastFindClass(MapBackedClassLoader.java:60)
at org.drools.rule.MapBackedClassLoader.loadClass(MapBackedClassLoader.java:79)
at java.lang.ClassLoader.loadClass (Unknown Source)
at org.drools.reteoo.Rete$ObjectTypeConf.loadOrGenerateProxy(Rete.java:379)
at org.drools.reteoo.Rete$ObjectTypeConf.defineShadowProxyData(Rete.java:344)
at org.drools.reteoo.Rete$ObjectTypeConf .<init>(Rete.java:320)
at org.drools.reteoo.Rete.assertObject(Rete.java:145)
at org.drools.reteoo.ReteooRuleBase.assertObject(ReteooRuleBase.java:190)
at org.drools.reteoo.ReteooWorkingMemory$WorkingMemoryReteAssertAction.execute(ReteooWorkingMemory.java:163)
at org.drools.common.AbstractWorkingMemory.executeQueuedActions(AbstractWorkingMemory.java:1241)
at org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:858)
at org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:822)
at org.drools.common.AbstractWorkingMemory.insert (AbstractWorkingMemory.java:623)
--
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
18 years, 11 months