Drools License ?
by Harshit Bapna
Hi All,
The Drools 5.1 download link gives the license information as ASL. (
http://jboss.org/drools/downloads.html)
Is it Apache Software License ? If yes which version of apache license is
used ?
Where can I get a link to the actual license ?
--harshit
15 years, 5 months
Querying ExecutionResults
by Evert Penninckx
Hi
To retrieve all facts of a given type from the working memory of a stateful
session I use this command:
kstateful.getObjects(new ClassObjectFilter("SomeClass.class"));
Can someone confirm that the only equivalent for a stateless session is
creating a query (a bit more cumbersome)?
executionResults.getValue( "QueryName" );
Tnx
Evert
--
View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Querying-ExecutionRes...
Sent from the Drools - User mailing list archive at Nabble.com.
15 years, 5 months
Re: [rules-users] Issue in sending Multiple request to Drools Guvnor package
by Esteban Aliverti
I think you could maintain a single kbase with a single kagent and then
create a new ksession for each request.
Best,
El sep 23, 2010 4:31 p.m., "bbarani" <bbarani(a)gmail.com> escribió:
Hi,
We have a java code which connects to guvnor and fires all the rules in a
package and gets back the final decision from Guvnor.
The code works fine for single request, if I send multiple request the code
takes more time to return the results. I am just wondering if we are doing
anything wrong which affects the response time for multiple request.
This is what we are doing now for multiple request,
Get multiple request in an request array object
Iterate through each request object and fire all the rules with the
parameters present in that request object and display the final decision for
each request.
For each request object we are invoking the function which creates a
ruleagent (based on guvnor.properties file) and fires all the rules with
corresponding request parameter and sends back the decision.
I am thinking this might be the issue, due to the fact that we are creating
new connection / rule agent everytime when we invoke the function and that
in turn cause more time for returning the results back.
I Just want to know if there is a way to just create a single session with
Guvnor using rule agent and invoke all the rules multiple times based on the
number of request and finally get all the decisions.
Thanks,
BB
--
View this message in context:
http://drools-java-rules-engine.46999.n3.nabble.com/Issue-in-sending-Mult...
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
15 years, 5 months
Issue in sending Multiple request to Drools Guvnor package
by bbarani
Hi,
We have a java code which connects to guvnor and fires all the rules in a
package and gets back the final decision from Guvnor.
The code works fine for single request, if I send multiple request the code
takes more time to return the results. I am just wondering if we are doing
anything wrong which affects the response time for multiple request.
This is what we are doing now for multiple request,
Get multiple request in an request array object
Iterate through each request object and fire all the rules with the
parameters present in that request object and display the final decision for
each request.
For each request object we are invoking the function which creates a
ruleagent (based on guvnor.properties file) and fires all the rules with
corresponding request parameter and sends back the decision.
I am thinking this might be the issue, due to the fact that we are creating
new connection / rule agent everytime when we invoke the function and that
in turn cause more time for returning the results back.
I Just want to know if there is a way to just create a single session with
Guvnor using rule agent and invoke all the rules multiple times based on the
number of request and finally get all the decisions.
Thanks,
BB
--
View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Issue-in-sending-Mult...
Sent from the Drools - User mailing list archive at Nabble.com.
15 years, 5 months
Guvnor 5.1: Pencil icon not clickable in BRL editor
by Scott Mayne
Hi all,
I'm reading Paul
Browne's "JBoss Drools Business Rules" and in Ch. 5 we make a BRL in the guided
editor. We're using a simple fact model with a single class (Sales) which has
(among others) a field "sales", type long. The book uses an earlier version of
Guvnor so things look a little different but everything's worked so far, until I
use the editor to make a rule that looks like this in "view source":
rule
"SalesDiscount"
dialect "mvel"
when
mySales : Sales( salesValue
: sales >= "100" )
then
mySales.setSales( salesValue-10 );
update( mySales );
end
When I try it out, I get this line in the THEN
section
"1. Modify value of Sales [mySales] sales [pencil icon] [remove icon]
but neither "sales" nor the pencil icon is clickable, so I can't enter what it should change to. When click view source using what I could do I
get:
rule "SalesDiscount"
dialect "mvel"
when
mySales :
Sales( salesValue : sales >= "100" )
then
mySales.setSales(
);
mySales.setWait( );
update( mySales );
end
[I added
the "wait" because the modify field dropdown has this as an option but it's not
in the Java class and I'm not sure where it came from.]
Can anyone shed light on this behavior? I'm using the latest version of Firefox, compiling
with GWT/building my own EAR (though I haven't done any code changes) using RAD
7.5.5.1 (based on Eclipse 3.4), and am running Guvnor on
WebSphere.
15 years, 5 months
How does drools loads a modified rule ?
by Harshit Bapna
Hi All,
I am new to Rule Engine concept. I am investigating the Drools 5.0 to check
if it meets our requirements.
Questions:
1. I am not able to find a resource to learn the syntax of drool rules.
I have gone through the shopping example in Drools 5.1 examples but not
able to get the basics right.
$c : Customer() -- what does this mean ? Is it that all
objects of type Customer in the working memory are matched are taken one by
ones and assigned to c ?
$d : Discount( customer == $c ) -- Each discount
objects which have the matching customer are assigned to d. How can I debug
this process in eclipse ?
Please provide a resource where I can learn the drl syntax.
Also what are differences in drl when dialect is java and not mvel.
2. How would a rule engine behave when rules are running on the facts and
simultaneously the rules are updated in the knowledge base?
15 years, 5 months
Using ForEach variables in split constraints
by sam.squire@paretopartners.com
Hello there,
I wanted to refer to a variable in a split constraint in a ForEach node.
What is the correct way to nest a split node in a ForEach node and refer
to the variable of the collection?
I have tried the following:
a) Start process and insert process into session, providing the map
containing the collectionExpression. Using:
<import name="org.drools.runtime.process.WorkflowProcessInstance"/>
processIntance: WorkflowProcessInstance()
$item: MyObject: (this == (processInstance.getVariable("item")))
this doesn't seem to grab the variable like I expected it to.
How can I assign processInstance.getVariable("item") itself to a variable?
(I imagine this would work if this did)
b) Set the variable on the global process from the current context
kcontext.getProcessInstance().setVariable("item",
kcontext.getVariable("item")
I know this is not the right answer.
c) Insert the item in an action at the beginning of the loop. Retract it
at the end. I then match against the item of type MyObject at the
beginning.
// in action:
insert(item)
// in constraint
$item: MyObject()
// after action
retract(item)
This requires looping in Java to start the processes individually and
setting the variable explicitly each time.
This seems a bit of a roundabout way of doing it, what is *the* correct
method?
Thanks,
This message may contain confidential and privileged information and is intended solely for the use of the named addressee. Access, copying or re-use of the e-mail or any information contained therein by any other person is not authorised. If you are not the intended recipient please notify us immediately by returning the e-mail to the originator and then immediately delete this message. Although we attempt to sweep e-mail and attachments for viruses, we do not guarantee that either are virus-free and accept no liability for any damage sustained as a result of viruses.
Please refer to http://www.bnymellon.com/disclaimer/piml.html for certain disclosures.
15 years, 5 months
Re: [rules-users] ForEach element cannot see CollectionExpression
by sam.squire@paretopartners.com
I have solved the problem. The list and variable must be declared in the
header, using an import and variable element. I can now refer to the
variable in an action. This is the posting that helped me find the answer:
http://drools-java-rules-engine.46999.n3.nabble.com/How-to-use-Ruleflow-F...
Thanks.
This message may contain confidential and privileged information and is intended solely for the use of the named addressee. Access, copying or re-use of the e-mail or any information contained therein by any other person is not authorised. If you are not the intended recipient please notify us immediately by returning the e-mail to the originator and then immediately delete this message. Although we attempt to sweep e-mail and attachments for viruses, we do not guarantee that either are virus-free and accept no liability for any damage sustained as a result of viruses.
Please refer to http://www.bnymellon.com/disclaimer/piml.html for certain disclosures.
15 years, 5 months
Calling specific Rule Group
by Swapnil Sawant
Hi,
I have created two rule groups "Group 1" and "Group 2".
Now, I have read that to execute these groups I need to write something like following code :
Rule "pick group X"
when
Fact( attribute = "condition1" )
then
drools.setFocus("Group 1")
end
Rule "pick group Y"
when
Fact( attribute = "condition2" )
then
drools.setFocus("Group 2")
end
I wanted to know is it always necessary to write separate rules for calling/execution of these rule groups (rules "pick group X" and "pick group Y")?
Or is there any other api function similar to ksession.fireAllRules() for calling specific rule group ?
Thanks & Regards,
Swapnil Sawant
________________________________
This Email may contain confidential or privileged information for the intended recipient (s) If you are not the intended recipient, please do not use or disseminate the information, notify the sender and delete it from your system.
______________________________________________________________________
15 years, 5 months
Bug in 5.1 : function w/o parameter type is a no-no
by Wolfgang Laun
The RTE is caused by following DRL.g in writing a function; it says you can
omit the type for a parameter. A function like this causes the crash:
function inf sqr( a ){ return a*a; }
Untyped parameters may be used in queries. I suppose it will be necessary to
use different NTs for parameters and param_definition.
Exception in thread "main" java.lang.RuntimeException:
org.drools.compiler.DroolsParserException: Unknown error while parsing. This
is a bug. Please contact the Development team.
at
org.drools.compiler.PackageBuilder.addKnowledgeResource(PackageBuilder.java:545)
at
org.drools.builder.impl.KnowledgeBuilderImpl.add(KnowledgeBuilderImpl.java:28)
at rss.drools.setup.Application.setup(Application.java:40)
at rss.drools.setup.Application.execute(Application.java:60)
at appl.transport.Transport.main(Transport.java:64)
Caused by: org.drools.compiler.DroolsParserException: Unknown error while
parsing. This is a bug. Please contact the Development team.
at org.drools.compiler.DrlParser.compile(DrlParser.java:250)
at org.drools.compiler.DrlParser.parse(DrlParser.java:142)
at org.drools.compiler.DrlParser.parse(DrlParser.java:147)
at
org.drools.compiler.PackageBuilder.addPackageFromDrl(PackageBuilder.java:264)
at
org.drools.compiler.PackageBuilder.addKnowledgeResource(PackageBuilder.java:459)
15 years, 5 months