Rule not working with Change_set.xml
by anniejoseph
Hi,
I'm trying to use change-set.xml, which pionts to a drl file.My code is
try {
url =new URL("file:config/change-set.xml");
} catch (MalformedURLException e) {
e.printStackTrace();
}
kagent = KnowledgeAgentFactory.newKnowledgeAgent( "MyAgent" );
kagent.applyChangeSet( ResourceFactory.newUrlResource( url ) );
kbase = kagent.getKnowledgeBase();
ksession= kbase.newStatefulKnowledgeSession();
sconf
=ResourceFactory.getResourceChangeScannerService().newResourceChangeScannerConfiguration();
sconf.setProperty( "drools.resource.scanner.interval", "10" );
ResourceFactory.getResourceChangeScannerService().configure( sconf );
ResourceFactory.getResourceChangeNotifierService().start();
ResourceFactory.getResourceChangeScannerService().start();
ksession.insert(object);
ksession.fireAllRules();
and my change-set.xml is:-
<?xml version="1.0" encoding="UTF-8"?>
<change-set xmlns='http://drools.org/drools-5.0/change-set'
xmlns:xs='http://www.w3.org/2001/XMLSchema-instance'
xs:schemaLocation='http://drools.org/drools-5.0/change-set
http://anonsvn.jboss.org/repos/labs/labs/jbossrules/trunk/drools-api/src/...'
>
<add>
<resource source ='file:config/Rule.drl' type='DRL'
basicAuthentication='enabled' username='admin' password='admin'></resource>
</add>
</change-set>
This code worked without any exception, but the rule is not executing. I
tried without changeset.xml and rule worked properly.
What is wrong?
Thanks
--
View this message in context: http://drools.46999.n3.nabble.com/Rule-not-working-with-Change-set-xml-tp...
Sent from the Drools: User forum mailing list archive at Nabble.com.
12 years, 2 months
Listening to changes on facts
by jspartan0901
Hello,
I am currently evaluating fusion for our project. We are planning to deploy
it on an application server.
When a rule is successfully executed. I need to generate an action such as
sending a message to a queue.
As per my understanding so far, when a rule matches conditions, we need to
insert a fact in the working memory and listen for changes in the java code.
Can anyone please share a piece of code on how to listen on changes to
facts?
Thanks!
Sam
--
View this message in context: http://drools.46999.n3.nabble.com/Listening-to-changes-on-facts-tp4020231...
Sent from the Drools: User forum mailing list archive at Nabble.com.
12 years, 2 months
firing rules twice in single session on single object
by Sai Nadh
hi ,
I am able to fire the rules in drools...But i want to fire the rules
after modification of same data
ie.., i want to fire the rules twice in the same session
for example: i have some stock of different items, if the particular stock
item quantity is less than minimum quantity i want fire a rule that order
that quantity
after that the stock is added to that previous count(stock), i want to
recheck the stock positions and again need to fire rules
is it possible to fire the rules twice or more in Drools
if, please provide me some sample code....
I want to know that Drools can fire a rule multiple times in one session or
not????
please let me know if possible and guide me in this scenario
thanks in advance
12 years, 2 months
How to Use functions in Web-Guided Editor
by ayonchak
Hi All,
I am facing some problem when migrating from excel-based drools to Drools
Guvnor. Suppose we are using some function in the Conditions and Actions of
excel. But how to write them in Guvnor as in Guvnor I can only get the value
of the condition and set the value of the variable in action. Then I can
manipulate the value in code. But is there any option of doing that in Rule?
Like I am using this in an action of excel based Drools -
long mnthlyBnft=$1*1L;
if(planRule.getMonthlyBnftList().size() == 0)
{
do
{
planRule.getMonthlyBnftList().add(mnthlyBnft);
mnthlyBnft = mnthlyBnft + $3;
}while(mnthlyBnft<=$2);
}
In the values I am giving 3 comma-separated values for $1, $2 and $3.
How to do the same in Guvnor? I saw the new function option in Guvnor but
didn't find anywhere how to use that in Web-Guide based decision table rule.
Please help me. Thanks!
Ayon
--
View this message in context: http://drools.46999.n3.nabble.com/How-to-Use-functions-in-Web-Guided-Edit...
Sent from the Drools: User forum mailing list archive at Nabble.com.
12 years, 2 months
what is best way to deal with db access in rules?
by mpgong
Hello,
I have some rules that go out to a database to pull values for conditions in
my rules, is this something that isn't wise to do? Problem is that with
even a small set of facts about ~5500, things take a while to run with about
100 rules. Most of the time, we are thinking is from the db access. It
would take several hours to finish. We want to see if we can get this down
to under 30mins or better.
So the question is what is the best way handle these conditions, should we
make the queries before running the rules and loading them as facts in the
engine or is there some other means to do this more efficiently?
Thanks
--
View this message in context: http://drools.46999.n3.nabble.com/what-is-best-way-to-deal-with-db-access...
Sent from the Drools: User forum mailing list archive at Nabble.com.
12 years, 2 months
Rule not working with Change_set.xml
by anniejoseph
Hi,
I'm trying to use change-set.xml, which pionts to a drl file.My code is
try {
url =new URL("file:config/change-set.xml");
} catch (MalformedURLException e) {
e.printStackTrace();
}
kagent = KnowledgeAgentFactory.newKnowledgeAgent( "MyAgent" );
kagent.applyChangeSet( ResourceFactory.newUrlResource( url ) );
kbase = kagent.getKnowledgeBase();
ksession= kbase.newStatefulKnowledgeSession();
sconf
=ResourceFactory.getResourceChangeScannerService().newResourceChangeScannerConfiguration();
sconf.setProperty( "drools.resource.scanner.interval", "10" );
ResourceFactory.getResourceChangeScannerService().configure( sconf );
ResourceFactory.getResourceChangeNotifierService().start();
ResourceFactory.getResourceChangeScannerService().start();
ksession.insert(object);
ksession.fireAllRules();
and my change-set.xml is:-
<?xml version="1.0" encoding="UTF-8"?>
<change-set xmlns='http://drools.org/drools-5.0/change-set'
xmlns:xs='http://www.w3.org/2001/XMLSchema-instance'
xs:schemaLocation='http://drools.org/drools-5.0/change-set
http://anonsvn.jboss.org/repos/labs/labs/jbossrules/trunk/drools-api/src/...'
>
<add>
<resource source ='file:config/Rule.drl' type='DRL'
basicAuthentication='enabled' username='admin' password='admin'></resource>
</add>
</change-set>
This code worked without any exception, but the rule is not executing. I
tried without changeset.xml and rule worked properly.
What is wrong?
Thanks
--
View this message in context: http://drools.46999.n3.nabble.com/Rule-not-working-with-Change-set-xml-tp...
Sent from the Drools: User forum mailing list archive at Nabble.com.
12 years, 2 months
Not able to upload POJO model jar in Oracle DB.
by Manasi
Hi,
Currently I am using Oracle 11g DB for Guvnor repository for storing my
rules and POJO model jar.
After guvnor instance is started following 11 tables are created in Oracle
11g DB schema.
1) FS_FSENTRY
2) FS_WS_DEFAULT_FSENTRY
3) PM_WS_DEFAULT_BINVAL
4) PM_WS_DEFAULT_BUNDLE
5) PM_WS_DEFAULT_NAMES
6) PM_WS_DEFAULT_REFS
7) VERSIONING_FS_FSENTRY
8) VERSIONING_PM_BINVAL
9) VERSIONING_PM_BUNDLE
10) VERSIONING_PM_NAMES
11) VERSIONING_PM_REFS
I have copied *"ojdbc6.jar"* jar in my tomcat 7's lib folder. I am using jdk
1.7.
I am able to create packages in oracle but not able to uplaod my model jar
in DB.
Please find attach file Oracle_Error.txt
<http://drools.46999.n3.nabble.com/file/n4020187/Oracle_Error.txt> for
error log:
In MySQL DB uploading of jar works fine.
Please let me know if there is any issue in Oracle version?
Thanks,
Manasi
--
View this message in context: http://drools.46999.n3.nabble.com/Not-able-to-upload-POJO-model-jar-in-Or...
Sent from the Drools: User forum mailing list archive at Nabble.com.
12 years, 2 months