Re: [rules-users] Why are MVEL rules compiled on first access?
by Greg Barton
If I recall correctly the HashMap churn issue I pointed out with mvel on the dev list was due to mvel expressions being repeatedly compiled. I'll have to double check, but if that's the case and it can be avoided it would be awesome. :)
--- On Thu, 6/4/09, Edson Tirelli <tirelli(a)post.com> wrote:
> From: Edson Tirelli <tirelli(a)post.com>
> Subject: Re: [rules-users] Why are MVEL rules compiled on first access?
> To: "Rules Users List" <rules-users(a)lists.jboss.org>
> Date: Thursday, June 4, 2009, 1:40 PM
>
> Sobhana,
>
> This is very important feedback. Would you be able to
> create an isolated test case showing this problem? This
> would be the quickest way for us to fix it.
>
> On a related note, everything should be compiled at
> compile time, including MVEL stuff. If that is not
> happening, we need to check what mvel is doing internally.
>
>
> Thanks,
> Edson
>
> 2009/6/4 Sobhana <sobhanarich(a)yahoo.com>
>
>
>
> hi,
>
>
>
> Our application uses Drools 4.0.7 and Hibernate 3.x. We use
> the BRMS to
>
> compile the rules from drl files (using java dialect) into
> rule packages
>
> which are updated into the rule base using the rule agent.
>
>
>
> We have seen that MVEL rules are compiled when the rules
> are fired for the
>
> first time. If the fact passed at the first run contains a
> Hibernate proxy
>
> (subclass of the original object) and we later re-use the
> compiled rule on
>
> the fact containing the original object, we get a
> ClassCastException.
>
> However, if we pass the fact containing the original object
> in the first
>
> run, there is no problem for further runs.
>
>
>
> Why are the rules not compiled when we create the package
> using the BRMS?
>
> How can we enable precompilation so that the type is taken
> as the original
>
> object itself?
>
>
>
> Thanks,
>
> Sobhana
>
>
>
> --
>
> View this message in context: http://www.nabble.com/Why-are-MVEL-rules-compiled-on-first-access--tp2387...
>
>
> Sent from the drools - user mailing list archive at
> Nabble.com.
>
>
>
> _______________________________________________
>
> rules-users mailing list
>
> rules-users(a)lists.jboss.org
>
> https://lists.jboss.org/mailman/listinfo/rules-users
>
>
>
>
> --
> Edson Tirelli
> JBoss Drools Core Development
> JBoss, a division of Red Hat @ www.jboss.com
>
>
> -----Inline Attachment Follows-----
>
> _______________________________________________
> rules-users mailing list
> rules-users(a)lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
14 years, 10 months
Why are MVEL rules compiled on first access?
by Sobhana
hi,
Our application uses Drools 4.0.7 and Hibernate 3.x. We use the BRMS to
compile the rules from drl files (using java dialect) into rule packages
which are updated into the rule base using the rule agent.
We have seen that MVEL rules are compiled when the rules are fired for the
first time. If the fact passed at the first run contains a Hibernate proxy
(subclass of the original object) and we later re-use the compiled rule on
the fact containing the original object, we get a ClassCastException.
However, if we pass the fact containing the original object in the first
run, there is no problem for further runs.
Why are the rules not compiled when we create the package using the BRMS?
How can we enable precompilation so that the type is taken as the original
object itself?
Thanks,
Sobhana
--
View this message in context: http://www.nabble.com/Why-are-MVEL-rules-compiled-on-first-access--tp2387...
Sent from the drools - user mailing list archive at Nabble.com.
14 years, 10 months
RE: questions on guvnor and drools 5.0
by Garner, Shawn
Sorry it's been a few days and I haven't gotten any response on any questions/statements below.
I've used drools in the past but am pretty new to some features of drools still and new to Guvnor. I wrote a proof of concept drools/Guvnor app and these are the things I don't like or have questions around.
I was wondering if other people have the same problems or am I going about things wrong? Are there work arounds or is there plans to expand/change functionality? Maybe I should ask the dev list?
SG
-----Original Message-----
From: G, S
Sent: Monday, June 01, 2009 3:28 PM
To: 'rules-users(a)lists.jboss.org'
Subject: questions on guvnor and drools 5.0
I was wondering if somebody can help me with some questions:
1) Is there any more detail on how to setup Guvnor with a database?
2) How do you use the test scenarios with complex object structures?
-eg Create a fact in working memory that has another Object in it which in turn has a list of Objects in it.
-Seems like any Fact in working memory is assumed to only have only primitive values like Strings or numbers.
-We would like a more depth of objects where objects have a deep relationship to other objects at least 2-4 levels deep.
3) Why add ruleflow-group to the rule definition instead of adding the rule to a ruleflow-group? If the ruleflow-group is part of the rule then you can't use the same rule in multiple ruleflow-groups and leads to copy and maintaining the rule in two different spots.
4) DSL seems to be very inconvenient to edit in a text box especially when it wraps. Why not a table where you can add rows and each row is a translation. Also there are no examples how to do translation into Drools syntax that is multiple lines long and not just a single line.
5) Is Java 5 Type Enumerations supported? I was assuming I'd get a list of values if a field was an Enumeration.
6) There seems to be a vast functionality difference between the Guvnor decision tables and examples that use spreadsheets.
7) Guvnor lost the ability to select variables for use in other statements. Functionality was in BRMS of drools 4.0.7
8) I was not able to insert a fact using a constructor that needed parameter values. Seems like it assumes everything is a bean but I couldn't find this requirement stated in the documentation anywhere. Examples in documentation show inserting facts with constructor parameters.
9) It would be nice when you upload a domain model jar that you could explore the objects and fields somehow.
10) When you write a rule using one particular editor it would be nice if you could switch to another editor. Switch between Guided, DSL, Technical, etc.
11) It seems hard to reorder the statements in a when or then block. If I put them in the wrong order I have to delete them all. Would be nice if a statement could be moved up or down.
12) When calling a method on an object the choices only showed me public methods that take in one parameter. I had a method with two parameters and it wouldn't show me the method. I had to do a DSL or custom drools statement to get around it.
13) Guvnor seems to limit the drools syntax. I couldn't do a "from $collection" statement without a custom drools statement line.
14) It would be nice if I could declare a global dialect "java" for all the rules.
15) It would be nice to define an existing agenda-group as part of a ruleflow-group without adding the ruleflow-group on the rules in that agenda-group.
Thanks,
SG
-----Message Disclaimer-----
This e-mail message is intended only for the use of the individual or
entity to which it is addressed, and may contain information that is
privileged, confidential and exempt from disclosure under applicable law.
If you are not the intended recipient, any dissemination, distribution or
copying of this communication is strictly prohibited. If you have
received this communication in error, please notify us immediately by
reply email to Connect(a)principal.com and delete or destroy all copies of
the original message and attachments thereto. Email sent to or from the
Principal Financial Group or any of its member companies may be retained
as required by law or regulation.
Nothing in this message is intended to constitute an Electronic signature
for purposes of the Uniform Electronic Transactions Act (UETA) or the
Electronic Signatures in Global and National Commerce Act ("E-Sign")
unless a specific statement to the contrary is included in this message.
While this communication may be used to promote or market a transaction
or an idea that is discussed in the publication, it is intended to provide
general information about the subject matter covered and is provided with
the understanding that The Principal is not rendering legal, accounting,
or tax advice. It is not a marketed opinion and may not be used to avoid
penalties under the Internal Revenue Code. You should consult with
appropriate counsel or other advisors on all matters pertaining to legal,
tax, or accounting obligations and requirements.
14 years, 10 months
Help creating a GUI for an example
by Edson Tirelli
Hey people,
To achieve a list of short term goals related to Drools, I am
implementing a fairly interesting new example using as many features from
the Drools 5 platform as I see fit. Among other things, this example will
serve as a basis for a few tutorials on the engine capabilities that I want
to create.
To keep the example accessible to everyone, and at the same time keeping
things a bit more fun, I dropped the idea of developing a business
application and decided to go with a board game implementation, so that at
the same time it is easy enough for people to understand but complex enough
to demonstrate the engine features. At this point, I have a bit more than 50
rules already implemented for this example, it uses drools flow, custom
evaluators and custom accumulate functions. I will still add work items, DSL
and fusion features. In the end, I estimate the example will have between
120 and 150 rules, what is pretty decent for an example, I think.
Anyway, digressions aside, I could really use some help from someone
willing to develop a GUI for it. The GUI is basically a diamond shaped board
(or a square board with a 45 degrees rotation, if you prefer), 18 square
pieces and 18 cards. I have images for most of the components, but you are
free to create new if you fancy. The game will be played by 2 AI players,
against each other, so there is no need for user commands on the game
itself. Instead, the user should be able to control the game pace (i.e., see
the game move-by-move, slow or fast-forward).
The game already works from start to end, although players are still in
the Artificial Dumbness state (they will move to Artificial Intelligence in
the future). So, if anyone is willing to help, we can start plugging in the
GUI asap. Please send me a private mail and I will send you the details.
Thanks,
Edson
--
Edson Tirelli
JBoss Drools Core Development
JBoss, a division of Red Hat @ www.jboss.com
14 years, 10 months
Using StatelessSession session
by Meny Kobel
Hi,
I have a number of services(threads) sharing the same RuleBase instance.
Each service is calling execute method and waiting for the results.
should each service call StatelessSession session =
ruleBase.newStatelessSession() Or I can create one StatelessSession and
share it between the services (probably will improve performance)?
Meny
14 years, 10 months
Is there a doc on Guvnor's JCR layout ?
by uglything
Hie everyone.
I'm trying to use Drools 5 with Guvnor.
But I'm trying to create a simplified Guvnor-like application tied down to
what my particular domain problem is. That is, I'm not going to author my
rules myself. I'd rather let that to my end-user whose knowledge upon rules
processing is even far from poor...
Nevertheless, I'm willing to keep the JCR idea, and I'm striving to produce
a repository 100% compatible with Guvnor so I can pick up here and then some
functionalities out of Guvnor into my application in a straightforward way.
I looked deeply into the Guvnor JCR as well as Guvnor src and I think I have
a quite good understanding of what it does. But I don't want to miss
anything that could break the compatibility.
So is there a detailed documentation on the Guvnor JCR and if so where to
grab it ?
Thanks in advance for any hint !
--
View this message in context: http://www.nabble.com/Is-there-a-doc-on-Guvnor%27s-JCR-layout---tp2386993...
Sent from the drools - user mailing list archive at Nabble.com.
14 years, 10 months
The Eclipse JDT Core jar is not in the classpath error
by Chris Richmond
Hello,
I am using netbeans and ivy with Drools 5. I have successfully named,
published the jars from drools to and could build my port of the stock
ticker application in netbeans, but when I try to run it, I get the
following error:
java.lang.NoClassDefFoundError: org/antlr/runtime/tree/TreeNodeStream
I have the antlr-runtime jar from the bin/lib on my classpath where I added
all the others, but it always fails at this line
In loadRuleBase() in Broker.java of the stock ticker sample
builder.add( ResourceFactory.newInputStreamResource(
Broker.class.getResourceAsStream( RULES_FILE ) ),
ResourceType.DRL);.
Does anyone have any ideas what jar I might be missing if it's not the
antlr-runtime?
Thanks,
Chris
14 years, 11 months