How to import Declarative model from Guvnor to eclispe ?
by Manohar Kokkula
Hi to All,
I am new to Guvnor.
I want to import Declarative model from Guvnor into Eclipse. How can I
declare it in
eclipse?.
I used API's from BRMS userguide, but i am unable to get it.
Please guide me in proper way.
Thanks,
Manohar Kokkula
Mailto: manohar.kokkula(a)tcs.com
=====-----=====-----=====
Notice: The information contained in this e-mail
message and/or attachments to it may contain
confidential or privileged information. If you are
not the intended recipient, any dissemination, use,
review, distribution, printing or copying of the
information contained in this e-mail message
and/or attachments to it are strictly prohibited. If
you have received this communication in error,
please notify us by reply e-mail or telephone and
immediately and permanently delete the message
and any attachments. Thank you
13 years, 1 month
Rules called with null references?
by Robert Crawford
I have this rule:
rule "Defrost: Turned On"
when
$reading : SwitchReading( switchOn == true ) from entry-point
"ReadingsStream"
not SwitchReading (this.circuit == $reading.circuit, this after $reading
) from entry-point "ReadingsStream"
not DefrostSwitchOn(this.circuit == $reading.circuit)
then
LOG.info("Defrost switch turned on by reading '" + $reading + "'.");
insert(new DefrostSwitchOn($reading));
end
SwitchReading is an event; DefrostSwitchOn is a POJO fact.
Multiple times I've gotten exceptions where this rule's RHS is called with a
null. The ConsequenceExceptionHandler is supposed to list the facts the RHS
was called with, but it's getting an empty list.
Now, I know my system as it currently stands can take a LONG time between
receiving an event and executing the consequence, primarily when it first
starts and is loading its previous known state. It's entirely believable to
me that the event will have expired before the rule's RHS is called. But
shouldn't the event still be referenced by the Activation?
--
View this message in context: http://drools.46999.n3.nabble.com/Rules-called-with-null-references-tp347...
Sent from the Drools: User forum mailing list archive at Nabble.com.
13 years, 1 month
I have 1000 rules, i want to create each 100 as one set , and fire each set when necessary
by srinivasasanda
Hi EveryOne..
Please if any one know give me some link, or sample example, or
suggest how to do this, Thank u in advance
I am Having 1000 rules and i want to make each 100 rules as one set, so i
will 10 set , can i fire only 1 set when necessary, can i add a new rule to
existing set dynamically,
what is necessary of making more than one drl files, and how to load all drl
at once.
I am very new to drools.. Please suggest me some solution
--
View this message in context: http://drools.46999.n3.nabble.com/I-have-1000-rules-i-want-to-create-each...
Sent from the Drools: User forum mailing list archive at Nabble.com.
13 years, 1 month
How to get the declared FactType in Guvnor into Eclipse ?
by Manohar Kokkula
Hi All,
I defined Declarative model, Bank with fields( name, accntno, balance,
deposit) in com.simple package in Guvnor-5.2,
and also defined one Guided rule and one test scenario and tested
successfully in Guvnor.
But when I am trying to use same Declarative model(Bank) through API's in
Eclipse,
I am getting following error,
java.lang.NullPointerException
Here is my Declarativemainclass:
In Eclipse, I defined BankDTableChangeSet.xml and
Declarativemainclass.java defined in com/model package.
public class Declarativemainclass {
public static void main(String args[])
{
try
{
// get a reference to a knowledge base with a declared
type:
KnowledgeBase kbase =createKnowledgeBase();
// get the declared FactType from Guvnor
FactType bankType = (FactType) kbase.getFactType( "com.simple", "Bank" );
// Here I am getting above exception
// handle the type as necessary:
// create instances:
Object bank = bankType.newInstance();
// set attributes values
bankType.set(bank, "name","Govinda");
bankType.set(bank, "accntno", 498);
// insert fact into a session
StatefulKnowledgeSession ksession
=kbase.newStatefulKnowledgeSession();
ksession.insert(bank);
ksession.fireAllRules();
// read attributes
int value1=(Integer) bankType.get(bank, "balance");
int value2=(Integer) bankType.get(bank,"deposit");
System.out.println(value1+"\t"+value2);
}
catch(Exception e)
{
System.out.println(e);
}
}
private static KnowledgeBase createKnowledgeBase()
{
KnowledgeAgent kagent =
KnowledgeAgentFactory.newKnowledgeAgent("BankAgent");
Resource changeset =
ResourceFactory.newClassPathResource("com/model/BankDTableChangeSet.xml");
kagent.applyChangeSet(changeset);
KnowledgeBase kbase = kagent.getKnowledgeBase();
return kbase;
}
}
Please help me anyone...
Thanks and regards
Manohar Kokkula
Mailto: manohar.kokkula(a)tcs.com
=====-----=====-----=====
Notice: The information contained in this e-mail
message and/or attachments to it may contain
confidential or privileged information. If you are
not the intended recipient, any dissemination, use,
review, distribution, printing or copying of the
information contained in this e-mail message
and/or attachments to it are strictly prohibited. If
you have received this communication in error,
please notify us by reply e-mail or telephone and
immediately and permanently delete the message
and any attachments. Thank you
13 years, 1 month
Camel Endpoint usage strategy
by esstrata
Hi,
we're refactoring a standalone application (Spring 3.0.5, Drool 5.1.1) to
use Apache Camel 2.8.0. As seen in other post, there is very little
information available about (
http://downloads.jboss.com/drools/docs/5.1.1.34858.FINAL/drools-integrati...
Drools Endpoint or Camel integration ). We don't want to use drools-server
as having a web container is not an option.
The app basically loads from large CSV files, processes each row with lots
of rules and inserts the result in a DB. It is therefore a pretty demanding
process.
Here is an excerpt of what it does without Camel:
/
while (scanner.hasNextLine()) {
...
FactHandle trafficHandle = session.insert(row);
session.fireAllRules();
session.retract(trafficHandle);
}
/
What we'd like to achieve is performing the above loop content in an
endpoint/processor (?) and configure it to use multiple threads so several
rows can be handled simultaneously.
Any sugestions?.
Thank you
--
View this message in context: http://drools.46999.n3.nabble.com/Camel-Endpoint-usage-strategy-tp3524173...
Sent from the Drools: User forum mailing list archive at Nabble.com.
13 years, 1 month