Re: [rules-users] Rules with C++

2011-04-13 Thread Corneil du Plessis
You have different options but the choice will depend on your 
performance requirements and runtime environment.


Remove service
You can consume a service in C++ using Rest, SOAP or Corba. This service 
will be developed using Java and Drools. You could also investigate the 
Drools Server for options of remote invocation.


Local Component
You can use JNI to invoke C/C++ from Java or Java from C/C++
You can make a JavaBean available as an ActiveX component


On 13/04/2011 11:05, Sumeet Karawal wrote:



Hi All,

I have my application written in C++. How can I use Drools to make rules
that work on C++ facts. Also How to use BRMS in this case?
It would be very helpful if somebody could guide me on this.


Thanks and Regards,
Sumeet Karawal

Mailto: sumeet.kara...@tcs.com

=-=-=
Notice: The information contained in this e-mail
message and/or attachments to it may contain
confidential or privileged information. If you are
not the intended recipient, any dissemination, use,
review, distribution, printing or copying of the
information contained in this e-mail message
and/or attachments to it are strictly prohibited. If
you have received this communication in error,
please notify us by reply e-mail or telephone and
immediately and permanently delete the message
and any attachments. Thank you



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


--

Corneil du Plessis - Software Architect

TSC Technologies (Pty) Ltd
(o) +27 11 431 1666
(f) +27 86 674 2962
(c) +27 82 530 9259
Email: corn...@tsctech.com mailto:corn...@tsctech.com
www.tsctech.com http://www.tsctech.com
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Expose JBoss rules as webservice

2011-02-17 Thread Corneil du Plessis

The short high-level answer is:

You can use JBoss Tools or Eclipse plugins for Drools to create various 
kinds of rules.

You can use JBoss Drools Guvnor to manage rules and create rules.

Before you can create rules you need to provide a data model of some 
kind, typically a collection of Java classes that will be the 'facts' 
that rules are applied to.


In order to execute rules you initialise working memory with rules and 
facts and the rules are fired.


This implies that a lot of what happens is specific to your data model. 
Thus you will have to develop that code that decides how your model 
interacts with the rules.


Drools provides an agent that can interact with Drools Guvnor to 
retrieve the rules instead of using some local storage.
Your code will have to initialise the agent and then rules will be 
retrieved from Guvnor and executed locally.


You can also use integration tools like Apache Camel or Spring 
Integration and invoke Drools from within an integration flow.
Drools Server provides remote execution of rules via a RESTful API and 
other mechanisms for Apache Camel.


Hope this gives you some direction.

On 17/02/2011 11:38, vkishorekumar wrote:

Hi Travis,

Thank you for the prompt response. So if that is the case, say if I use
JBoss BRMS, how do I make my rules available to the external world (if not
through webservice)? Is a GUI the only way to access the business rules?
There must be some programmatic way of accessing the JBoss rules.

Sorry for confusing you with the Drools server, because I am myself confused
with the architecture as in where will Drools fit in and where will JBoss
BRMS fit in? All I need is to implement business rules using JBoss product.

Thanks  Regards
Kishore


--

Corneil du Plessis - Software Architect

TSC Technologies (Pty) Ltd
(o) +27 11 431 1666
(f) +27 86 674 2962
(c) +27 82 530 9259
Email: corn...@tsctech.com mailto:corn...@tsctech.com
www.tsctech.com http://www.tsctech.com
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Rewriting rules

2011-02-09 Thread Corneil du Plessis
You should consider changing your rules to use the data as facts which 
are inserted into working memory or loaded by some of the rules.


If you can provide some sample rules it might be possible to suggest 
alternate options.


On 09/02/2011 16:06, jwillans2 wrote:

Hello,

We have a rule set that need to be rewritten before being loaded into the
knowledge base.  The rewrite can only be determined by data known at
runtime.  Currently we can achieve this by performing string subsitutions on
the rules, however I'd like to explore more efficient (and less clumsy) ways
of doing this.

It looks like rule templates could be a less error-prone way of achieving
the same end through the use of place holders, but it still requires for the
resultant rule strings to be recompiled.  I was wondering whether it is
practical to store the rules in compiled form, and then perform the
rewriting on the loaded data structures?  Any suggestions and/or experience
of techniques would be very welcome.

Thanks,

James


--

Corneil du Plessis - Software Architect

TSC Technologies (Pty) Ltd
(o) +27 11 431 1666
(f) +27 86 674 2962
(c) +27 82 530 9259
Email: corn...@tsctech.com mailto:corn...@tsctech.com
www.tsctech.com http://www.tsctech.com
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Drools Java and .Net

2011-01-31 Thread Corneil du Plessis

We have successfully used IKVM to create a dlls for our Drools application.

The performance was a bit slower on IKVM/.Net as in Sun Java 5.
We dynamically load a large number of rules and found the largest impact 
is to the 'load time'


The performance impact was not such that it would make a network call 
viable; especially with 1000s of clients.


Apart from the performance impact the behaviour is exactly the same.

On 25/01/2011 17:04, FrankVhh wrote:

Hi all,

Suppose that you have a rule engine that needs to be embedded on the machine
and that there is no way to call the rules as a service from a centralized
server, what approach would one have to choose to make Drools and .NET work?

The rulke engine will have to be cached to improve performance, so that
part, until there is an up-to-date version of Drools.NET, has to be in Java
anyway. Then you expose your JAVA code as a (local) service and let .NET
call it? Or am I seeing things wrong here?

I must stipulate that I am not an expert in .NET at all, and I know only
barely enough Java to get Drools working :-).

Thanks for your help.

Kind regards,
Frank


salaboy wrote:

Yes, and if you want to use the rule engine from .NET you can use the
Drools
Server that expose the Drools Runtime in REST and SOAP interfaces :)
Greetings.

2011/1/19 Michael Anstismichael.ans...@gmail.com


Hi,

I believe the .NET implementation of Drools is somewhat out dated.

However Drools ticks all your other requirements.

With kind regards,

Mike

2011/1/19 Gorantla, Bhaskar (GE Capital)bhaskar.goran...@ge.com


We are looking for a rules engine that has the following
characteristics.



1.   Supports both Java and .net

2.   Provides a business user friendly UI for creating/editing rules

3.   Supports versioning

4.   The rues in the rules repository are accessible to both Java
and
.net applications – Nice to have



Do you know whether Drools supports all the above?



Thanks



___
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




--
  - CTO @ http://www.plugtree.com
  - MyJourney @ http://salaboy.wordpress.com
  - Co-Founder @ http://www.jbug.com.ar

  - Salatino Salaboy Mauricio -

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




--

Corneil du Plessis - Software Architect

TSC Technologies (Pty) Ltd
(o) +27 11 431 1666
(f) +27 86 674 2962
(c) +27 82 530 9259
Email: corn...@tsctech.com mailto:corn...@tsctech.com
www.tsctech.com http://www.tsctech.com
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] How to Analyze Rule Test Coverage?

2011-01-21 Thread Corneil du Plessis
Your can use the various EventListeners like ProcessEventListener to 
collect statistics about rule execution while your tests are executing.

On 21/01/2011 11:58, hyjshanghai wrote:
 I am now using Cobertura to evaluate the test coverage on my Java
 application.
 However, Drools rules are not counted by Cobertura, because classes for
 rules are dynamically created and therefore not instrumented by Cobertura
 for static analysis.

 How can we automatically analyze the test coverage on Drools rules?
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Speed up inserting of rules into knowledge base

2011-01-07 Thread Corneil du Plessis

You should only repeat

knowledgeBuilder.add(resource, ResourceType.DRL);

for each rule.

The next thing you can do is to serialize the compiled rule packages.

You should also consider using Guvnor to manage your rules.

On 07/01/2011 14:05, Piotr Jedrychowski wrote:

Hello.

I'm loading a big amount of rules during starting of JBoss (2 
rules). All rules (in string format) are available before JBoss 
startup - they are stored into database. Rules are loaded one by one 
and it takes about 90 minutes. I want to speed up this process. Is 
there something like bulk load for inserting rules into knowledge 
base or another smart way to fast loading a big amount of rules?


I'm using:
1) Drools 5.1
2) JBoss 4.2.3

My source code looks like this:

String rule = ...
Resource resource = ResourceFactory.newReaderResource(new 
StringReader(rule));
KnowledgeBuilder knowledgeBuilder = 
KnowledgeBuilderFactory.newKnowledgeBuilder();

knowledgeBuilder.add(resource, ResourceType.DRL);
knowledgeBase.addKnowledgePackages(knowledgeBuilder.getKnowledgePackages());

Regards,
Piotr


___
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] Speed up inserting of rules into knowledge base

2011-01-07 Thread Corneil du Plessis

you may reconsider the structure of the rules.

Push instead of pull. This means compare the file time or content to the 
database and only recreate rules that have modified. This way you can 
update the serialized packages where appropriate.


Without knowing what your rules looks like I can offer the following:
Consider using decision tables where the rules are similar but based on 
data.
Consider having rules that to retrieve the data instead of rules 
generated from the data.

Consider that some of the data may be facts and not rules.

If you can generate rules from data then you can write rules that use 
the data as facts.


On 07/01/2011 16:16, Piotr Jedrychowski wrote:

Part:
knowledgeBuilder.add(resource, ResourceType.DRL);
is the most expensive part of my source code - rest of instructions 
are nothing when you compare them to above line.


I cannot serialize the compiled rule packages because rules are 
generated from data read from database and this data isn't static. 
Data is generated before loading rules from files that user can change 
- so I have to do this:

1) read files (which could be changed by user since last JBoss startup)
2) process files and generate rows for database
3) get rows from database and generate rules for Drools

Rules aren't stored directly into database - I wasn't accurate in my 
previous e-mail. - sorry.




On 2011-01-07 14:00, Corneil du Plessis wrote:

You should only repeat

knowledgeBuilder.add(resource, ResourceType.DRL);

for each rule.

The next thing you can do is to serialize the compiled rule packages.

You should also consider using Guvnor to manage your rules.

On 07/01/2011 14:05, Piotr Jedrychowski wrote:

Hello.

I'm loading a big amount of rules during starting of JBoss (2 
rules). All rules (in string format) are available before JBoss 
startup - they are stored into database. Rules are loaded one by one 
and it takes about 90 minutes. I want to speed up this process. Is 
there something like bulk load for inserting rules into knowledge 
base or another smart way to fast loading a big amount of rules?


I'm using:
1) Drools 5.1
2) JBoss 4.2.3

My source code looks like this:

String rule = ...
Resource resource = ResourceFactory.newReaderResource(new 
StringReader(rule));
KnowledgeBuilder knowledgeBuilder = 
KnowledgeBuilderFactory.newKnowledgeBuilder();

knowledgeBuilder.add(resource, ResourceType.DRL);
knowledgeBase.addKnowledgePackages(knowledgeBuilder.getKnowledgePackages());

Regards,
Piotr


___
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 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] QA features in BRMS

2010-12-30 Thread Corneil du Plessis
We did a project where we developed a rule console to manage the 
lifecycle of rules by managing unit-tests and scenario tests and 
executing those on rule changes to ensure deployed rules pass the tests.



On 30/12/2010 15:03, Benson Fung wrote:
Yes, I tried QA analysis.  But it only can find out the problems of 
the individual rules like what you said.  I tried to develop two rules 
with sames conditions but different consequences and do the QA 
analysis, it cannot detect it unfortunately.  :(





2010/12/30 Esteban Aliverti esteban.alive...@gmail.com 
mailto:esteban.alive...@gmail.com


I think QA analysis should find some of those problems. Did you
try it? As far as I know, it looks for range completeness, missing
gaps, etc.

Best Regards,



Esteban Aliverti
- Developer @ http://www.plugtree.com http://www.plugtree.com
- Blog @ http://ilesteban.wordpress.com


2010/12/30 Wolfgang Laun wolfgang.l...@gmail.com
mailto:wolfgang.l...@gmail.com

The general case would be extremely difficult to solve. It
would require heavy expression manipulation. Consider a very
simple variation:
   X($f: foo)
   Y(bar == $f)
as compared to
   Y($b: bar)
   X(foo == $b)

And you can play this game at any level of complexity.

And even your straightforward case would require the
consideration of rule attributes, since there would not be a
conflict if they are in different agenda groups, etc.


-W



2010/12/30 Benson Fung benson.red...@gmail.com
mailto:benson.red...@gmail.com:
 The conflict is like :

 E.g.
 If (X = 90) then Score = 10;
 If (X = 90) then Score = 100;

 Can the BRMS detect this?



 On Thu, Dec 30, 2010 at 5:52 PM, Wolfgang Laun
wolfgang.l...@gmail.com mailto:wolfgang.l...@gmail.com
 wrote:

 Please define conflict.
 -W

 2010/12/30 Benson Fung benson.f...@redhat.com
mailto:benson.f...@redhat.com:
  I would like to check if there is any conflict among the
created rules
  in
  the BRMS 5.1.  Can the QA/Verify can check this out?
 
 
 
  On Thu, Dec 30, 2010 at 5:24 PM, Wolfgang Laun
wolfgang.l...@gmail.com mailto:wolfgang.l...@gmail.com
  wrote:
 
  Please don't assume that everybody knows which
features and
  which conflicts and which checks you have in mind.
  -W
 
  2010/12/30 Benson Fung benson.red...@gmail.com
mailto:benson.red...@gmail.com:
   Hi,
  
   Can anyone know whether QA features can provide the
rule conflict
   checks?
  
  
   Thanks
  
   ___
   rules-users mailing list
   rules-users@lists.jboss.org
mailto:rules-users@lists.jboss.org
   https://lists.jboss.org/mailman/listinfo/rules-users
  
  
  ___
  rules-users mailing list
  rules-users@lists.jboss.org
mailto:rules-users@lists.jboss.org
  https://lists.jboss.org/mailman/listinfo/rules-users
 
 
 
  --
  Benson Fung
  Solution Architect, Global Services, Greater China
  | Redhat Hong Kong Limited || 45/F., The Lee Gardens, 33
Hysan Avenue,
  Causeway Bay, Hong Kong || Office : 852-31802332 || Cell
: 852-98369898
  ||
  benson.f...@redhat.com mailto:benson.f...@redhat.com ||
http://www.hk.redhat.com||
 
  ___
  rules-users mailing list
  rules-users@lists.jboss.org
mailto:rules-users@lists.jboss.org
  https://lists.jboss.org/mailman/listinfo/rules-users
 
 

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


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




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



___
rules-users mailing list
rules-users@lists.jboss.org 

Re: [rules-users] Urgent..Dynamic nature of rules

2010-11-23 Thread Corneil du Plessis
Look at examples for Rule Agent and Guvnor.

On 23/11/2010 18:00, nkumar wrote:
 Hi,

 Is there any way to get the rules from external source rather than loading
 this from .drl file every time? because of changing behavior of the rules,
 rule file has to be changed if a user introduces a new rule in the system.
 Please help me out how can we solve this. i am new to drools and even i
 don't know how to write rules properly. Can we store this in a database or
 can we save rules somewhere so that next time rather than loading this from
 direct rule file, we load this from that data source. User of this
 application is non technical and i also need to make an interface to get the
 rules in plane English which will convert those into rules accordingly.
 Guvnor is not much user friendly. Can anyone please help me out. My deadline
 is near.

 this is the structure of the rule which i need to make after loading the
 data.

  when
  b:Feature(featureClass.name==FrontSuspension)
  c:Feature(featureClass.name==FrontAxle)
  eval(b.attributes.Capacity=c.attributes.Capacity)
  then
  AvailabilityRuleState s = new
 AvailabilityRuleState();
  s.setValue(A);//Available
  s.setReason();
  s.setReference(FA-FS:1);
  resultState.add(s);
  end


 Please help me out. i will really appreciate your help.

 Thanks

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


Re: [rules-users] New project is Drools Engine suitable for it ?

2010-10-26 Thread Corneil du Plessis
You have to consider the number of users and the frequency of rule changes.

The persistent rules are combined at runtime into a ruleset used by the 
engine. Multiple sessions can be executed from a ruleset.

If the User-specific rules are added to a the global rules in such a way 
that the criteria identifying the User is part of the matching criteria 
for the rule you could have a single ruleset for all users.

There is an overhead to the initialization of rules which means that if 
performance is important you would do better to maintain a single 
ruleset at runtime.
If the ruleset is invalidated frequently by changes to rules then it 
would be better to maintain a ruleset per User and build the ruleset on 
demand and cache the ruleset.

On 2010-10-26 11:36, Gregory Czerwinski wrote:
 Question about Drools usage ?


 Hello All.

 I have question about using Drools in my new project. I have this kind of
 scenario to fufill with rules engine.

 Scenarios.

 Each user  has  it own set of rules that determine if he should be notified
 about event,
 and those are fully editable by system administrators.
 There are also global rules indicating that User should be notified – common
 for all users.

 My question is how to use Drools engine in this concert situation, as it is
 not global set of rules that can be putted once in to engine, but set of
 changing per User rules ?

 Thanks for help : )


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


Re: [rules-users] Welcome to the rules-users mailing list

2010-02-21 Thread Corneil du Plessis
You are expecting map values to be elevated somehow from Object to Integer
and String.
By using typed attributes in the Person class you can overcome your problem.

Sent from my HTC (Android)

On Feb 21, 2010 9:28 PM, Adam Krieg spamcont...@mac.com wrote:

I’m new to Drools and having trouble accessing my Domain object which is
basically a container around a map.

class Person {
   Map props;
   public Map getProps();
…. Extra stuff
}


I want to create a rule that will match when Age is greater than 20 and name
is one of “Fred”, “Barney”, or “Wilma”.  These  entries are stored in the
Map props, so that to get age, you would call person.getProps().get(“AGE”)



rule My Rule
   dialect mvel
   when
   $person : Person(
   props[“AGE”]  20,
   props[“NAME”] memberOf [“Fred”, “Wilma”,
“Barney”]
   )
   then
   System.out.println(found match”+$person);

End

But I am running into a parsing error:
no viable alternative at input ')' in rule My Rule in pattern Person.

The second condition seems to be the problem.  Can I check for membership
inside a List I create inline in mvel?


___
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] Weblogic rules to Drools rules.

2010-01-30 Thread Corneil du Plessis
It seems as if your rules will fit nicely into a decisiontable.

Sent from my HTC (Android)

On Jan 30, 2010 7:58 PM, kashif10 kash...@yahoo.com wrote:


Thanks edson for you nice advise.
It really reduce the memory uage from 400 mb 70 mb..

 compareDiagnosis(  valueName[0] in (Heart Failure) ||
 (valueCode[0] in
(402.01,402.11,402.91,402.01,402.03,402.11,402.13,402.91,402.93,
428.0 - 428.9) , valueCodeSystem[0] == 2.16.840.1.113883.6.2 ))


Here I have some questions.

i) we have to iterate whole valueName not only [0]. How we can do it.

ii) we have not only simple valueCode matching, we can have
  a) Range in code such as 428.0 - 428.9, so any thing in WM having
valueCode b/w this range should match.
  b) but we can't use simply numbers , we have to use String as we can have
code having alphabet such as V32.4
   c) we can have wild card usage too. e.g code in Rule can be V2* which
can be match any thing at the place opf asterik in WM valuCodes.

 I see that Rule engine do introspection  call get methods of the fields 
can do simple condition maching like ==, , etc.  But mostly we have some
complex logic in matching like I told you in pt ii) of valuecode matching.
I think only sol is to call methods which will comes inside eval()  If we
start usig it for long rules. rules will never load  stuck :(...

Need your expet  advise for those long  complex rules.

Thanks


--
View this message in context:
http://n3.nabble.com/Weblogic-rules-to-Drools-rules-tp126265p178895.html

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] Comparing Date values in Iteration for Decision Table

2010-01-29 Thread Corneil du Plessis
(m1.startDate.timem1.LDOS.time)

java.util.Date has a property named time which is a long and works great
for comparisons

On Fri, 2010-01-29 at 04:30 -0800, Tushar wrote:

 Hi,
 I am new to drools and just started to understand it. I am trying to use
 Decision Table for my project, one of my requirement is to compare dates say
 fromDate and endDate from a POJO. I wonder if its possible to have something
 like this 
 
 d:DroolsRequestResponse m1:majorLine
 (m1.startDatem1.LDOS) from m1
 
 in my CONDITION
 
 or can i have dynamic values of parameter in the cell for each iteration.
 
 here is my excel screenshot
 http://n3.nabble.com/file/n143474/rules.jpg 
 
 Regards,
 Tushar.
 
 
 
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Is there a limit to the size of a rule?

2010-01-29 Thread Corneil du Plessis
Rules can be seen as code. If you have rules that are very complex you are
going to have issues maintaining the rule before you run into limitations of
engine or jvm.

The idea is to keep rules as simple as possible.
There are various mechanisms for dealing with rule complexities like DSL,
decision tables and rule flow

Sent from my HTC (Android)

On Jan 29, 2010 8:58 PM, Sesh sveerar...@hotmail.com wrote:


For a given rule, is there a limit to the size of the eval condition? Or are
there any size considerations that one should take into account (such as max
number of rules, max size of a rules file)?
Thank you.
Sesh
--
View this message in context:
http://n3.nabble.com/Is-there-a-limit-to-the-size-of-a-rule-tp143996p143996.html
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 mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Hashmap in rules

2010-01-06 Thread Corneil du Plessis
HashMap does not have a member called bioAnswers.

Sent from my HTC (Android)

On Jan 6, 2010 4:33 PM, Da Sun sund...@hotmail.com wrote:

 I got a CompileException when run the following rule.

when
bioAnswers:HashMap(bioAnswers.values[HEARING] == Y)
reviewMsgs:LinkedList(size = 0)
then
reviewMsgs.add(Hearing);


It will be very helpful is anyone of you rectify my mistake.

Thanks,

--
Your E-mail and More On-the-Go. Get Windows Live Hotmail Free. Sign up
now.http://clk.atdmt.com/GBL/go/196390709/direct/01/

___
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] How to call a another drl file from one drl file

2009-07-08 Thread Corneil du Plessis
If you want to control the order of execution or rules you will have to
look into agendas or ruleflow.

On Thu, 2009-07-02 at 15:36 +0530, Amila Silva wrote:

 hi,
I have requirement to execute a chain of rules. One rule after
 another and they are reusable.I need to know how to call another drl
 file from a drl file. or in a then part of the 
a rule.
 
 thanks
 Amila Silva
 
 
 ___
 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] Drolls 4.0.7 exception org.drools.RuntimeDroolsException: org.drools.base.mvel.mvelevalexpress...@1cf7491 while using matches operator

2009-06-29 Thread Corneil du Plessis
Your rule should be written as:
ruleCPR_RULE_22 
dialect mvel
when
INDUD : ContactVO(districtCode matches 
((UX)[ACMR][[A-Z0-9]]{3})|([A-Z0-9]++))
then
   System.out.println(hello);

end

Code inside of eval is normal Java expressions.

On Sat, 2009-06-27 at 00:53 +0530, Kumar, Ravendra wrote:
 Hi All, 
 
  
 
  
 
  I am using Drools 4.0.7 and when I tried to use “matches” operator it
 is giving following  exception
 
 The rule logic is following
 
  
 
 package com.logica.heca.lpr.rule;
 
 import com.logica.heca.lpr.domain.*;
 
 import com.logica.heca.lpr.domain.contact.*;
 
 import com.logica.heca.lpr.domain.ruleengine.*;
 
 import java.util.*;
 
 ruleCPR_RULE_22
 
 dialect mvel
 
 when
 
INDUD : ContactVO();
 
eval(INDUD.districtCode matches
 ((UX)[ACMR][[A-Z0-9]]{3})|([A-Z0-9]++))
 
then
 
  
 
System.out.println(hello);
 
 End
 
  
 
 Note: INDUD.districtCode returns String value.
 
  
 
 While  if I changed matches operator to java method this work fine
 
 eval(INDUD.getDistrictCode().matches(((UX)[ACMR][[A-Z0-9]]{3})|([A-Z0-9]++)));
 
  
 
 any of your esteemed help will highly be appreciated
 
  
 
 Thanks
 
 Ravendra Kumar
 
 -
 
  
 
 org.drools.RuntimeDroolsException:
 org.drools.base.mvel.mvelevalexpress...@1cf7491 :
 java.lang.ClassCastException: java.lang.String cannot be cast to
 java.lang.Boolean
 
 at
 org.drools.rule.EvalCondition.isAllowed(EvalCondition.java:82)
 
 at
 org.drools.reteoo.EvalConditionNode.assertTuple(EvalConditionNode.java:148)
 
 at
 org.drools.reteoo.SingleTupleSinkAdapter.createAndPropagateAssertTuple(SingleTupleSinkAdapter.java:55)
 
 at
 org.drools.reteoo.LeftInputAdapterNode.assertObject(LeftInputAdapterNode.java:116)
 
 at
 org.drools.reteoo.SingleObjectSinkAdapter.propagateAssertObject(SingleObjectSinkAdapter.java:22)
 
 at
 org.drools.reteoo.ObjectTypeNode.assertObject(ObjectTypeNode.java:162)
 
 at org.drools.reteoo.Rete.assertObject(Rete.java:175)
 
 at
 org.drools.reteoo.ReteooRuleBase.assertObject(ReteooRuleBase.java:192)
 
 at
 org.drools.reteoo.ReteooWorkingMemory.doInsert(ReteooWorkingMemory.java:71)
 
 at
 org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:911)
 
 at
 org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:883)
 
 at
 org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:684)
 
 at
 org.drools.reteoo.ReteooStatelessSession.execute(ReteooStatelessSession.java:143)
 
 at
 com.logica.heca.lpr.rule.RuleTester.main(RuleTester.java:44)
 
 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:597)
 
 at
 com.intellij.rt.execution.application.AppMain.main(AppMain.java:90)
 
 Caused by: java.lang.ClassCastException: java.lang.String cannot be
 cast to java.lang.Boolean
 
 at
 org.drools.base.mvel.MVELEvalExpression.evaluate(MVELEvalExpression.java:42)
 
 at
 org.drools.rule.EvalCondition.isAllowed(EvalCondition.java:77)
 
 ... 18 more
 
  
 
 -
 
  
 
 Thanks and Regards,
 
  
 
 Ravendra kumar
 
 IT Consultant
 
 __ 
 Logica- Releasing your potential
 
  
 
 Margrethepladsen 4, 8000 Århus C
 Danmark 
 T: +45 2518 8864
 E-mail: ravendra.ku...@logica.com
 www.logica.dk
 
  
 
 
 
 Please help Logica to respect the environment by not printing this
 email / Pour contribuer comme Logica au respect de l'environnement,
 merci de ne pas imprimer ce mail / Bitte drucken Sie diese Nachricht
 nicht aus und helfen Sie so Logica dabei die Umwelt zu schuetzen / Por
 favor ajude a Logica a respeitar o ambiente não imprimindo este
 correio electrónico. This e-mail and any attachment is for authorised
 use by the intended recipient(s) only. It may contain proprietary
 material, confidential information and/or be subject to legal
 privilege. It should not be copied, disclosed to, retained or used by,
 any other party. If you are not an intended recipient 

[rules-users] Simple rule worked in 4.0.7 and failed in 5.0.1

2009-06-25 Thread Corneil du Plessis
I ran into some problems where a fairly simple rule fails in 5.0.1 and
worked in 4.0.7.

I have created an issue on JIRA
https://jira.jboss.org/jira/browse/JBRULES-2136 and was wondering if
someone else has come across that same type of problem.

The rule is:


package org.drools.rules.test
import org.drools.rules.test.SimpleStringType
rule SimpleKeywordTest
dialect java 
when
$_theFact : SimpleStringType( stringValue matches 
.*\s(ADDR)\s.*|(ADDR)\s.*|.*\s(ADDR) )
then
$_theFact.setValid(false);
end


Whenever the stringValue contains something like 'MY ADDR' the rule
should fire but it doesn't in 5.0.1 

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


Re: [rules-users] Simple rule worked in 4.0.7 and failed in 5.0.1

2009-06-25 Thread Corneil du Plessis
Txank you
On Thu, 2009-06-25 at 08:19 -0400, Edson Tirelli wrote:

 
I added a comment to the JIRA, but replicate it here for
 completeness:
 
 =
 Due to some limitations on the way that Drools 4 handles regexps, we
 had to change the default escaping syntax for regexps, from single
 escape to double escape. In Drools 5, regexps work exactly like in
 Java. So, instead of doing:
 
 .*\s(ADDR)\s.*|(ADDR)\s.*|.*\s(ADDR)
 
 You need to write:
 
 .*\\s(ADDR)\\s.*|(ADDR)\\s.*|.*\\s(ADDR)
 
 If you would like to continue using regexps in the same way you did
 for Drools 4, i.e., with single escape (not recommended), there is a
 configuration that makes Drools 5 parse regexps as it did in Drools 4.
 Using the type safe API, you can do:
 
 KnowledgeBuilderConfiguration config =
 KnowledgeBuilderFactory.newKnowledgeBuilderConfiguration();
 config.setOption( ProcessStringEscapesOption.NO);
 KnowledgeBuider kbuilder =
 KnowledgeBuilderFactory.newKnowledgeBuilder( conf );
 
 If you prefer to use the property or configuration file, then it is:
 
 drools.parser.processStringEscapes = false
 ===
 
 []s
 Edson
 
 
 2009/6/25 Corneil du Plessis corn...@tsctech.com
 
 I ran into some problems where a fairly simple rule fails in
 5.0.1 and worked in 4.0.7.
 
 I have created an issue on JIRA
 https://jira.jboss.org/jira/browse/JBRULES-2136 and was
 wondering if someone else has come across that same type of
 problem.
 
 The rule is:
 
 
 package org.drools.rules.test
 import org.drools.rules.test.SimpleStringType
 rule SimpleKeywordTest
   dialect java 
 when
   $_theFact : SimpleStringType( stringValue matches 
 .*\s(ADDR)\s.*|(ADDR)\s.*|.*\s(ADDR) )
 then
   $_theFact.setValid(false);
 end
 
 
 Whenever the stringValue contains something like 'MY ADDR' the
 rule should fire but it doesn't in 5.0.1 
 
 Corneil
 
 
 ___
 rules-users mailing list
 rules-users@lists.jboss.org
 https://lists.jboss.org/mailman/listinfo/rules-users
 
 
 
 
 
 -- 
  Edson Tirelli
  JBoss Drools Core Development
  JBoss by 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] unable to determine value type class *** URGENT***

2009-06-12 Thread Corneil du Plessis


Srithu wrote:
 
 I have a wired behavior..
 
 I have a set of rules and i have used drools-guvnor to packaging them...
 It is working in windows machines where i have jboss which is running on
 IBM java 5 and 6..
 
 When i connect the same from  jboss Which is running on 64 bit IBM java 6
 on linux is not working...
 The same is working If i used 64 bit IBM java 5 on linux.
 
 
 I getting following exception...
 
 
 
 Please help
 
 [2009-02-11 12:30:29,697] [705980] [http-0.0.0.0-8080-12] [ERROR]
 [STDERR ] - org.drools.RuntimeDroolsException: unable to determine
 ValueType for Class [class java.lang.Object]
 
 [2009-02-11 12:30:29,698] [705981] [http-0.0.0.0-8080-12] [ERROR]
 [STDERR ] - at
 org.drools.base.ValueType.determineValueType(ValueType.java:193)
 
 [2009-02-11 12:30:29,698] [705981] [http-0.0.0.0-8080-12] [ERROR]
 [STDERR ] - at
 org.drools.base.ValueType.readResolve(ValueType.java:125)
 
 [2009-02-11 12:30:29,698] [705981] [http-0.0.0.0-8080-12] [ERROR]
 [STDERR ] - at
 sun.reflect.GeneratedMethodAccessor121.invoke(Unknown Source)
 
 [2009   -02-11 12:30:29,698] [705981] [http-0.0.0.0-8080-12]
 [ERROR] [STDERR ] - at
 sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
 
 [2009-02-11 12:30:29,698] [705981] [http-0.0.0.0-8080-12] [ERROR]
 [STDERR ] - at java.lang.reflect.Method.invoke(Method.java:599)
 
 [deleted stacktrace]
 
 
We are experiencing same issue on WebSphere 6.1 FP 23 on Linux and AIX.
Has anyone found a resolution?

Regards

Corneil

-- 
View this message in context: 
http://www.nabble.com/unable-to-determine-value-type-class--***-URGENT***-tp21950333p24000218.html
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] Help on using Drools with embedded objects

2009-02-23 Thread Corneil du Plessis
You should initialise your globals and then pass them into the session.
Your rule file will have:

global java.lang.String recipients
global java.lang.String to
global java.lang.String cc


On Mon, 2009-02-23 at 06:23 -0800, D1vy@@Ind1@ wrote:

 Thanks for your help , Sudhir, 
 
 I used 
 
 rule
 when $a:A(b.z.s==test);
 then
 end
 
 And that solved my problem.
 
 But I would like to know one more information about global variables.
 
 package...
 dialect java
 import ..,
 
 global java.lang.String recipients=di...@gmail.com
 global java.lang.String to=x...@yahoo.com
 global java.lang.String cc=a...@gmail.com
 
 rule
 when when $a:A(b.z.s==divya);
 then
 $a.setRecipients(recipients);
 $a.setTo(to);
 $a.setCC(cc);
 update($a)
 end
 
 Is this feasible with Drools. I get 
 
 unable to comile myfile.drl file
 [9,40]: unknown:9:40 mismatched token: [...@49,201:201='=',71,9:40];
 E
 
 exception. Could you please help me with this too.
 
 
 Thanks
 -D
 
 
 
 
 
 
 
 
 Sudhir M-2 wrote:
  
  Hi D,
  I don't know which version of drools are you using. If u are using drools
  4
  or higher you can use 'from'  to write rules on nested objects. All u need
  to do is insert the root pbject in the working memory
  
  Regards,
  sudhir.
  
  On Mon, Feb 23, 2009 at 2:56 PM, Divya Rajendranath 
  divya.rajendran...@gmail.com wrote:
  
  Hi,
 
  I am planning to use Drools - JBoss Rules Engine. My requirement is to
  disburse mails from my application to different groups based on various
  criteria. I want to use Drools here.
 
  My object structure is as follows:
 
  class A{
 
  String B = ;
 
  B b;
 
  C c;
  }
 
  Hence Obj A has embedded objects within it, and obj B and C further has
  embedded objects.
 
  class B {
 
  String X;
 
  Z z;
 
  }
 
  class Z{
 
  String t;
 
  String s;
 
  }
 
  The decision on sending the mails based on the fields in embedded objects
  of A. I pass instance of A to Drools
 
  Format of drl file:
 
  package...;
 
  import ..;
 
  rule Test
 
  when $a:A(B(Z(s == testvalue)))
 
  then
 
  $a.setSomething();
 
  update($a);
 
  end
 
  I wanted to know if this (accessing fields in embedded/child object) is
  feasible with Drools.
 
  I get an error saying UNable to compile myfile.drl when i try to fo
  this.
 
  Could some one look into this issue and let me know the reason for this ?
 
 
 
  Thanks
 
  -D
 
  ___
  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 mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


RE: [rules-users] RE: Deploying the BRMS on Web-Sphere 6.1

2008-09-23 Thread Corneil du Plessis
I never use the 0.0 versions of IBM products, avoid the headaches and wait
for at least the first fixpacks.
Our existing apps moved fine from 6.0 to 6.1.0.9, did not try Drools BRMS
though.

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Vikrant Yagnick
Sent: 23 September 2008 07:50
To: Rules Users List
Subject: RE: [rules-users] RE: Deploying the BRMS on Web-Sphere 6.1

Well it  is not that serious a problem as I initially thought. As I
mentioned the URL(adding the index.jsp) works, so there is an easy
work-around available.

The main bug seems to be that if a URL is sent to WebSphere which does not
have a physical file in it the filter which should kick in and re-direct
does not do so.
(http://www-01.ibm.com/support/docview.wss?rs=180uid=swg1PK27620)

This has nothing to do with the BRMS of course and is a problem for all
Web-Apps in this version of Websphere(We are using 6.1.0.0). Adding the
index.jsp to the URL seems to work fine for now. I am working on the BRMS to
see if there are any other side-effects of this.

Maybe, we should update a Wiki or troubleshooting doc on this so that it is
known to the community.

Digging around IBM Support after my post, I have found quite a few bugs
mentioned in version 6.1 regarding how Servlet Filters work and of some on
JSF(Especially JBOSS Seam) problems with the particular version.
(http://www-01.ibm.com/support/docview.wss?uid=swg1PK47367)

IBM has however provided patches for all of them and I am going to give
another shot at seeing the behavior after upgrading to a higher release.

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Michael Neale
Sent: Tuesday, September 23, 2008 5:25 AM
To: Rules Users List
Subject: Re: [rules-users] RE: Deploying the BRMS on Web-Sphere 6.1

Hi Vikrant.

well the drools-guvnor/ doesn't use a filter so much as it is default
web.xml behaviour - you can specify a welcome page, which it goes to when
the root path is supplied. If Websphere 6.1 can't even do that - I would say
something is seriously wrong (may be a bad install?) - you could try it with
a really simple war that just has 1 jsp and a web.xml and see if it happens
with it? although I think:

As for servlet filters - as we use Seam, it uses servlet filters to manage
lifecycles, so yes, that could be it (if its not the above). It isn't
possible to replace the filters, as they do a very different job from
servlets (although the difference is subtle).

What would be better would be to work out what the problem is with websphere
and filters I think.

On Mon, Sep 22, 2008 at 9:34 PM, Vikrant Yagnick [EMAIL PROTECTED]
wrote:
 Well it clearly is a problem with filters as the following works in
 WebSphere:



 http://localhost:9080/drools-guvnor/index.jsp



 However just typing



 http://localhost:9080/drools-guvnor does not and gives you the Ugly 500.





 Cheers,

 Vikrant



 From: Vikrant Yagnick
 Sent: Monday, September 22, 2008 4:38 PM
 To: Rules Users List
 Subject: Deploying the BRMS on Web-Sphere 6.1



 Hi All,



 Has anyone been able to deploy the BRMS War file on Websphere 6.1.  
 The BRMS deploys without problems , but I get the following error when 
 I try to access the BRMS:



 Error 500: 
 com.ibm.ws.wswebcontainer.extension.DefaultExtensionProcessor
 incompatible with com.ibm.wsspi.webcontainer.servlet.IServletWrapper.



 However, the WebDAV servlet still works.

 I dug around a little, and have found that this problem has occurred 
 for other web-applications as well who have provided a workaround:



 http://wiki.merbivore.com/pages/deploying-a-merb-application-to-a-jee-
 container-us
 (Read Step 7)



 The problem seems to be related to Servlet-Filters. These do not seem 
 to work correctly with Websphere 6.1.  In the site mentioned they have 
 replaced the servlet-filter with a normal server. (The BRMS seems to 
 use a servlet filter for /* url mapping).



 I have seen posts on other forums regarding the BRMS deployment on 
 Websphere
 6.1 but no answers as to how to make this work.



 Any, help would be appreciated.



 Cheers,

 Vikrant






 MASTEK LTD.
 Mastek is in NASSCOM's 'India Top 20' Software Service Exporters List.
 In the US, we're called MAJESCOMASTEK

 ~~
 
 Opinions expressed in this e-mail are those of the individual and not that
of Mastek Limited, unless specifically indicated to that effect. Mastek
Limited does not accept any responsibility or liability for it. This e-mail
and attachments (if any) transmitted with it are confidential and/or
privileged and solely for the use of the intended person or entity to which
it is addressed. Any review, re-transmission, dissemination or other use of
or taking of any action in reliance upon this information by persons or
entities other than the intended recipient is prohibited. This e-mail and
its 

RE: [rules-users] Intermediate conclusions using strings

2008-08-26 Thread Corneil du Plessis
I would rather use a class with an Enumeration representing the conclusion.

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of David Boaz
Sent: 25 August 2008 13:09
To: rules-users@lists.jboss.org
Subject: [rules-users] Intermediate conclusions using strings


Hi all,

I have an idea and I want to get the community feedback.

Many times there are many ways to reach an intermediate conclusion. This
conclusion can be used to derive higher level conclusions or actions.
For example, assuming a credit application has several (or) options to
conclude whether a parson is classified as gold member. Then, other rules
need this information to determine the credit limit for that member. To
note, the Person java class doesn't have a specialized attribute for the
classification. The classification is only an internal means to simplify the
application logic.
To solve that problem, I thought to insert a string conclusion to the WM.
Something like:

rule gold member if revenue per month  1000 
  when ...  
  then insert(gold member)
end

rule gold member if total amount  100
  when ...
  then insert(gold member)
end
...
rule r100
  when String(value==gold member)
  then...
end

* Is it an appropriate approach?
* I know it ugly to use the same string literal in various rules. Can we
avoid that?
* Is there a known mechanism to handle these cases?

Thanks, David
--
View this message in context:
http://www.nabble.com/Intermediate-conclusions-using-strings-tp19141834p1914
1834.html
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 mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


RE: [rules-users] Java code Vs Drools

2008-08-13 Thread Corneil du Plessis
Make sure when you do performance testing that you run through enough
iterations so that the engine code benefits from HotSpot. 

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Harsh Jetly
Sent: 13 August 2008 11:03
To: rules-users@lists.jboss.org
Subject: [rules-users] Java code Vs Drools 


I have been evaluating the rule engine (ie Drools 4.0.4). I have created an
application which has about 20 rules . I insert about 500 arraylists into
the working memory and each arraylist contains about 4 objects. The rule
engine picks the object that is the best match from the arraylist and stores
it .
This processing takes about 0.953 secs .

Now this very same scenario I have implemented in using java code (if
..else)...it takes about 0.016secs .

I was expecting the rule engine to give a better performance. Considering
the use of alpha node caching and other factors of the rete algorithm.

This is how one of the rules look in the rule file :

rule P1 110

salience 1
activation-group 1

  when
PriorityType( pricetype == 10,20,30,40,110 )
list :ArrayList(  )
t:TlbObjectAttributeData( lngAttrTypeId == 110 ) from list
  then
  result.add(t);

end


Am I doing something wrong or this application is not harnessing the pluses
of the rule engine .

If so can you please tell me which kind of application should I build to
highlight the performance of a rule engine .

Appreciate it


Regards
Harsh Jetly
SOA
Center of Excellence



__
___
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] Java code Vs Drools

2008-08-13 Thread Corneil du Plessis
No HotSpot refers to the portion of the JVM that compiles java bytecode to
native code and applies various optimisations over time depending on the
frequency with which code is executed.
 

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Hehl, Thomas
Sent: 13 August 2008 13:47
To: 'Rules Users List'
Subject: RE: [rules-users] Java code Vs Drools 

What does this mean? Because of garbage collection?

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Corneil du Plessis
Sent: Wednesday, August 13, 2008 5:42 AM
To: 'Rules Users List'
Subject: RE: [rules-users] Java code Vs Drools 

Make sure when you do performance testing that you run through enough
iterations so that the engine code benefits from HotSpot. 

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Harsh Jetly
Sent: 13 August 2008 11:03
To: rules-users@lists.jboss.org
Subject: [rules-users] Java code Vs Drools 


I have been evaluating the rule engine (ie Drools 4.0.4). I have created an
application which has about 20 rules . I insert about 500 arraylists into
the working memory and each arraylist contains about 4 objects. The rule
engine picks the object that is the best match from the arraylist and stores
it .
This processing takes about 0.953 secs .

Now this very same scenario I have implemented in using java code (if
..else)...it takes about 0.016secs .

I was expecting the rule engine to give a better performance. Considering
the use of alpha node caching and other factors of the rete algorithm.

This is how one of the rules look in the rule file :

rule P1 110

salience 1
activation-group 1

  when
PriorityType( pricetype == 10,20,30,40,110 )
list :ArrayList(  )
t:TlbObjectAttributeData( lngAttrTypeId == 110 ) from list
  then
  result.add(t);

end


Am I doing something wrong or this application is not harnessing the pluses
of the rule engine .

If so can you please tell me which kind of application should I build to
highlight the performance of a rule engine .

Appreciate it


Regards
Harsh Jetly
SOA
Center of Excellence



__
___
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 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] JSR-94 and JEE integration

2008-06-10 Thread Corneil du Plessis
We use JSR-94 and have a 'RuleLoader' that uses our rule definitions and a
velocity script to generate the rules and creates a ruleset from that.

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Hehl, Thomas
Sent: 10 June 2008 13:48
To: 'Rules Users List'
Subject: RE: [rules-users] JSR-94 and JEE integration

I know nothing about jsr-94, but we use drools in a webapp, servlet side
only.

It seems to me you could simply put your rules into a stateless session
bean.

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Knoster
Sent: Tuesday, June 10, 2008 4:46 AM
To: rules-users@lists.jboss.org
Subject: [rules-users] JSR-94 and JEE integration

Hi,
i would like to integrate drools in jee. to be more flexible i was loking at
jsr-94. as i suppose jsr-94 only addresses j2se environment, my question is:
how it is possible to use drools with this specs from an ejb3 session bean?
my thoughts about this brought me to the idea of injecting the
rules-administrator via resource annotation to prevent the container always
doing a class.forname(..) lookup. to define a j2se resource in a jee
container a jca might be the best way to integrate and to assure the jee
specs will not be violated. but this seams a lot of overhead to me.
how do u use drools in your jee applications when not relying on the brms?
any help or ideas on integrating drools with jsr-94 in jee would be great.

Knosta



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


RE: re[rules-users] -use of an object used in a previous rule

2008-06-10 Thread Corneil du Plessis
I can't see where you insert an object of type Alpha that would fire 'pack
eco' 

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Mounir Chattou
Sent: 10 June 2008 10:34
To: rules-users@lists.jboss.org
Subject: re[rules-users] -use of an object used in a previous rule


Hi,
I have a problem : a fact is inserted in a rule but when I cast for it in
another, nothing happened, here is a simplified code to understand better :

rule eco
ruleflow-group economic
salience 20
when
a : Alpha()
then 
Beta beta = new Beta()
beta.add(a)
beta.setStatus(eco) // the property status is setted
insert(beta)
end

rule fl eco
ruleflow-group economic
salience 20
when 
f : Fl ()   
then
Fl fl = new Fl();
fl.add(f);
fl.setStatus(eco)// the property status is setted
insert(fl)
end


rule pack eco
ruleflow-group economic
when
f : Fl(status == eco)   //those two conditions are never
casted
... while I inserted the facts
a : Alpha(status == eco) 
then

end


Could someone explain me why ?
--
View this message in context:
http://www.nabble.com/re-use-of-an-object-used-in-a-previous-rule-tp17750384
p17750384.html
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 mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


RE: [rules-users] Question about timing rules

2008-06-05 Thread Corneil du Plessis
It should not be an issue to have an object inserted representing the
current time and have rules checking against the object

  _  

From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Bagwell, Allen F
Sent: 05 June 2008 17:34
To: Rules Users List
Subject: [rules-users] Question about timing rules


 
Another noob question:
 
Is there a generally understood way of implementing the concept of a time
interval rule?
 
That is, lets say I have a Drools-enabled client which is constantly
receiving information from outside resources. Most of this data (and the
consequences of its changes) is time sensitive, so I'm calling the
fireAllRules() method in a loop every minute.
 
And now, let's say I have a rule that in addition to being driven by
incoming data changes has to be linked to a repeating clock interval or
synched with wall time such that the rule only activates and fires if the
data meets certain parameters AND it's been exactly 1 hour since the last
check or that it will fire at the top of every wall time hour (1 PM, 2PM, 3
PM, etc.).
 
Furthermore, timing may change. A successful rule activation and firing
might do something like now change this timing so that for the next 24
hours, this rule must be examined every 30 minutes instead of every hour. 
 
My initial reading of the Drools documetation I came across the Duration,
and Date-* keywords. Their descriptions didn't seem to fit the bill.
 
I ask this because our old rules engine software that has been retired to
obsolescence allowed this kind of thing to be easily set up. Coming at it in
the Drools world seems a lot more challenging.
 
Thoughts? Examples?
 
-Allen
 
 
 
 
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


[rules-users] eclipse-jdtcore.jar

2008-06-03 Thread Corneil du Plessis
I am experiencing a conflict with a deployment:

We used WebSphere Application Server 6.0.2.x in our integration testing
environment and now the deployed application at a customer site is reporting
the following exception:


java.lang.NoSuchMethodError:
org.eclipse.jdt.internal.compiler.CompilationResult: method
getProblems()[Lorg/eclipse/jdt/core/compiler/CategorizedProblem; not found
at
org.drools.commons.jci.compilers.EclipseJavaCompiler$3.acceptResult(EclipseJ
avaCompiler.java(Compiled Code))
at
org.eclipse.jdt.internal.compiler.Compiler.handleInternalException(Compiler.
java(Compiled Code))
at
org.eclipse.jdt.internal.compiler.Compiler.compile(Compiler.java(Compiled
Code))
at
org.drools.commons.jci.compilers.EclipseJavaCompiler.compile(EclipseJavaComp
iler.java(Compiled Code))
at
org.drools.commons.jci.compilers.AbstractJavaCompiler.compile(AbstractJavaCo
mpiler.java:51)
at
org.drools.rule.builder.dialect.java.JavaDialect.compileAll(JavaDialect.java
:342)

Has anyone else comes across this?

I am not sure where the JAR comes from because has not version info.

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


RE: [rules-users] eclipse-jdtcore.jar

2008-06-03 Thread Corneil du Plessis
Problem I have is that it is in WebSphere/lib so it gets loaded before
anything in my application, when the classloader is set to parent first. 
When I change the class loader to parent last I run into a new set of
problem with some of the XML based libraries. 

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Marcus Ilgner
Sent: 03 June 2008 15:35
To: Rules Users List
Subject: Re: [rules-users] eclipse-jdtcore.jar

Hi,

just as a side note: I had one project using Eclipse which already used
another version of the JDT core. Encountering the same problem, I just put
the core-3.2.3.v_686_R32x.jar from Drools in my project, too, and it worked
without problems.

Best regards
Marcus

On Tue, Jun 3, 2008 at 3:25 PM, Augusto Rodriguez
[EMAIL PROTECTED] wrote:
 Hi Corneil,

 Unluckily I've seen that error more often that I would like. It's not 
 a bug in drools, but is related to the dependencies of the
drools-compiler.

 There's a big chance that you have a different version of the JDT core 
 jar in your classpath (drools depends on version 3.2.3 - the filename 
 of that jar is core-3.2.3.v_686_R32x.jar). This jar is used by drools 
 to compile the rules.

 I hope this helps you to solve this issue.


 Cheers,
 Augusto

 Corneil du Plessis wrote:

 I am experiencing a conflict with a deployment:

 We used WebSphere Application Server 6.0.2.x in our integration 
 testing environment and now the deployed application at a customer 
 site is reporting the following exception:


 java.lang.NoSuchMethodError:
 org.eclipse.jdt.internal.compiler.CompilationResult: method 
 getProblems()[Lorg/eclipse/jdt/core/compiler/CategorizedProblem; not
found
at

 org.drools.commons.jci.compilers.EclipseJavaCompiler$3.acceptResult(E
 clipseJ
 avaCompiler.java(Compiled Code))
at


org.eclipse.jdt.internal.compiler.Compiler.handleInternalException(Compiler.
 java(Compiled Code))
at
 org.eclipse.jdt.internal.compiler.Compiler.compile(Compiler.java(Comp
 iled
 Code))
at

 org.drools.commons.jci.compilers.EclipseJavaCompiler.compile(EclipseJ
 avaComp
 iler.java(Compiled Code))
at

 org.drools.commons.jci.compilers.AbstractJavaCompiler.compile(Abstrac
 tJavaCo
 mpiler.java:51)
at

 org.drools.rule.builder.dialect.java.JavaDialect.compileAll(JavaDiale
 ct.java
 :342)

 Has anyone else comes across this?

 I am not sure where the JAR comes from because has not version info.

 ___
 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 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