Inserting a JRuby object via Spring JRubyScriptFactory in Drools
by Premkumar Stephen
Hello Folks,
I have been looking at options of using ruby objects as fact objects in
Drool's working memory.
One obvious way is using services.
Another path that I have been researching about is to use Spring as outlined
here http://www.jroller.com/habuma/entry/spring_meet_ruby
Now, in this example, if the Lime ruby object were like a POJO, (contains
fields), will I be able to insert this object into the workingMemory? My
Lime interface would have getters and setters. Will the engine look for the
fields themselves in an object or can it work with just getters and setters
( as would be declared in the Lime.java interface and defined in the Lime.rb
ruby class?
Are there any drawbacks in doing it this way?
Any comments/pointers will be appreciated.
Thanks!!
17 years
running a small set of rules from a drl file.
by Lucas de Oliveira
Hi,
I was wondering if it's possible to pick up just a few rules from a drl file
to create the RuleExecutionSet. Something like:
rules.drl ===>
...
rule "r1"
...
end
rule "r2"
...
end
...
=============
RunRules.java ===>
...
List<String> rulesToRun = new ArrayList<String>();
rulesToTun.add("r1");
RuleExecutionSet ruleExecutionSet =
ruleSetProvider.createRuleExecutionSet(ruleFileName, null, rulesToRun);
ruleAdministrator.registerRuleExecutionSet("test.drl", ruleExecutionSet,
null);
...
=============
I haven't found anything like that in the documentation. I'd really like
that otherwsie I'll have to split the rules through many different files,
which will be a bit of a havoc to unit test...
thanks in advance!
best regards,
--
Lucas de Oliveira Arantes
17 years
Logic in the when clause
by Zevenbergen, Alex
Hi,
quick newbie question about the when clause in a rule. eg can i get the
fact to be tested from the result of two other inputted facts?
details.HOME_MATCH_SCORE - details.HOME_FULL_TIME_SCORE >
details.AWAY_MATCH_SCORE - details.AWAY_FULL_TIME_SCORE
I assumed this would work fine but it doesn't recognise the '-' as a
minus!
Thanks in advance
Alex
________________________________________________________________________
Privileged, confidential and/or copyright information may be contained in this communication. This e-mail and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you are not the intended addressee, you may not copy, forward, disclose or otherwise use this e-mail or any part of it in any way whatsoever. To do so is prohibited and may be unlawful. If you have received this email in error
please notify the sender immediately.
Paddy Power PLC may monitor the content of e-mail sent and received for the purpose of ensuring compliance with its policies and procedures.
Paddy Power plc, Airton House, Airton Road, Tallaght, Dublin 24 Registered in Ireland: 16956
________________________________________________________________________
17 years
llu
by Returned mail
The message was undeliverable due to the following reason(s):
Your message was not delivered because the destination server was
not reachable within the allowed queue period. The amount of time
a message is queued before it is returned depends on local configura-
tion parameters.
Most likely there is a network problem that prevented delivery, but
it is also possible that the computer is turned off, or does not
have a mail system running right now.
Your message could not be delivered within 4 days:
Server 16.110.114.60 is not responding.
The following recipients could not receive this message:
<rules-users(a)lists.jboss.org>
Please reply to postmaster(a)lists.jboss.org
if you feel this message to be in error.
17 years
mapping between the eclipse drools project and Guvnor
by Wishing Carebear
Hello:
I'm a newbie to drools and have installed the eclipse plugin IDE and the
guvnor.
Wondering what is the mapping between the IDE projects and the guvnor assets
and packages view.
Thanks,
Ravi
17 years
iterating over objects in a StatelessKnowledgeSession
by Michal Bali
Hi,
I am trying this on trunk. There is currently no way how to iterate objects
in a StatelessKnowledgeSession.
I've tried to use the GetObjectsCommand, however when it is executes the
result is lost in the ether :). The collection of objects is not handed back
to the user.
I guess it should probably be added to the BatchExecutionResults? It will
then be possible to access this collection of objects.
Please let me know if there is a different way how to iterate over objects
in a StatelessKnowledgeSession. I'd like to use an ObjectFilter as well.
Best Regards,
Michal
17 years
signalEvent in DRL file
by raphael.bernhard@orange-ftgroup.com
I'm playing around with the ruleflow signal facility.
Within the ruleflow, it's rather easy to "signal" an event and it works well (using an action, ...). But I wanted to write some (DRL) rules to signal events conditionally (e.g. each tine a condition happens, signal the event).
The rules that have to signal the event are activated from a ruleflow using a RuleflowGroup. I didn't find any easy way to get a reference to the process variable (ProcessInstance) within the rules activated by the RuleFlowGroup.
ps: I'm trying to mimic a simple reactive system in the domain of machine-to-machine behaviour programming.
--
Raphaël BERNHARD --- mailto:raphael.bernhard@orange-ftgroup.com
Orange LABS
905, Rue Albert Einstein
06921 SOPHIA ANTIPOLIS Cedex
Tel: (+33) 4 92 94 52 94 Fax: (+33) 4 92 38 93 20
17 years
Re: [rules-users] Identify Rule on Attributes
by Greg Barton
Yes, if you use a rules engine that implements rete the functionality you need is available.
Read the Drools docs.
Carefully.
GreG
On Mar 12, 2009, at 23:40, Nikhil_dev <k.nikhil(a)verchaska.com> wrote:
thank u Scott and Greg for u'r reply......
by the way Greg is it possible for me to use this rete algo through rule
engine as this functionality already available in the core of Rule Enigne or
should i implement this out side rule engine.
Greg Barton wrote:
That's the core functionality of a rule engine. The rete algorithm does
this, and drools implements rete.
--- On Thu, 3/12/09, Nikhil_dev <k.nikhil(a)verchaska.com> wrote:
so now is there
any way with the help of drools we can identify which rule
to execute with
out executing all of them one after the another
_______________________________________________
rules-users mailing list
rules-users(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users
-----
Regards,
:working:Nikhil
--
View this message in context: http://www.nabble.com/Identify-Rule-on-Attributes-tp22471473p22490126.html
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
17 years
RuleRepository printStackTrace Instead of Exception
by Carlsen, Len
Hi,
I am using Drools 5.0.0.SNAPSHOT on JDK 1.6 and have noticed that there
are several methods in the org.drools.repository.RulesRepository like
exportRulesRepositoryToStream and importRulesRepositoryFromStream that
do not throw any exceptions but does a printStackTrace instead. Could we
have them throw RulesRepositoryExceptions instead J.
Also, the org.drools.repository.RulesRepository.MigrateDroolsPackage
does a System.out.println (could all System.out.println be logs) saying
that auto-migration is complete even though no packages have been
migrated on a new clean repository (seems that performed = true before
any migration is performed).
If I can be of any help please let me know?
Thanks,
Len
Len Carlsen
Student Systems
The University of British Columbia
17 years
JSR-94 Throws Exception for KnowledgePackage
by Carlsen, Len
Hi,
I am upgrading our application from Drools 4.0.7 to 5.0.0.SNAPSHOT
(using JDK 1.6)
I have noticed that RuleServiceProvider.createRuleExecutionSet requires
a org.drools.rule.Package instead of a KnowledgePackage. If I use a
KnowledgePackage the following exception is thrown:
RuleException(javax.rules.admin.RuleExecutionSetCreateException:
Incoming AST object must be an org.drools.rule.Package. Was class
org.drools.definitions.impl.KnowledgePackageImp), root cause(null)
at
org.drools.jsr94.rules.admin.LocalRuleExecutionSetProviderImpl.createRul
eExecutionSet(LocalRuleExecutionSetProviderImpl.java:211)
To get rid of the exception I have to cast
org.drools.definitions.impl.KnowledgePackageImp to KnowledgePackage.
Maybe
org.drools.jsr94.rules.admin.LocalRuleExecutionSetProviderImpl.createRul
eExecutionSet should also look for a KnowledgePackage?
Am I doing something wrong?
Below is a code snippet of what I am doing:
KnowledgePackage binPkg = (KnowledgePackage)
brmsRepository.loadRuleSet(uuid).getCompiledRuleSetObject();
// Drools JSR-94 requires a org.drools.rule.Package
org.drools.rule.Package pkg =
((org.drools.definitions.impl.KnowledgePackageImp) binPkg).pkg;
String RULE_SERVICE_PROVIDER = "http://drools.org/";
String RULE_URI = "MyPackage";
RuleServiceProviderManager.registerRuleServiceProvider(RULE_SERVICE_PROV
IDER, RuleServiceProviderImpl.class);
RuleServiceProvider ruleServiceProvider =
RuleServiceProviderManager.getRuleServiceProvider(RULE_SERVICE_PROVIDER)
;
RuleAdministrator ruleAdministrator =
ruleServiceProvider.getRuleAdministrator();
LocalRuleExecutionSetProvider ruleSetProvider =
ruleAdministrator.getLocalRuleExecutionSetProvider(null);
Here an exception is thrown for a KnowledgePackage
// Drools JSR-94 requires a org.drools.rule.Package - Exception
thrown if it is a KnowledgePackage
RuleExecutionSet ruleExecutionSet =
ruleSetProvider.createRuleExecutionSet(pkg, null);
Etc...
Thanks,
Len
Len Carlsen
Student Systems
The University of British Columbia
17 years