Re: [rules-users] drools-server empty response body
by lhorton
In my test, I posted the set-global command along with the rule execution
commands, like this (snippet):
List commands = new ArrayList<Command>();
commands.add(CommandFactory.newSetGlobal("logger", logger));
commands.add(CommandFactory.newInsert(fact, "outId"));
commands.add(CommandFactory.newFireAllRules());
BatchExecutionCommand batchCommand =
CommandFactory.newBatchExecution(commands, "ksession");
.....etc.
(I had configured the ksession as stateless)
--
View this message in context: http://drools.46999.n3.nabble.com/drools-server-empty-response-body-tp319...
Sent from the Drools: User forum mailing list archive at Nabble.com.
14 years, 5 months
Re: [rules-users] drools-server empty response body
by lhorton
you'd do something like this... in your Java code, instantiate an instance
of your logger (of whatever class)
import org.apache.commons.Log; // or whatever logger class you are using
private Log mylogger = new Log();
then create your command list and add the logger instance as a global:
List commands = new ArrayList<Command>();
commands.add(CommandFactory.newSetGlobal("logger", mylogger));
then in your rule you declare the global:
global org.apache.commons.Log logger;
--
View this message in context: http://drools.46999.n3.nabble.com/drools-server-empty-response-body-tp319...
Sent from the Drools: User forum mailing list archive at Nabble.com.
14 years, 5 months
Minimax Planning
by Chris Spencer
How would you use Drools Planner to decide moves in a zero-sum
complete information game like Tic-Tac-Toe, Chess, Go, etc?
I understand how algorithms like Minimax are used for this, and I can
see how I could build a solver to calculate legal moves as well as the
fitness of each player's position after N hypothetical moves, but I'm
not sure I see how Planner could aggregate the scores of arbitrary
plans to find the action corresponding to the minimum/maximum score at
each step.
Regards,
Chris
14 years, 5 months
Planning Under Uncertainty
by Chris Spencer
Hi,
Does Drools Planner support uncertainty / probabilistic planning? I've
Googled, and only found a single reference, in the form of a research
paper, "Reasoning with Uncertainty in Drools", which doesn't even
appear to be publicly downloadable.
If not, how difficult would it be to add?
Regards,
Chris
14 years, 5 months
RuleML2011@BRF - Call for participation
by Adrian Paschke
*Apologies for any duplicates*
===================================================================
Challenge-2011 Demo Award: Late-Breaking Demos until 7th Oct.
http://2011.ruleml.org/america/?page_id=113
===================================================================
Want to learn more about rule technologies, applications and standards?
Want to discuss the latest industrial and research developments?
Want to get in touch with researchers and experts in rule-based systems and
technologies?
Want to see demos of state-of-the-art rule technologies and beyond?
Want to discuss with industries and academia on the future of rule
technologies?
Don't miss RuleML-2011@BRF
http://2011.ruleml.org/america/
===================================================================
RuleML 2011@BRF
5th International Symposium on Rules: Research-Based, Industry-Focused
Ft. Lauderdale, Florida, 3-5 November 2011
http://2011.ruleml.org/america/
===================================================================
We cordially invite you to participate to the 5th International Symposium on
Rules: Research-Based and Industry-Focused (RuleML-2011@BRF) - the premier
conference event emphasizing the synergy between high-quality research and
industry operating in the rule modeling, markup and reasoning domain, with
particular regard to the usability of such rule systems in the Web
environment.
It takes place in Ft. Lauderdale, Florida, November 3-5, 2011,
collocated with
the International Business Rules Forum.
News
===================================================================
List of accepted papers published
Draft Programme published
Best paper prize
Challenge-2011 Demo Award: Late-Breaking Demos until 7th Oct.
Special invited speakers included in the programme:
- Keynotes: Christian de Sainte Marie (IBM ILOG), Marcus Spies
(Ludwig-Maximilians
University, Munich), Paul Vincent, (CTO Business Rules& CEP, TIBCO
Software) and Jan Vanthienen (KU Leuven, World Authority on Decision
Tables).
- An OMG presentation will be given by Said Tabet (EMC) and one from
NIEM and OASIS by David Webber (Oracle Corporation).
- Special invited demos will be presented by Jans Aasman (Franz Inc.)
and by Benjamin Grosof (Vulcan Inc.)
Supported by
===================================================================
W3C, OMG, OASIS, AAAI, ECCAI, EPTS
15% special discount code for OASIS, OMG, W3C, ACM, ECCAI, EPTS, SemWeb
and WSWM members.
15% special discount code for RuleML2011@IJCAI attendees and Ph.D students
Sponsored by
===================================================================
Franz Inc.
NICTA (National ICT Australia) Ltd
Vulcan Inc.
CIRSFID - University of Bologna
Corporate Semantic Web
Model Systems Ltd
OASIS-LEGALXML
(sponsoring opportunities:http://2011.ruleml.org/america/?page_id=30)
===================================================================
14 years, 5 months
Re: [rules-users] Ant Build of PKG with Declared Types
by Ansgar Konermann
Am 23.09.2011 20:03 schrieb "TroyL" <troylparrish(a)aol.com>:
>
> Thank you for the reply. I have run a number of much simpler applications
in
> several environments, below are my results:
>
> My Ant Script remains unchanged.
Next things to try could be:
- increase verbosity of your ant compile so you can see what is actually
being compiled.
- make sure the Ant build is as similar as possible to your unit test
(observe verbose output of Ant build carefully)
Best regards,
Ansgar
>
> *My Test Application*:
>
> KnowledgeBuilder builder = KnowledgeBuilderFactory.newKnowledgeBuilder();
>
builder.add(ResourceFactory.newClassPathResource("declaredType.drl"),
> ResourceType.DRL);
>
> if(builder.hasErrors()){
> System.out.println(builder.getErrors().toString());
> }
>
> KnowledgeBase base =
KnowledgeBaseFactory.newKnowledgeBase();
> base.addKnowledgePackages(builder.getKnowledgePackages());
>
> StatefulKnowledgeSession session =
base.newStatefulKnowledgeSession();
>
> Test test = new Test();
> test.setName("Test");
>
> session.insert(test);
> session.fireAllRules();
>
> session.dispose();
>
> *My DRL*:
>
> package com.test
>
> declare SubTest
>
> name : String
> id : int
>
> end
>
> rule "Test Rule"
>
> when
> Test(name == "Test")
> then
> SubTest sTest = new SubTest();
> sTest.setName("SubTest");
> sTest.setId(12);
> System.out.println("Test Ran");
> System.out.println(sTest.getName() + " " + sTest.getId());
>
> end
>
> When I run my test application the drl compiles and I get the following
> output to the console:
>
> Test Ran
> SubTest 12
>
> However I get the following error when trying to compile it with the Ant
> Script:
>
> [compiler] Duplicate type definition. A class with the name
> 'com.test.SubTest' was found in the classpath while
>
> trying to redefine the fields in the declare statement. Fields can only be
> defined for non-existing classes.
>
> BUILD FAILED
> C:\Users\troy.l\conceptsWorkspace\DeclaredType\build1.xml:23: RuleBaseTask
> failed: Duplicate type definition. A
>
> class with the name 'com.test.SubTest' was found in the classpath while
> trying to redefine the fields in the
>
> declare statement. Fields can only be defined for non-existing classes.
>
> This error goes away when the Declared Type has only one field IE:
>
> declare SubTest
>
> name : String
>
> end
>
> The drl compiles into a PKG and the I can successfully use the PKG in my
> test application when the Declared Type has only one field. Also I do not
> have this issue in other Drools versions (I have tried 5.1.1, 5.0.1 and
> 5.2.0.M2).
>
> This is a stand alone test application and the above represents almost the
> entire test project with the exception of the Test.java class which is a
> pojo.
>
> Thanks again for responding.
>
> --
> View this message in context:
http://drools.46999.n3.nabble.com/Re-rules-users-Ant-Build-of-PKG-with-De...
> Sent from the Drools: User forum mailing list archive at Nabble.com.
> _______________________________________________
> rules-users mailing list
> rules-users(a)lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
14 years, 5 months
Re: [rules-users] Ant Build of PKG with Declared Types
by Ansgar Konermann
Am 16.09.2011 16:15 schrieb "TroyL" <troylparrish(a)aol.com>:
>
> I am attempting to build a PKG utilizing an Ant Script. My DRL includes
two
> declared types. When the declared types have only one field the PKG will
> compile but when the declared types have more than one field I get an
error
> stating that a class of that name was already found on the class path :
> specifically the error states:
>
> [compiler] Duplicate type definition. A class with the name XXXXXXX was
> found in the classpath while trying to redefine the fields in the declare
> statement. Fields can only be defined for non-existing classes.
Hi,
please optimize your signal/noise ratio:
* try to reduce your use case to a minimal test case which still exhibits
the erroneous behaviour
* a self contained unit test would be perfect
* try compiling the files from your use case using a plain KnowledgeBuilder.
As the Ant task is merely a wrapper around it, try to reproduce the
erroneous behaviour with the simplest setup possible.
* put the rule source code into your test as string literals.
* reduce the rule source code as much as possible while still reproducing
the error
* then, identify the smallest rule source code delta which makes the error
go away.
If you finally manage to reproduce the error using this minimal setup, make
sure to include complete information. In particular, don't XXX out parts of
the error message.
I'm quite sure if you follow at least some of these hints, you will probably
get more feedback from this list.
Best regards,
Ansgar
>
> My ant script:
>
> <?xml version="1.0" encoding="UTF-8" ?>
> <project default="rules">
> <property name="projectPath" value="" />
> <property name="droolsPath"
> value="C:/Users/266571/Documents/drools-distribution-5.2.0.Final/binaries"
> />
> <property name="eclipsePath"
> value="C:/Users/266571/Documents/eclipse/plugins" />
>
>
> <path id="drools.classpath">
> <pathelement location="${droolsPath}/drools-ant-5.2.0.FINAL.jar" />
> <pathelement location="${droolsPath}/drools-api-5.2.0.jar" />
> <pathelement location="${droolsPath}/drools-core-5.2.0.FINAL.jar" />
> <pathelement location="${droolsPath}/drools-compiler-5.2.0.FINAL.jar"
/>
> <pathelement location="${droolsPath}/antlr-runtime-3.3.jar" />
> <pathelement location="${droolsPath}/mvel2-2.0.19.jar" />
> <pathelement location="${droolsPath}/knowledge-api-5.2.0.Final.jar" />
> <pathelement
> location="${eclipsePath}/org.eclipse.jdt.core_3.6.2.v_A76_R36x.jar" />
>
> </path>
> <path id="model.classpath">
> <pathelement location="bin" />
> </path>
> <taskdef name="compiler" classpathref="drools.classpath"
> classname="org.drools.contrib.DroolsCompilerAntTask" />
> <target name="rules" >
> <compiler
> srcdir="${projectPath}src/rules"
> tofile="${projectPath}src/rules/rules.pkg"
> binformat="package"
> classpathref="model.classpath" >
> <include name="supportObjects.drl" />
> </compiler>
> </target>
>
>
> </project>
>
> My DRL:
>
> package gov.ssa.codedObjects
>
> import gov.ssa.codedObjects.SupportObjectsCollection;
>
> declare SecondaryBrain
>
> name : String
> id : int
>
> end
>
> declare ICDCode
>
> code : String
> name : String
>
> end
>
> global SupportObjectsCollection supportObjectsList;
>
> rule "Evaluate Coded Object"
>
> when
> $codedObject : CodedObject(code == 191.0)
> then
> SecondaryBrain brain = new SecondaryBrain();
> brain.setName("Brain Tumor, Cerebrum");
> insert (brain);
> end
>
>
> rule "Evaluate Coded Object Malignent"
>
> when
> $codedObject : CodedObject(code == "239.6" || code ==
"C71.9", $code :
> code)
>
> then
> ICDCode code = new ICDCode();
> code.setCode($code);
> code.setName("Neoplasm of uspecified nature of the Brain");
> insert(code);
>
> end
>
>
>
> rule "Add Brain Neoplasm to List"
>
> when
> $code : ICDCode(code == "239.6" || code == "C71.9")
> then
> supportObjectsList.addToSupportObjects($code);
>
> end
>
> rule "Megaduodenum"
>
> when
> $codedObject : CodedObject(code == "537.3" || code ==
"K59.3", $code :
> code)
>
> then
> ICDCode code = new ICDCode();
> code.setCode($code);
> code.setName("Megaduodenum");
> insert(code);
>
>
> end
>
> rule "Add Megaduodenum to List"
>
> when
> $code : ICDCode(code == "537.3" || code == "K59.3")
> then
> supportObjectsList.addToSupportObjects($code);
>
> end
>
>
> Any suggestions would be helpful.
>
> --
> View this message in context:
http://drools.46999.n3.nabble.com/Ant-Build-of-PKG-with-Declared-Types-tp...
> Sent from the Drools: User forum mailing list archive at Nabble.com.
> _______________________________________________
> rules-users mailing list
> rules-users(a)lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
14 years, 5 months
Fusion and open-ended intervals?
by Barry Kaplan
A fusion design question:
I have events that represent intervals. Initially the intervals are
open-ended (kind a like the current state of an entity). Other events are
matched "during" the interval and correlated. At some point the interval
will be closed (eg, a specific downtime interval is closed because the
device is no online again).
All the events in this system are immutable -- so if some property of an
event changes, it is cloned and modified in working-memory. For the case of
the interval events, initially the interval is inserted open-ended, and at
some point later closed and then modified.
This does not work with fusion however, since an event's duration is
maintained by the fact-handle not the event itself. Hence a modify with a
now closed interval (ie, a finite @duration) has no effect. I'm guessing the
temporal values are maintained the handle to ensure stable values for the
behaviors that trigger based on temporal values, which is reasonable.
So I'm looking for alternative designs. Some are:
1) Modeled the intervals as begin/end events, but that gets messy real
fast (have to correlate
the begin/end events somehow, can't use evaluators like 'includes' or
'during', etc).
2) Retract the interval event when it is closed (this way closed intervals
no longer correlate
with other incoming events). But then we really have a manually
maintained state machine
using only facts, and there can be no reasoning over a series these
interval events.
(eg, 3 downtimes longer than 2 minutes in the last hour).
Opinions?
-barry
--
View this message in context: http://n3.nabble.com/Fusion-and-open-ended-intervals-tp719076p719076.html
Sent from the Drools - User mailing list archive at Nabble.com.
14 years, 5 months