Re: [rules-users] Execution problems with (or and (and

2007-08-31 Thread vdelbart

thanks,

I try with the 4.0.1 release but no I have this error when I insert my fact
:

java.lang.NullPointerException
at org.drools.reteoo.ReteTuple.get(ReteTuple.java:72)
at org.drools.reteoo.ReteTuple.get(ReteTuple.java:107)
at
org.drools.audit.WorkingMemoryLogger.extractDeclarations(WorkingMemoryLogger.java:241)
at
org.drools.audit.WorkingMemoryLogger.activationCreated(WorkingMemoryLogger.java:182)
at
org.drools.event.AgendaEventSupport.fireActivationCreated(AgendaEventSupport.java:75)
at
org.drools.reteoo.RuleTerminalNode.assertTuple(RuleTerminalNode.java:326)
at
org.drools.reteoo.RuleTerminalNode.assertTuple(RuleTerminalNode.java:132)

with the same rule package.

Thanks,

Vdelbart
-- 
View this message in context: 
http://www.nabble.com/Execution-problems-with-%28or-and-%28and-tf4352997.html#a12421776
Sent from the drools - user mailing list archive at Nabble.com.

___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Ruleflow and Global - precision

2007-08-31 Thread vdelbart

I try with the 4.0.1 release but it's the same result.

best regards,

Vdelbart
-- 
View this message in context: 
http://www.nabble.com/Ruleflow-and-Global---tf4347589.html#a12421773
Sent from the drools - user mailing list archive at Nabble.com.

___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] add process only - bug ?

2007-08-31 Thread hypnosat7

That still not work with the latest version (4.0.1)
any help pls:,(


hypnosat7 wrote:
 
 hi,
 
   I try to add a ruleflow to my rule base :
   builder.addRuleFlow(RULE_FLOW);
   Package pkg = builder.getPackage();
   ruleBase.addPackage(builder.getPackage());
 
 But !!:
 java.lang.NullPointerException
   at
 org.drools.compiler.PackageBuilder.addRuleFlowsToPackage(PackageBuilder.java:469)
   at 
 org.drools.compiler.PackageBuilder.getPackage(PackageBuilder.java:449)
   at mcmipih.rules.demo.service.TestDraft.main(TestDraft.java:31)
 

-- 
View this message in context: 
http://www.nabble.com/add-process-only--%3E-bug---tf4334017.html#a12424043
Sent from the drools - user mailing list archive at Nabble.com.

___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


[rules-users] PDF documntation

2007-08-31 Thread Simon Giesecke

Hi...

currently the Drools reference manual is only available as HTML, is it 
possible to also generate a PDF document from the documentation sources?


Kind regards
Simon

--
Dipl.-Inform. Simon Giesecke
Wissenschaftlicher Mitarbeiter
OFFIS e.V.
FE-Bereich Betriebliches Informationsmanagement
Escherweg 2, 26121 Oldenburg
Tel.: +49 441 9722 581  | Fax: +49 441 9722 111
E-Mail: [EMAIL PROTECTED] | URL: http://www.offis.de

___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Ruleflow and Global - precision

2007-08-31 Thread vdelbart

Thanks a lot !

I will use your Global class :-)

vdelbart
-- 
View this message in context: 
http://www.nabble.com/Ruleflow-and-Global---tf4347589.html#a12425923
Sent from the drools - user mailing list archive at Nabble.com.

___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Execution problems with (or and (and

2007-08-31 Thread vdelbart

Ok cool,

it's working !!

thanks a lot,

vdelbart
-- 
View this message in context: 
http://www.nabble.com/Execution-problems-with-%28or-and-%28and-tf4352997.html#a12426264
Sent from the drools - user mailing list archive at Nabble.com.

___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] PDF documntation

2007-08-31 Thread Mark Proctor
the build system is able to produce pdf, but we disbable it as docbook 
pdf creators cannot handle images that span pages and it blows up, and 
there are no resources to re-align images to span page break; further to 
this each time you add content, all the images will need to be adjusted 
again, so it's a time consuming maintenance effort that no one seems 
willing to do.


Mark
Simon Giesecke wrote:

Hi...

currently the Drools reference manual is only available as HTML, is it 
possible to also generate a PDF document from the documentation sources?


Kind regards
Simon



___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Fwd: fyi: performance improvements

2007-08-31 Thread Mark Proctor
3.0 uses a totally different indexing sub system, so it won't be as 
clean to fix, I'm not even sure if it's broken or just not efficient. 
But feel free to have a dig.


Mark
Yuri de Wit wrote:

Re: the above performance improvements, what is feasibility of
applying the same solution for 3.x (even if I have to appy the patch
locally, myself)? We have been having the same exact performance
issues corrected by these two bug resolution in an existing app built
on 3.x.

thanks,

-- yuri

-- Forwarded message --
From: Yuri de Wit [EMAIL PROTECTED]
Date: Aug 30, 2007 5:48 PM
Subject: fyi: performance improvements
To: Rules Users List rules-users@lists.jboss.org


A nice surprise, the latest 4.0.1 GA is running 35% faster than my
patch for the following two JIRA bugs:

http://jira.jboss.com/jira/browse/JBRULES-1102?page=all
http://jira.jboss.com/jira/browse/JBRULES-1101?page=all

So I guess there were additional improvements that made this cut.

For the rest of the list, the above two fixes made my load tests run
200x faster than 4.0.0 GA.

thanks,

-- yuri
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users

  


___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


[rules-users] check dups

2007-08-31 Thread Tim . Nguyen


Hi List,

I'd like to check if any duplicate exists in my collection as below:

rule check Duplicate
  when
ref1: Reference ($type1: referenceType, $value1:
referenceValue)
ref2: Reference (this != ref1, referenceType == $referenceType,
referenceValue == $value1)

  then
 errorHandler.record(Duplicate Reference is not allowed.);
end


Both my referenceType and referenceValue are String. I didn't get any error
but it didn't work. Any idea?
I am using 4.01 GA


Thanks,
Tim

___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Possible to check for null and empty string in same rule?

2007-08-31 Thread Edson Tirelli
   Brian,

   Easy to understand with String and Character, but what would be an empty
Date or empty Number, etc?
   Unfortunately the DSL template engine is a text template engine, and as
so, does not validate type. The only thing I can think about is if you
create a function that is called at runtime, evaluating parameter type and
handling it appropriately.

[]s
Edson


2007/8/31, Brian Enderle [EMAIL PROTECTED]:

 One of the checks that we are required to do on our data is that the data
 is
 not blank, meaning the value retrieved from the DB is not null and not 
 (empty string) or '' (empty characer), etc..

 Is there anyway to create a DSL entry to do this check regardless of the
 data
 type (Stirng, character, Date, etc.) that is returned?

 I have tried the obvious ({field} == null || {field} == ) but this only
 works for String types.  I would really like to have just one DSL entry
 that
 would handle all cases.

 Thanks,
 Brian Enderle



 ___
 rules-users mailing list
 rules-users@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
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Drools 4.0.1 Released

2007-08-31 Thread Scott Reed

Edson Tirelli's message received 8/31/2007 7:08 AM:


Did you updated your MVEL jar? Are you trying to deserialize a 
binary previously compiled rulebase or are you trying to load source DRLs?


Loading source DRLs. I thought I had copied in the new MVEL jar but hadn't. It works fine now that I 
figured that out.

___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] check dups

2007-08-31 Thread Edson Tirelli
   Hey Tim,

   Can you please provide a self contained test case? There is no reason why
it would not work.

   Thanks
Edson

2007/8/31, [EMAIL PROTECTED] [EMAIL PROTECTED]:



 Hi List,

 I'd like to check if any duplicate exists in my collection as below:

 rule check Duplicate
   when
 ref1: Reference ($type1: referenceType, $value1:
 referenceValue)
 ref2: Reference (this != ref1, referenceType ==
 $referenceType,
 referenceValue == $value1)

   then
  errorHandler.record(Duplicate Reference is not allowed.);
 end


 Both my referenceType and referenceValue are String. I didn't get any
 error
 but it didn't work. Any idea?
 I am using 4.01 GA


 Thanks,
 Tim

 ___
 rules-users mailing list
 rules-users@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
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


[rules-users] A model class incompatibility issue causing most operations on BRMS fail

2007-08-31 Thread Kunal Shah
I just started playing with BRMS (4.0.0 GA). After trying to upload one
particular model jar, my BRMS is almost inaccessible. Seems like all
calls (to open any rule assets/package) results in populating model info
and hence in following error:

 

Is there any way to remove this model jar file now and get back by other
configurations? I would think that this should be handled little
gracefully so that entire system doesn't become inaccessible. I am just
using default database configuration right now. I can start from scratch
again but if I have to do that, it will be bad.

 

 

10:47:27,358 INFO  [STDOUT] ERROR 31-08 10:47:27,358
(Log4JLogger.java:error:119)   Exception while dispatching incoming
RPC call

java.lang.ClassFormatError: Incompatible magic value 791289923 in class
file com/sensorlogic/offboard/drools/facts/GenerateAlarm

 at java.lang.ClassLoader.defineClass1(Native Method)

 at java.lang.ClassLoader.defineClass(ClassLoader.java:620)

 at
org.drools.rule.MapBackedClassLoader.fastFindClass(MapBackedClassLoader.
java:60)

 at
org.drools.rule.MapBackedClassLoader.loadClass(MapBackedClassLoader.java
:79)

 at java.lang.ClassLoader.loadClass(ClassLoader.java:251)

 at
org.drools.base.ClassTypeResolver.resolveType(ClassTypeResolver.java:148
)

 at
org.drools.brms.server.rules.SuggestionCompletionLoader.loadClass(Sugges
tionCompletionLoader.java:269)

 at
org.drools.brms.server.rules.SuggestionCompletionLoader.populateModelInf
o(SuggestionCompletionLoader.java:212)

 at
org.drools.brms.server.rules.SuggestionCompletionLoader.processPackageHe
ader(SuggestionCompletionLoader.java:118)

 at
org.drools.brms.server.rules.SuggestionCompletionLoader.getSuggestionEng
ine(SuggestionCompletionLoader.java:91)

 at
org.drools.brms.server.util.BRMSSuggestionCompletionLoader.getSuggestion
Engine(BRMSSuggestionCompletionLoader.java:38)

 at
org.drools.brms.server.ServiceImplementation.loadSuggestionCompletionEng
ine(ServiceImplementation.java:708)

 at
org.drools.brms.server.ServiceImplementation$$FastClassByCGLIB$$8f2fab45
.invoke(generated)

 at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149)

 at
org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationCon
text.java:45)

 at
org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationCon
text.java:57)

 at
org.jboss.seam.interceptors.RollbackInterceptor.aroundInvoke(RollbackInt
erceptor.java:34)

 at
org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationCon
text.java:69)

 at
org.jboss.seam.interceptors.BijectionInterceptor.aroundInvoke(BijectionI
nterceptor.java:47)

 at
org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationCon
text.java:69)

 at
org.jboss.seam.interceptors.MethodContextInterceptor.aroundInvoke(Method
ContextInterceptor.java:27)

 at
org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationCon
text.java:69)

 at
org.jboss.seam.interceptors.SecurityInterceptor.aroundInvoke(SecurityInt
erceptor.java:37)

 at
org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationCon
text.java:69)

 at
org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:103
)

 at
org.jboss.seam.intercept.JavaBeanInterceptor.interceptInvocation(JavaBea
nInterceptor.java:154)

 at
org.jboss.seam.intercept.JavaBeanInterceptor.intercept(JavaBeanIntercept
or.java:89)

 at
org.drools.brms.server.ServiceImplementation$$EnhancerByCGLIB$$fc786c20.
loadSuggestionCompletionEngine(generated)

 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

 at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav
a:39)

 at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor
Impl.java:25)

 at java.lang.reflect.Method.invoke(Method.java:585)

 at
org.jboss.seam.remoting.gwt.GWTToSeamAdapter.callWebRemoteMethod(GWTToSe
amAdapter.java:70)

 at
org.jboss.seam.remoting.gwt.GWTRemoteServiceServlet.processCall(GWTRemot
eServiceServlet.java:300)

 at
org.jboss.seam.remoting.gwt.GWTRemoteServiceServlet.doPost(GWTRemoteServ
iceServlet.java:181)

 at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

 at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)

 at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applica
tionFilterChain.java:252)

 at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilt
erChain.java:173)

 at org.jboss.seam.web.ContextFilter.doFilter(ContextFilter.java:56)

 at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applica
tionFilterChain.java:202)

 at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilt
erChain.java:173)

 at
org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilte
r.java:96)

 at

Re: [rules-users] mvel bug ??

2007-08-31 Thread Edson Tirelli
   Can you please provide a test case? I will look into it asap.

   []s
   Edson

2007/8/31, hypnosat7 [EMAIL PROTECTED]:


 Hi,

I have a variable declaration as bellow :

 list:Variable() from ruleApp.getVariable(variableName)

 and this is the result :
 Exception in thread AWT-EventQueue-0 org.mvel.CompileException: cannot
 invoke method
 at
 org.mvel.optimizers.impl.refl.MethodAccessor.getValue(MethodAccessor.java
 :54)
 at
 org.mvel.optimizers.impl.refl.VariableAccessor.getValue(
 VariableAccessor.java:39)
 at
 org.mvel.ast.VariableDeepPropertyNode.getReducedValueAccelerated(
 VariableDeepPropertyNode.java:26)
 at
 org.mvel.ast.PropertyASTNode.getReducedValueAccelerated(
 PropertyASTNode.java:19)
 at org.mvel.MVELRuntime.execute(MVELRuntime.java:88)
 at org.mvel.CompiledExpression.getValue(CompiledExpression.java
 :99)
 at org.mvel.MVEL.executeExpression(MVEL.java:236)
 at
 org.drools.base.dataproviders.MVELDataProvider.getResults(
 MVELDataProvider.java:45)
 at org.drools.reteoo.FromNode.assertTuple(FromNode.java:61)
 at
 org.drools.reteoo.CompositeTupleSinkAdapter.createAndPropagateAssertTuple(
 CompositeTupleSinkAdapter.java:73)
 at
 org.drools.reteoo.LeftInputAdapterNode.assertObject(
 LeftInputAdapterNode.java:131)
 at
 org.drools.reteoo.SingleObjectSinkAdapter.propagateAssertObject(
 SingleObjectSinkAdapter.java:20)
 at org.drools.reteoo.ObjectTypeNode.assertObject(
 ObjectTypeNode.java:160)
 at org.drools.reteoo.Rete.assertObject(Rete.java:176)
 at org.drools.reteoo.ReteooRuleBase.assertObject(
 ReteooRuleBase.java:196)
 at

 org.drools.reteoo.ReteooWorkingMemory$WorkingMemoryReteAssertAction.execute
 (ReteooWorkingMemory.java:164)
 at
 org.drools.common.AbstractWorkingMemory.executeQueuedActions(
 AbstractWorkingMemory.java:1260)
 at
 org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java
 :864)
 at
 org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java
 :826)
 at
 org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java
 :627)
 at
 mcmipih.rules.rules.integration.drools.ExecutionContext.executeRuleFlow(
 ExecutionContext.java:54)
 at
 mcmipih.rules.demo.service.DemoRuleService.validerRumList(
 DemoRuleService.java:50)
 at

 mcmipih.rules.demo.service.DemoRuleService$$FastClassByCGLIB$$beeddc5a.invoke
 (generated)
 at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149)
 at

 org.springframework.aop.framework.Cglib2AopProxy$CglibMethodInvocation.invokeJoinpoint
 (Cglib2AopProxy.java:693)
 at
 org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(
 ReflectiveMethodInvocation.java:139)
 at
 org.springframework.transaction.interceptor.TransactionInterceptor.invoke(
 TransactionInterceptor.java:107)
 at
 org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(
 ReflectiveMethodInvocation.java:161)
 at

 org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept
 (Cglib2AopProxy.java:628)
 at

 mcmipih.rules.demo.service.DemoRuleService$$EnhancerByCGLIB$$961244c9.validerRumList
 (generated)
 at

 mcmipih.rules.demo.controller.ValidationAppController$ActionValiderSelectionLst.actionPerformed
 (ValidationAppController.java:185)
 at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
 at javax.swing.AbstractButton$Handler.actionPerformed(Unknown
 Source)
 at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown
 Source)
 at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
 at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown
 Source)
 at java.awt.Component.processMouseEvent(Unknown Source)
 at javax.swing.JComponent.processMouseEvent(Unknown Source)
 at java.awt.Component.processEvent(Unknown Source)
 at java.awt.Container.processEvent(Unknown Source)
 at java.awt.Component.dispatchEventImpl(Unknown Source)
 at java.awt.Container.dispatchEventImpl(Unknown Source)
 at java.awt.Component.dispatchEvent(Unknown Source)
 at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown
 Source)
 at java.awt.LightweightDispatcher.processMouseEvent(Unknown
 Source)
 at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
 at java.awt.Container.dispatchEventImpl(Unknown Source)
 at java.awt.Window.dispatchEventImpl(Unknown Source)
 at java.awt.Component.dispatchEvent(Unknown Source)
 at java.awt.EventQueue.dispatchEvent(Unknown Source)
 at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown
 Source)
 at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown
 Source)
 at 

Re: [rules-users] check dups

2007-08-31 Thread Tim . Nguyen


Here is my test

Reference ref_test2 = new Reference();
ref_test2.setReferenceType(new ReferenceType(MISC));
ref_test2.setReferenceValue(111222);

Reference ref_test3 = new Reference();
ref_test3.setReferenceType(new ReferenceType(MISC));
ref_test3.setReferenceValue(111222);

references.add(ref_test2);
references.add(ref_test2);



final StatefulSession session = ruleBase.newStatefulSession();
session.insert(references);
session.fireAllRules();



Thanks!
Tim


   
 Edson Tirelli   
 [EMAIL PROTECTED] 
   To 
 Sent by:  Rules Users List  
 rules-users-bounc rules-users@lists.jboss.org   
 [EMAIL PROTECTED]  cc 
 g 
   Subject 
   Re: [rules-users] check dups
 08/31/2007 08:57  
 AM
   
   
 Please respond to 
 Rules Users List  
 [EMAIL PROTECTED] 
   s.jboss.org
   
   





   Hey Tim,

   Can you please provide a self contained test case? There is no reason
why it would not work.

   Thanks
Edson

2007/8/31, [EMAIL PROTECTED] [EMAIL PROTECTED]:


  Hi List,

  I'd like to check if any duplicate exists in my collection as below:

  rule check Duplicate
when
  ref1: Reference ($type1: referenceType, $value1:
  referenceValue)
  ref2: Reference (this != ref1, referenceType ==
  $referenceType,
  referenceValue == $value1)

then
   errorHandler.record(Duplicate Reference is not allowed.);
  end


  Both my referenceType and referenceValue are String. I didn't get any
  error
  but it didn't work. Any idea?
  I am using 4.01 GA


  Thanks,
  Tim

  ___
  rules-users mailing list
  rules-users@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
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] removing all packages

2007-08-31 Thread hypnosat7

I'm tried this :
 .

// get the compiled package
Package pkg = builder.getPackage();

// remove the old packages
ListPackage oldPackages = 
Arrays.asList(ruleBase.getPackages());

for (Package oldPkg : oldPackages)
{

ruleBase.removePackage(oldPkg.getName());

}

// add the package
ruleBase.addPackage(pkg);

But my behavior's rule flow is changing !!

hypnosat7 wrote:
 
 Hi,
 
   How can I remove all the packages from a rule base without creating a
 new rulebase ?
 

-- 
View this message in context: 
http://www.nabble.com/removing-all-packages-tf4359507.html#a12429713
Sent from the drools - user mailing list archive at Nabble.com.

___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] check dups

2007-08-31 Thread Anh Vuong
Can it be the typo in
  referenceType ==  $referenceType
  where $referenceType should be $type1
  

[EMAIL PROTECTED] wrote:
  

Here is my test

Reference ref_test2 = new Reference();
ref_test2.setReferenceType(new ReferenceType(MISC));
ref_test2.setReferenceValue(111222);

Reference ref_test3 = new Reference();
ref_test3.setReferenceType(new ReferenceType(MISC));
ref_test3.setReferenceValue(111222);

references.add(ref_test2);
references.add(ref_test2);



final StatefulSession session = ruleBase.newStatefulSession();
session.insert(references);
session.fireAllRules();



Thanks!
Tim



Edson Tirelli 
 To 
Sent by: Rules Users List 
rules-users-bounc 
[EMAIL PROTECTED] cc 
g 
Subject 
Re: [rules-users] check dups 
08/31/2007 08:57 
AM 


Please respond to 
Rules Users List 
s.jboss.org 







Hey Tim,

Can you please provide a self contained test case? There is no reason
why it would not work.

Thanks
Edson

2007/8/31, [EMAIL PROTECTED] :


Hi List,

I'd like to check if any duplicate exists in my collection as below:

rule check Duplicate
when
ref1: Reference ($type1: referenceType, $value1:
referenceValue)
ref2: Reference (this != ref1, referenceType ==
$referenceType,
referenceValue == $value1)

then
errorHandler.record(Duplicate Reference is not allowed.);
end


Both my referenceType and referenceValue are String. I didn't get any
error
but it didn't work. Any idea?
I am using 4.01 GA


Thanks,
Tim

___
rules-users mailing list
rules-users@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
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


   
-
Shape Yahoo! in your own image.  Join our Network Research Panel today!___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] check dups

2007-08-31 Thread Edson Tirelli
Tim,

Your rule expects to get Reference objects from the working memory, and
they are not there, since you are adding a List of them and not them. Insert
individual references and it will work.

[]s
Edson

2007/8/31, [EMAIL PROTECTED] [EMAIL PROTECTED]:



 Here is my test

 Reference ref_test2 = new Reference();
 ref_test2.setReferenceType(new ReferenceType(MISC));
 ref_test2.setReferenceValue(111222);

 Reference ref_test3 = new Reference();
 ref_test3.setReferenceType(new ReferenceType(MISC));
 ref_test3.setReferenceValue(111222);

 references.add(ref_test2);
 references.add(ref_test2);



 final StatefulSession session = ruleBase.newStatefulSession();
 session.insert(references);
 session.fireAllRules();



 Thanks!
 Tim



  Edson Tirelli
  [EMAIL PROTECTED]
To
  Sent by:  Rules Users List
  rules-users-bounc rules-users@lists.jboss.org
  [EMAIL PROTECTED]  cc
  g
Subject
Re: [rules-users] check dups
  08/31/2007 08:57
  AM


  Please respond to
  Rules Users List
  [EMAIL PROTECTED]
s.jboss.org







Hey Tim,

Can you please provide a self contained test case? There is no reason
 why it would not work.

Thanks
 Edson

 2007/8/31, [EMAIL PROTECTED] [EMAIL PROTECTED]:


   Hi List,

   I'd like to check if any duplicate exists in my collection as below:

   rule check Duplicate
 when
   ref1: Reference ($type1: referenceType, $value1:
   referenceValue)
   ref2: Reference (this != ref1, referenceType ==
   $referenceType,
   referenceValue == $value1)

 then
errorHandler.record(Duplicate Reference is not allowed.);
   end


   Both my referenceType and referenceValue are String. I didn't get any
   error
   but it didn't work. Any idea?
   I am using 4.01 GA


   Thanks,
   Tim

   ___
   rules-users mailing list
   rules-users@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
 ___
 rules-users mailing list
 rules-users@lists.jboss.org
 https://lists.jboss.org/mailman/listinfo/rules-users


 ___
 rules-users mailing list
 rules-users@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
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] mvel bug ??

2007-08-31 Thread pentarious

Hi,
I believe the following syntax is not supported in Drools:
list:Variable() from SOME_JAVA_CODE
You should use something like: from $list or from collect or from
accumulate, and embed any Java code in an eval statement. Edson, am I
missing something?

Regards,

CG



hypnosat7 wrote:
 
 Hi,
 
I have a variable declaration as bellow :
 
list:Variable() from ruleApp.getVariable(variableName)
 
 and this is the result :
 Exception in thread AWT-EventQueue-0 org.mvel.CompileException: cannot
 invoke method
   at
 org.mvel.optimizers.impl.refl.MethodAccessor.getValue(MethodAccessor.java:54)
   at
 org.mvel.optimizers.impl.refl.VariableAccessor.getValue(VariableAccessor.java:39)
   at
 org.mvel.ast.VariableDeepPropertyNode.getReducedValueAccelerated(VariableDeepPropertyNode.java:26)
   at
 org.mvel.ast.PropertyASTNode.getReducedValueAccelerated(PropertyASTNode.java:19)
   at org.mvel.MVELRuntime.execute(MVELRuntime.java:88)
   at org.mvel.CompiledExpression.getValue(CompiledExpression.java:99)
   at org.mvel.MVEL.executeExpression(MVEL.java:236)
   at
 org.drools.base.dataproviders.MVELDataProvider.getResults(MVELDataProvider.java:45)
   at org.drools.reteoo.FromNode.assertTuple(FromNode.java:61)
   at
 org.drools.reteoo.CompositeTupleSinkAdapter.createAndPropagateAssertTuple(CompositeTupleSinkAdapter.java:73)
   at
 org.drools.reteoo.LeftInputAdapterNode.assertObject(LeftInputAdapterNode.java:131)
   at
 org.drools.reteoo.SingleObjectSinkAdapter.propagateAssertObject(SingleObjectSinkAdapter.java:20)
   at 
 org.drools.reteoo.ObjectTypeNode.assertObject(ObjectTypeNode.java:160)
   at org.drools.reteoo.Rete.assertObject(Rete.java:176)
   at 
 org.drools.reteoo.ReteooRuleBase.assertObject(ReteooRuleBase.java:196)
   at
 org.drools.reteoo.ReteooWorkingMemory$WorkingMemoryReteAssertAction.execute(ReteooWorkingMemory.java:164)
   at
 org.drools.common.AbstractWorkingMemory.executeQueuedActions(AbstractWorkingMemory.java:1260)
   at
 org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:864)
   at
 org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:826)
   at
 org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:627)
   at
 mcmipih.rules.rules.integration.drools.ExecutionContext.executeRuleFlow(ExecutionContext.java:54)
   at
 mcmipih.rules.demo.service.DemoRuleService.validerRumList(DemoRuleService.java:50)
   at
 mcmipih.rules.demo.service.DemoRuleService$$FastClassByCGLIB$$beeddc5a.invoke(generated)
   at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149)
   at
 org.springframework.aop.framework.Cglib2AopProxy$CglibMethodInvocation.invokeJoinpoint(Cglib2AopProxy.java:693)
   at
 org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:139)
   at
 org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:107)
   at
 org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:161)
   at
 org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:628)
   at
 mcmipih.rules.demo.service.DemoRuleService$$EnhancerByCGLIB$$961244c9.validerRumList(generated)
   at
 mcmipih.rules.demo.controller.ValidationAppController$ActionValiderSelectionLst.actionPerformed(ValidationAppController.java:185)
   at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
   at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
   at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
   at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
   at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown
 Source)
   at java.awt.Component.processMouseEvent(Unknown Source)
   at javax.swing.JComponent.processMouseEvent(Unknown Source)
   at java.awt.Component.processEvent(Unknown Source)
   at java.awt.Container.processEvent(Unknown Source)
   at java.awt.Component.dispatchEventImpl(Unknown Source)
   at java.awt.Container.dispatchEventImpl(Unknown Source)
   at java.awt.Component.dispatchEvent(Unknown Source)
   at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
   at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
   at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
   at java.awt.Container.dispatchEventImpl(Unknown Source)
   at java.awt.Window.dispatchEventImpl(Unknown Source)
   at java.awt.Component.dispatchEvent(Unknown Source)
   at java.awt.EventQueue.dispatchEvent(Unknown Source)
   at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)
   at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
   at 

Re: [rules-users] check dups

2007-08-31 Thread Tim . Nguyen
Thanks Edson

The trick is that I have to use the list :(. So I iterate the list, then
insert individual Reference object to the Working memory before I check if
any dups, but no luck




Best Regards,
Tim Nguyen



   
 Edson Tirelli   
 [EMAIL PROTECTED] 
   To 
 Sent by:  Rules Users List  
 rules-users-bounc rules-users@lists.jboss.org   
 [EMAIL PROTECTED]  cc 
 g 
   Subject 
   Re: [rules-users] check dups
 08/31/2007 10:01  
 AM
   
   
 Please respond to 
 Rules Users List  
 [EMAIL PROTECTED] 
   s.jboss.org
   
   





Tim,

Your rule expects to get Reference objects from the working memory, and
they are not there, since you are adding a List of them and not them.
Insert individual references and it will work.

[]s
Edson

2007/8/31, [EMAIL PROTECTED] [EMAIL PROTECTED]:


  Here is my test

  Reference ref_test2 = new Reference();
  ref_test2.setReferenceType(new ReferenceType(MISC));
  ref_test2.setReferenceValue(111222);

  Reference ref_test3 = new Reference();
  ref_test3.setReferenceType(new ReferenceType(MISC));
  ref_test3.setReferenceValue(111222);

  references.add(ref_test2);
  references.add(ref_test2);



  final StatefulSession session =
  ruleBase.newStatefulSession();
  session.insert(references);
  session.fireAllRules();



  Thanks!
  Tim



   Edson Tirelli
   [EMAIL PROTECTED]
   
  To
   Sent by:  Rules Users List
   rules-users-bounc rules-users@lists.jboss.org
   [EMAIL PROTECTED]
  cc
   g

  Subject
 Re: [rules-users] check dups
   08/31/2007 08:57
   AM


   Please respond to
   Rules Users List
   [EMAIL PROTECTED]
 s.jboss.org 







 Hey Tim,

 Can you please provide a self contained test case? There is no reason
  why it would not work.

 Thanks
  Edson

  2007/8/31, [EMAIL PROTECTED] [EMAIL PROTECTED]:


Hi List,

I'd like to check if any duplicate exists in my collection as below:

rule check Duplicate
  when
ref1: Reference ($type1: referenceType, $value1:
referenceValue)
ref2: Reference (this != ref1, referenceType ==
$referenceType,
referenceValue == $value1)

  then
 errorHandler.record(Duplicate Reference is not
  allowed.);
end


Both my referenceType and referenceValue are String. I didn't get any
error
but it didn't work. Any idea?
I am using 4.01 GA


Thanks,
Tim

___
rules-users mailing list
 rules-users@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
  ___
  rules-users mailing list
  rules-users@lists.jboss.org
  https://lists.jboss.org/mailman/listinfo/rules-users


  ___
  rules-users mailing list
  rules-users@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
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users



[rules-users] in 4.0.1 this required in nested accessors?

2007-08-31 Thread Manukyan, Sergey

Folks,

I Started using 4.0.1,

Regarding nested accessors, looks like they work, but they require to
put this at the beginning.

So rule

when
TestSupplier(testBusiness.statusActive == true)  -- FAILS

When
TestSupplier(this.testBusiness.statusActive == true)  -- OK!

It fails with the following exception:

org.drools.rule.InvalidRulePackage: Unable to determine the used
declarations : [Rule name=HQ To Active From Probation. Mfg On Probation
Exists., agendaGroup=MAIN, salience=10, no-loop=false]

at org.drools.rule.Package.checkValidity(Package.java:419)


Please confirm this to be a bug and then I will open JIRA for this, or
please let me know the reason behind this functionality,

Thanks,

-Sergey


**
** LEGAL DISCLAIMER **
**

This E-mail message and any attachments may contain 
legally privileged, confidential or proprietary 
information. If you are not the intended recipient(s),
or the employee or agent responsible for delivery of 
this message to the intended recipient(s), you are 
hereby notified that any dissemination, distribution 
or copying of this E-mail message is strictly 
prohibited. If you have received this message in 
error, please immediately notify the sender and 
delete this E-mail message from your computer.

___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


[rules-users] Re: [rules-dev] Drools vs JRules Performance and Future RD

2007-08-31 Thread Mark Proctor
To help drive a bit more traffic, if you liked this article, could you 
please vote for it on diggit and dzone :)

http://www.dzone.com/links/jboss_drools_vs_ilog_jrules_performance_and_futur.html
http://digg.com/software/JBoss_Drools_vs_ILog_JRules_Performance_and_Future_R_D

Thanks

Mark
Mark Proctor wrote:
http://blog.athico.com/2007/08/drools-vs-jrules-performance-and-future.html 



Mark
___
rules-dev mailing list
[EMAIL PROTECTED]
https://lists.jboss.org/mailman/listinfo/rules-dev



___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


[rules-users] LHS functions not in eval()...

2007-08-31 Thread wasabifan

I am trying to write a function that takes a numeric value and returns a
string.  Basically, I have a numeric number I need to match to a string
number (so I need to convert one to the other type).  I wrote a function to
do this, but it only seems to work in the RHS or inside an eval().

Is there a way to convert numerics to strings (or vice-versa) in the LHS not
in an eval?  Or is a big function inside the eval() the only way to do this?

Thanks,
Bryan
-- 
View this message in context: 
http://www.nabble.com/LHS-functions-not-in-eval%28%29...-tf4362273.html#a12433462
Sent from the drools - user mailing list archive at Nabble.com.

___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users