questions on guvnor and drools 5.0
by Garner, Shawn
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.
16 years, 10 months
Why is a flat object recommended?
by Christie, Blair
In the documents this is dicussed briefly:
"). Object models can often have complex relationships and hierarchies
in them - for rules you will want to simplify and flatten the model
where possible, and let the rule engine infer relationships (as it
provides future flexibility."
What does it mean that the rule engine can infer relationships?
Are there performance reasons for having a flat model?
Cheers,
Blair
16 years, 10 months
MySQL and Derby issues with Guvnor
by Sumant Kumar
Hi ,
I have changed the defualt Derby DB to MySQL DB for the JacRabbit in Guvnor. I see this below exception when I try to bring up the JBOSS AS and Guvnor.
Any idea what is the issue
2009-07-30 16:58:09,499 INFO [STDOUT] (main) ERROR 30-07 16:58:09,499 (BundleDbPersistenceManager.java:storeBundle:1270) failed to write bundle: cafebabe-cafe-babe-cafe-babecafebabe
ERROR 23505: The statement was aborted because it would have caused a duplicate key value in a unique or primary key constraint or unique index identified by 'SQL090729054055150' defined on 'DEFAULT_BUNDLE'.
Is there a way to get rid of JacRabbit and use more robust Implemenentation of JCR.
16 years, 11 months
impossible to dispose tomcat devloader when i reload context (drools keep reference)...
by Emmanuel GREFFET (France)
Hello
I'm Emmanuel from France. (sorry for my English)
We use drools 4.0.7 in a hospital application.
We load drools and our programs (services) with tomcat Devloader (5.5.9)
We use drools in statefullsession (retract and insert facts by rules in a
ruleFlow).
everything is perfect for us, except a little problem of "dispose" with
tomcat due to drools.
Through the Tomcat console when we try to restart our webapp, tomcat can't
dispose the old Devloader
(in Eclipse we can see that many drools class use class attribute
ClassLoader without any dispose ???)
In production, we used different webapps in a Tomcat, so we can't easely
stop Tomcat, so until we stop tomcat, the reload of the webapps is longer
and longer ... (many devloader(s) can't dispose)...
anyone has had this problem ?
Thank you.
Emmanuel
--
View this message in context: http://www.nabble.com/impossible-to-dispose-tomcat-devloader-when-i-reloa...
Sent from the drools - user mailing list archive at Nabble.com.
16 years, 11 months
Problems with ruleflow
by Femke De Backere
Hi,
I have a problem with an easy Rule flow project (source code included
in this mail). The only thing that should happen is the execution of a
rule flowgroup, but my application ends before executing the group...
Does anybody see the problems? I tried every possible adaptation and
based this problem on a similar, working feverapplication... But is
still doesn't work and I really can't find the problem.
Thx,
Femke
16 years, 11 months
Advice on organizing rules
by glasscat
I'm using drools 5.0.1.
I've written the following rules to retrieve objects from the working
memory. Questions:
1) whether there is a better way to organize the rules. For instance the
rule "checkvalidresponse" right now checks for both successful retrieval and
unsuccessful retrieval. Should I split it to 2?
2) When I do drools.update(response) in the "default" rule, it seems to be
in endless loop.
3) The response value set in "retrieve" rule is not updated when rule
"checkvalidresponse" is triggered. Do I need to do drools.update(response)
in the "default" rule?
4) Should I set the response code in the "retrieve" rule and remove the
"checkvalidresponse" rule?
Thanks
rule "default"
dialect "java"
agenda-group "retrieve"
salience 50
when
Request(sfid : ProductIdentifier)
trdata : Data(Identifier == sfid)
response : Response(product == null)
ServiceResponse(responseCode == 0) from
response.getServiceResponse()
then
response.setProduct(trdata.getProduct());
// should I set response code here or let "checkvalidresponse"
handle it?
// do I need to update here?
// drools.update(response);
end
# Shoud I split this to 2? 1) check for successful query and 2) check for
unsuccessful query?
rule "checkvalidresponse"
dialect "java"
agenda-group "retrieve"
salience 20
when
Request()
response : Response()
sres : ServiceResponse(responseCode == 0) from
response.getServiceResponse()
then
String rname = drools.getRule().getName();
System.out.println("Rule: \"" + rname + "\" triggered");
Product prod = response.getProduct();
// Check if a valid Product found
if ( prod == null ) {
sres.setResponseCode(9);
sres.setResponseMessage("Product not found");
sres.setExceptionCode(9999);
sres.setExceptionMessage("");
} else {
sres.setResponseCode(0);
sres.setResponseMessage("The operation completed
successfully");
sres.setExceptionCode(0);
sres.setExceptionMessage("");
}
response.setServiceResponse(sres);
drools.update(response);
end
# Credentials
# The only valid credential: User Id: User Password: Password
#
rule "checkcred"
dialect "java"
salience 50
when
request : Request()
response : Response()
cred : Credentials(userName != "User" || password != "Password")
from request.getCredentials()
sres : ServiceResponse(responseCode == 0) from
response.getServiceResponse()
then
String rname = drools.getRule().getName();
System.out.println("Rule: \"" + rname + "\" triggered");
sres.setResponseCode(9);
sres.setResponseMessage("Invalid credentials");
sres.setExceptionCode(9000);
sres.setExceptionMessage("");
response.setServiceResponse(sres);
drools.update(response);
end
# Transaction context
# Valid channel: channel01 or channel02
#
rule "checktrctx"
dialect "java"
salience 40
when
request: Request()
response: Response()
ctx : TransactionContext(channel != "channel01" && channel !=
"channel02") from request.getTransactionContext()
sres : ServiceResponse(responseCode == 0) from
response.getServiceResponse()
then
String rname = drools.getRule().getName();
System.out.println("Rule: \"" + rname + "\" triggered");
System.out.println("Invalid transaction context: " +
ctx.getChannel());
sres.setResponseCode(9);
sres.setResponseMessage("Invalid transaction context");
sres.setExceptionCode(9001);
sres.setExceptionMessage("");
res.setResponse(sres);
drools.update(res);
end
rule "requestgood"
dialect "java"
salience 1
when
Request()
response : Response(product == null)
ServiceResponse(responseCode == 0) from
response.getServiceResponse()
then
String rname = drools.getRule().getName();
System.out.println("Rule: \"" + rname + "\" triggered");
System.out.println("Request is good");
drools.setFocus("retrieve");
end
--
View this message in context: http://www.nabble.com/Advice-on-organizing-rules-tp24742646p24742646.html
Sent from the drools - user mailing list archive at Nabble.com.
16 years, 11 months
How to Enrich Facts with Data from a Database
by Ken Archer
I would like to append values to facts in working memory with
values from a database before rules processing. The Fusion documentation
says, “one of the most common use cases for rules is event data enrichment”,
but no documentation seems to explain how this is done whether we’re talking
about events or just plain old facts. And the RHS syntax seems to be
limited to working with data already in working memory. How can I enrich
facts with data from another system? Thanks in advance.
Ken Archer
Telogical Systems
16 years, 11 months
Problem Sharing rules between Rule Flow group
by surya_n2007
Using 4.0.7 version
Our requirement is we need to share rules between different projects. So we
have grouped the rules into ruleflow group say Group A has 2 rules, GroupB
has 4 rules.Shared GroupB i.e 4 rules in different projects X,Y. Now the
business requirement changed for project Y in GroupB one of the rule doesnt
satisfied.
Solution : Divide the rule flow groupB into GroupB 3 rules ,Group C 1 rule
but we need to test both the projects we dont want to do that .
Please let me know any other solution ? Can a rule be part of different rule
flow groups as shown below.
rule "Rule3" ruleflow-group "GroupB,Group X"
Cheers
Surya.
--
View this message in context: http://www.nabble.com/Problem-Sharing-rules-between-Rule-Flow-group-tp247...
Sent from the drools - user mailing list archive at Nabble.com.
16 years, 11 months