[JBoss JIRA] Created: (JBRULES-2336) Context assist in DSLR Editor
by Hamza Bakkali (JIRA)
Context assist in DSLR Editor
-----------------------------
Key: JBRULES-2336
URL: https://jira.jboss.org/jira/browse/JBRULES-2336
Project: Drools
Issue Type: Bug
Security Level: Public (Everyone can see)
Components: All
Affects Versions: 5.0.1.FINAL
Environment: Eclipse 3.4.2 GANYMEDE
Reporter: Hamza Bakkali
Assignee: Mark Proctor
Fix For: 4.0.8
I have been using drools 4 for couple of months now and I am starting to get the hang of it. We recently decided to move to Dools 5 with Eclipse 3.4.2 (Ganymede).
We unfortunately hit a major 'show stopper' (for us). In the DSLR editor: Context Assist + space + enter removes/replaces the whole line, not only the place holder.
In other words:
DSL:
[*][]Log : {msg}=System.out.println("{msg}");
[*][]id1="some id label"
DSLR:
rule "MyRule"
when
then
end
If I Press L , control space --> the line Log:{msg} appears in the context menu. Hit enter I get
Log :{msg}
Now, If want to replace msg by id1. I position the cursor in the {msg}, hit ctrl space, id1 shows in the list. I hit enter the whole line disappear, and I am left with
id1
instead of
Log : id1
Is this a setting somewhere in eclipse itself?? I doubt it.
The same thing use to work as expected in Drools 4.
thanks.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
13 years, 8 months
[JBoss JIRA] Created: (JBRULES-1199) Add a field constraint negation operator to drools
by Arsalan Zaidi (JIRA)
Add a field constraint negation operator to drools
---------------------------------------------------
Key: JBRULES-1199
URL: http://jira.jboss.com/jira/browse/JBRULES-1199
Project: JBoss Rules
Issue Type: Feature Request
Security Level: Public (Everyone can see)
Reporter: Arsalan Zaidi
Assigned To: Mark Proctor
Arsalan,
Unfortunately Drools does not have a field constraint negation operator, mostly because when writing rules, it was not needed, since you can always negate the constraint itself.
Although, I understand a agree with your use case. My suggestion is for you to open a JIRA feature request and we will include that as soon as possible in the product.
Although, meanwhile, the only workaround I can see for your case is to translate the expression you are using directly into a java or mvel expression and write it inside an in-line eval.
[]s
Edson
2007/9/14, Arsalan S. Zaidi <arsalan.zaidi(a)capgemini.com>:
Hi
I'll try to explain the situation that Gaurav finds himself in. We're working on this problem together and so far, we haven't been able to crack it.
We're using drools to handle the business rules for an application. The rules however, are not provided to us in a .drl file, rather, we get an XLS sheet from the analysts with rules in a different grammar.
We're using ANTLR to read and parse these rules to generate the drools rules programmatically. However, we're running into problems with NOT.
The input rules (in the non-drools business language) have a NOT operator which works like '!' in Java. It flips the Boolean around, so to speak. So:
NOT((some sub expression which evaluates to TRUE)) == FALSE
MVEL doesn't seem to support this. So how do we simulate it?
If it were only being used with NOT IN, we could manage, but its use is completely arbitrary. Changes to the input rules or to the input rules grammar have been (ha ha) ruled out.
Any help would be appreciated.
Regards,
_____________________________________________________
Arsalan Zaidi / Capgemini - India (FS SBU) / Mumbai
Technical Architect
Mobile Phone: +91 - 9892 8970 03 / www.capgemini.com
Together: the Collaborative Business Experience
_____________________________________________________
--------------------------------------------------------------------------------
From: rules-users-bounces(a)lists.jboss.org [mailto:rules-users-bounces@lists.jboss.org] On Behalf Of Anstis, Michael (M.)
Sent: 13 September 2007 13:31
To: Rules Users List
Subject: RE: [rules-users] How to use not operator in drool.
What dialect do your rules use?
You could also simplify the logic using DeMorgans Theorem (which might be troublesome to accomplish programmatically)
I don't know whether your example is flawed as the brackets don't match, but assuming you mean something like this:-
(NOT (G13.1 IN ("1","2","3") OR (G250.8 = Y)))
You can re-write this as
(G13.1NOT IN ("1","2","3") AND G250.8 != Y)
With kind regards,
Mike
--------------------------------------------------------------------------------
From: rules-users-bounces(a)lists.jboss.org [mailto:rules-users-bounces@lists.jboss.org] On Behalf Of JOSHI, GAURAV
Sent: 13 September 2007 08:20
To: Rules Users List
Subject: RE: [rules-users] How to use not operator in drool.
Thank's for your sugession of using "not in" instead of "not" but my problem is that "not" can also come without "in".
Actually I am making a generator of rule file from expression like
((NOT (ENDS WITH (G10.2, ",")))
((NOT (G13.1 IN ("1","2","3"))) OR (G250.8 = Y)))
Where G13.2, G250.8, G10.2 are variables coming from a map inserted in working memory.
I am accessing these variables from map.
My rules are as follows
This rule is working fine.
rule "Editable_G10.3"
when
((Map( this["G10.3"] !=8))||(Map( this["G10.2"] ==19)))
then
System.out.println("comming here----------------------------------------------------->");
End
This is not working
rule "Mandatory_G10.3"
when
(not((Map( this["G10.3"] !=8))||(Map( this["G10.2"] ==19))))
Then
System.out.println("comming here----------------------------------------------------->");
End
In also tried following approaches:
1) eval(not((Map( this["G10.3"] !=8))||(Map( this["G10.2"] ==19))))
2) eval(!((Map( this["G10.3"] !=8))||(Map( this["G10.2"] ==19))))
But in both cases it is giving same error:
org.drools.rule.InvalidRulePackage: Rule Compilation error : [Rule name=ValidationRuleExp_G10.3, agendaGroup=MAIN, salience=0, no-loop=false]
com/telekurs/nva/mde/fe/ak/validation/Rule_ValidationRuleExp_G10_3_0.java (11:495) : Cannot use this in a static context
com/telekurs/nva/mde/fe/ak/validation/Rule_ValidationRuleExp_G10_3_0.java (11:500) : Type mismatch: cannot convert from String to int
I am trying to find out some general concept so that I can change just achieve the functionality of not.
Thanks
Gaurav
--------------------------------------------------------------------------------
From: rules-users-bounces(a)lists.jboss.org [mailto:rules-users-bounces@lists.jboss.org] On Behalf Of Edson Tirelli
Sent: Wednesday, September 12, 2007 10:20 PM
To: Rules Users List
Subject: Re: [rules-users] How to use not operator in drool.
Remove your "eval" and use "or" instead of "||" for the OR CE.
Although, I feel that this is not what you want... what you want is simply:
when
Map( this['city'] not in ( "mumbai", "delhi" ) )
then
//...
end
[]s
Edson
2007/9/12, Gaurav2007 < gaurav.a.joshi(a)capgemini.com>:
Hi ALL,
I am using drool4.0.1 in my application i am able to use IN,OR,AND operator
but i am facing problem in using not operator.
my requirement of not operator is just like a not gate.
the way i am using it is :
eval(not((Map( this["city"] !="mumbai"))||(Map( this["city"] =="delhi"))))
so can you please help me out to solve this problem:
should i use not operator or some thing else in drool.
Thanks,
--
View this message in context: http://www.nabble.com/How-to-use-not-operator-in-drool.-tf4430240.html#a1...
Sent from the drools - user mailing list archive at Nabble.com.
_______________________________________________
rules-users mailing list
rules-users(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users
--
Edson Tirelli
Software Engineer - JBoss Rules Core Developer
Office: +55 11 3529-6000
Mobile: +55 11 9287-5646
JBoss, a division of Red Hat @ www.jboss.com
This message contains information that may be privileged or confidential and is the property of the Capgemini Group. It is intended only for the person to whom it is addressed. If you are not the intended recipient, you are not authorized to read, print, retain, copy, disseminate, distribute, or use this message or any part thereof. If you receive this message in error, please notify the sender immediately and delete all copies of this message.
This message contains information that may be privileged or confidential and is the property of the Capgemini Group. It is intended only for the person to whom it is addressed. If you are not the intended recipient, you are not authorized to read, print, retain, copy, disseminate, distribute, or use this message or any part thereof. If you receive this message in error, please notify the sender immediately and delete all copies of this message.
_______________________________________________
rules-users mailing list
rules-users(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users
--
Edson Tirelli
Software Engineer - JBoss Rules Core Developer
Office: +55 11 3529-6000
Mobile: +55 11 9287-5646
JBoss, a division of Red Hat @ www.jboss.com
--
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
13 years, 8 months
[JBoss JIRA] Created: (JBRULES-1596) java.lang.NoClassDefFoundError
by Jurgen Van Bouchaute (JIRA)
java.lang.NoClassDefFoundError
-------------------------------
Key: JBRULES-1596
URL: http://jira.jboss.com/jira/browse/JBRULES-1596
Project: JBoss Drools
Issue Type: Bug
Security Level: Public (Everyone can see)
Affects Versions: 4.0.4
Environment: Win XP, Drools 4.0.4 , BRMS on JBOSS 4.2.1-GA , JVM Bea JRockit R27 3.1 (1.5)
Reporter: Jurgen Van Bouchaute
Assigned To: Mark Proctor
Attachments: adresDSL, packagesource.txt, Rule source.txt
Encountered following error during unit testing execution of rules :
[BeforeActivationFired: rule=Address Validation Town required; tuple=[fid:1:1:com.amadeus.mbo.msp.proto.model.AddressImpl@558fec]
]
java.lang.NoClassDefFoundError: Adres/CreateValidationErrorDSL
at ASMAccessorImpl_34195571209986950480.getValue(Unknown Source)
at org.mvel.ASTNode.getReducedValueAccelerated(ASTNode.java:174)
at org.mvel.ExecutableAccessor.getValue(ExecutableAccessor.java:50)
at ASMAccessorImpl_33632651209986950320.getValue(Unknown Source)
at org.mvel.ast.VariableDeepPropertyNode.getReducedValueAccelerated(VariableDeepPropertyNode.java:22)
at org.mvel.ast.PropertyASTNode.getReducedValueAccelerated(PropertyASTNode.java:21)
at org.mvel.MVELRuntime.execute(MVELRuntime.java:88)
at org.mvel.CompiledExpression.getValue(CompiledExpression.java:111)
at org.mvel.MVEL.executeExpression(MVEL.java:235)
at org.drools.base.mvel.MVELConsequence.evaluate(MVELConsequence.java:47)
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.amadeus.mbo.commons.ruleengine.RuleManager.executeRules(RuleManager.java:158)
at com.amadeus.mbo.msp.proto.service.CustomerServiceImpl.validateAddress(CustomerServiceImpl.java:444)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:296)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:177)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:144)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:107)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:166)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
at $Proxy8.validateAddress(Unknown Source)
at com.amadeus.mbo.msp.proto.service.CustomerServiceImplTest.testValidateAddress(CustomerServiceImplTest.java:1139)
DSL Rule RHS executes a function that returns an object which is inserted.
No problems when building & validating the package in BRMS, only when executing the rule.
--
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
13 years, 8 months
[JBoss JIRA] Created: (JBRULES-2466) Exception in hash code calculation for character attributes in alpha hashing optimization
by Olexandr Demura (JIRA)
Exception in hash code calculation for character attributes in alpha hashing optimization
-----------------------------------------------------------------------------------------
Key: JBRULES-2466
URL: https://jira.jboss.org/jira/browse/JBRULES-2466
Project: Drools
Issue Type: Sub-task
Security Level: Public (Everyone can see)
Components: drools-core (expert)
Affects Versions: 5.1.0.M1
Reporter: Olexandr Demura
Assignee: Mark Proctor
JBRULES-1348 introduces a bug in interaction between CompositeObjectSinkAdapter$HashKey and BaseObjectClassFieldReader
be following code change
- } else if ( vtype.isIntegerNumber() ) {
+ } else if ( vtype.isIntegerNumber() || vtype.isChar() ) {
this.type = LONG;
if ( !isNull ) {
this.lvalue = extractor.getLongValue( null, value );
because BaseObjectClassFieldReader.getLongValue() doesn't handle properties of Character type,
and RuntimeDroolsException is thrown with message "Conversion to double not supported from java.lang.Character".
In case BaseObjectClassFieldReader.getLongValue() returns ((Character) value).charValue() instead of throwing exception,
exception in the following form will be thrown be CompositeObjectSinkAdapter$HashKey
on equality check if other HashKey gained type OBJECT instead of LONG:
java.lang.NumberFormatException: For input string: "R"
at java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)
at java.lang.Long.parseLong(Long.java:403)
at java.lang.Long.parseLong(Long.java:461)
at org.drools.reteoo.CompositeObjectSinkAdapter$HashKey.getLongValue(CompositeObjectSinkAdapter.java:628)
at org.drools.reteoo.CompositeObjectSinkAdapter$HashKey.equals(CompositeObjectSinkAdapter.java:692)
at org.drools.util.AbstractHashTable$EqualityEquals.equal(AbstractHashTable.java:446)
at org.drools.util.ObjectHashMap.get(ObjectHashMap.java:90)
at org.drools.reteoo.CompositeObjectSinkAdapter.propagateAssertObject(CompositeObjectSinkAdapter.java:326)
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
13 years, 8 months
[JBoss JIRA] Created: (JBRULES-2651) Concurrency issue in NamedEntryPoint.insert leads to occasional hanging in Drools
by Norman Chan (JIRA)
Concurrency issue in NamedEntryPoint.insert leads to occasional hanging in Drools
---------------------------------------------------------------------------------
Key: JBRULES-2651
URL: https://jira.jboss.org/browse/JBRULES-2651
Project: Drools
Issue Type: Bug
Security Level: Public (Everyone can see)
Components: drools-core (expert)
Affects Versions: 5.0.1.FINAL
Reporter: Norman Chan
Assignee: Mark Proctor
I found issue which I believe might point to a concurrency issue. My server stopped processing new requests, so I did a thread dump. In examining the dump, I found that all of the processing threads, save two, were blocking while trying to acquire the lock in NamedEntryPoint.insert. Both of the other two threads appeared to be infinitely looping in the NamedEntryPoint.insert method. Here are snippets of their stack traces:
ActiveMQ Session Task" prio=10 tid=0x00002aab0003b000 nid=0x7b98 runnable
[0x000000004c086000..0x000000004c087c90] java.lang.Thread.State: RUNNABLE
at org.drools.util.ObjectHashMap.remove(ObjectHashMap.java:121) at
org.drools.common.SingleThreadedObjectStore.removeHandle(SingleThreadedObjectStore.java:150)
at org.drools.common.NamedEntryPoint.retract(NamedEntryPoint.java:296)
at org.drools.common.NamedEntryPoint.retract(NamedEntryPoint.java:245) at
org.drools.reteoo.ReteooWorkingMemory$WorkingMemoryReteExpireAction.execute(ReteooWorkingMemory.java:350)
at
org.drools.common.AbstractWorkingMemory.executeQueuedActions(AbstractWorkingMemory.java:1488)
at org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:158)
at org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:122) at
org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:80) at
org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:28) at
ActiveMQ Session Task" prio=10 tid=0x000000005a35cc00 nid=0xdf6 runnable
[0x000000004a268000..0x000000004a269a90] java.lang.Thread.State: RUNNABLE
at org.drools.util.AbstractHashTable.resize(AbstractHashTable.java:115) at
org.drools.util.ObjectHashMap.put(ObjectHashMap.java:78) at
org.drools.common.SingleThreadedObjectStore.addHandle(SingleThreadedObjectStore.java:136)
at org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:113)
at org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:80) at
org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:28) at
So it seems like while the first thread is holding the lock and attempting to remove an object handle from the object store in NamedEntryPoint, the other thread is trying to resize that same object store in response to an addHandle call that puts it over the threshold. I haven't worked out exactly how these concurrent accesses to the same object store by two different threads causes an infinite loop in both threads, but it seems like the call to SingleThreadedObjectStore.addHandle should be preceded by acquiring the lock.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
13 years, 8 months