deleting records using rules
by Fnu Mahalakshmi
Hi,
How can I delete records using rules??
I want to fire my rules on a dataset - modify the dataset and delete data not concerned to me after the modification.
can I do this with my rules directly?
Thanks
M
</pre>
<P><hr size=1></P>
<P><STRONG><font color=green>Please consider the environment before printing this email.</font></STRONG></P>
<P><STRONG>Visit our website at <a href="http://www.nyse.com">http://www.nyse.com</a> <br>
*****************************************************************************
<br>
Note: The information contained in this message and any attachment to it is privileged, confidential and protected from disclosure. If the reader of this message is not the intended recipient, or an employee or agent responsible for delivering this message to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please notify the sender immediately by replying to the message, and please delete it from your system. Thank you. NYSE Euronext.
</STRONG></P><pre>
15 years, 9 months
creating specific dataset with help of rules
by Fnu Mahalakshmi
Hi,
Is it possible to trigger out only a specific dataset with help of my rules?
I want only a list of data as my output which has A=10 for example.
Is it possible? How can I do that??
Thank you
M
</pre>
<P><hr size=1></P>
<P><STRONG><font color=green>Please consider the environment before printing this email.</font></STRONG></P>
<P><STRONG>Visit our website at <a href="http://www.nyse.com">http://www.nyse.com</a> <br>
*****************************************************************************
<br>
Note: The information contained in this message and any attachment to it is privileged, confidential and protected from disclosure. If the reader of this message is not the intended recipient, or an employee or agent responsible for delivering this message to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please notify the sender immediately by replying to the message, and please delete it from your system. Thank you. NYSE Euronext.
</STRONG></P><pre>
15 years, 9 months
Re: [rules-users] Uploading rules dynamically
by Fnu Mahalakshmi
Hi,
I was just going through how to work with knowledge builder and have some doubts:
Code sample is as follows:
final KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder();
// this will parse and compile in one step
kbuilder.add(ResourceFactory.newClassPathResource("HelloWorld.drl",
HelloWorldExample.class), ResourceType.DRL);
// Check the builder for errors
if (kbuilder.hasErrors()) {
System.out.println(kbuilder.getErrors().toString());
throw new RuntimeException("Unable to compile \"HelloWorld.drl\".");
}
// get the compiled packages (which are serializable)
final Collection<KnowledgePackage> pkgs = kbuilder.getKnowledgePackages();
// add the packages to a knowledgebase (deploy the knowledge packages).
final KnowledgeBase kbase = KnowledgeBaseFactory.newKnowledgeBase();
kbase.addKnowledgePackages(pkgs);
final StatefulKnowledgeSession ksession = kbase.newStatefulKnowledgeSession();
In the above code: I am manually having to add the .drl file and the classpath to my kbuilder. So don't I just have to end up listing all the files and adding it to my knowledge builder?
Is it that each of the files keeps getting added as and when you update the rule files?
How does the program detect this update?? As I am ending up having to add everything.
Please guide.
Thank you
M
-----Original Message-----
From: rules-users-bounces(a)lists.jboss.org [mailto:rules-users-bounces@lists.jboss.org] On Behalf Of rules-users-request(a)lists.jboss.org
Sent: Tuesday, June 15, 2010 12:00 PM
To: rules-users(a)lists.jboss.org
Subject: rules-users Digest, Vol 43, Issue 75
Send rules-users mailing list submissions to
rules-users(a)lists.jboss.org
To subscribe or unsubscribe via the World Wide Web, visit
https://lists.jboss.org/mailman/listinfo/rules-users
or, via email, send a message with subject or body 'help' to
rules-users-request(a)lists.jboss.org
You can reach the person managing the list at
rules-users-owner(a)lists.jboss.org
When replying, please edit your Subject line so it is more specific
than "Re: Contents of rules-users digest..."
Today's Topics:
1. Re: Uploading rules dynamically (Esteban Aliverti)
2. Re: Dynamic rule file uploading (Fnu Mahalakshmi)
----------------------------------------------------------------------
Message: 1
Date: Tue, 15 Jun 2010 12:12:45 -0300
From: Esteban Aliverti <esteban.aliverti(a)gmail.com>
Subject: Re: [rules-users] Uploading rules dynamically
To: Rules Users List <rules-users(a)lists.jboss.org>
Message-ID:
<AANLkTilRCzG0E9-W6OsVWXHy_kyQNpDdblxitfmg91YZ(a)mail.gmail.com>
Content-Type: text/plain; charset="iso-8859-1"
You can read about Knowledge Agent:
http://hudson.jboss.org/hudson/job/drools/lastSuccessfulBuild/artifact/tr...
Maybe it suits your needs.
2010/6/15 Fnu Mahalakshmi <FMahalakshmi(a)nyx.com>
> Hi Guys,
>
>
>
> How can I dynamically upload my rules? Can someone point me towards some
> documentation for the same??
>
>
>
> Thank you.
>
>
>
> M
>
> ------------------------------
>
> *Please consider the environment before printing this email.*
>
> *Visit our website at http://www.nyse.com
> *****************************************************************************
>
> Note: The information contained in this message and any attachment to it is
> privileged, confidential and protected from disclosure. If the reader of
> this message is not the intended recipient, or an employee or agent
> responsible for delivering this message to the intended recipient, you are
> hereby notified that any dissemination, distribution or copying of this
> communication is strictly prohibited. If you have received this
> communication in error, please notify the sender immediately by replying to
> the message, and please delete it from your system. Thank you. NYSE
> Euronext. *
>
>
> _______________________________________________
> rules-users mailing list
> rules-users(a)lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
>
--
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Esteban Aliverti
15 years, 9 months
Re: [rules-users] Dynamic rule file uploading
by Fnu Mahalakshmi
Hi,
Thanks for the quick reply.
But even by using knowledge agent I have to keep specifying each of the files one by one right? Which ever is contained in my folder with all the rule files? As I would keep doing:
kbuilder.add( ResourceFactory.newUrlResource( "file://myrules.drl" ),
ResourceType.DRL);
So again I would have to list all my files and pass it to the knowledge agent which would add the new rule to the existing package( created using package builder).
Am I going wrong here??
Please help.
Thank you.
M
-----Original Message-----
From: rules-users-bounces(a)lists.jboss.org [mailto:rules-users-bounces@lists.jboss.org] On Behalf Of rules-users-request(a)lists.jboss.org
Sent: Tuesday, June 15, 2010 11:13 AM
To: rules-users(a)lists.jboss.org
Subject: rules-users Digest, Vol 43, Issue 74
Send rules-users mailing list submissions to
rules-users(a)lists.jboss.org
To subscribe or unsubscribe via the World Wide Web, visit
https://lists.jboss.org/mailman/listinfo/rules-users
or, via email, send a message with subject or body 'help' to
rules-users-request(a)lists.jboss.org
You can reach the person managing the list at
rules-users-owner(a)lists.jboss.org
When replying, please edit your Subject line so it is more specific
than "Re: Contents of rules-users digest..."
Today's Topics:
1. Uploading rules dynamically (Fnu Mahalakshmi)
2. Dynamic rule file uploading (Fnu Mahalakshmi)
3. Re: Dynamic rule file uploading (PAYET, Manuel)
----------------------------------------------------------------------
Message: 1
Date: Tue, 15 Jun 2010 10:56:42 -0400
From: Fnu Mahalakshmi <FMahalakshmi(a)nyx.com>
Subject: [rules-users] Uploading rules dynamically
To: "'rules-users(a)lists.jboss.org'" <rules-users(a)lists.jboss.org>
Message-ID:
<994758E35590274E955FA75763C5AA5002D0111F(a)MTEXMBXP01.ad.NYX.com>
Content-Type: text/plain; charset="us-ascii"
Hi Guys,
How can I dynamically upload my rules? Can someone point me towards some documentation for the same??
Thank you.
M
</pre>
<P><hr size=1></P>
<P><STRONG><font color=green>Please consider the environment before printing this email.</font></STRONG></P>
<P><STRONG>Visit our website at <a href="http://www.nyse.com">http://www.nyse.com</a> <br>
*****************************************************************************
<br>
Note: The information contained in this message and any attachment to it is privileged, confidential and protected from disclosure. If the reader of this message is not the intended recipient, or an employee or agent responsible for delivering this message to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please notify the sender immediately by replying to the message, and please delete it from your system. Thank you. NYSE Euronext.
</STRONG></P><pre>
15 years, 9 months
Uploading rules dynamically
by Fnu Mahalakshmi
Hi Guys,
How can I dynamically upload my rules? Can someone point me towards some documentation for the same??
Thank you.
M
</pre>
<P><hr size=1></P>
<P><STRONG><font color=green>Please consider the environment before printing this email.</font></STRONG></P>
<P><STRONG>Visit our website at <a href="http://www.nyse.com">http://www.nyse.com</a> <br>
*****************************************************************************
<br>
Note: The information contained in this message and any attachment to it is privileged, confidential and protected from disclosure. If the reader of this message is not the intended recipient, or an employee or agent responsible for delivering this message to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please notify the sender immediately by replying to the message, and please delete it from your system. Thank you. NYSE Euronext.
</STRONG></P><pre>
15 years, 9 months
Dynamic rule file uploading
by Fnu Mahalakshmi
Hi guys,
I have : {R1.drl,R2.drl,R3.brl}
After conversion and loading I have {R1.drl,R2.drl,R3.brl,R3.drl} files in the same directory where all my rules are stored.
I am using:
File folder = new File("SRC/MAIN/RULES");
File[] listOfFiles = folder.listFiles();
for listing all the files in my rules directory.
Now is there anyway that I can just hold on to the required files whenever my rule files are updated rather than having to manually keeping deleting and updating my rules directory?
Is there a more better way to do it rather than just listing all the files in the directory??
Thanks,
M
</pre>
<P><hr size=1></P>
<P><STRONG><font color=green>Please consider the environment before printing this email.</font></STRONG></P>
<P><STRONG>Visit our website at <a href="http://www.nyse.com">http://www.nyse.com</a> <br>
*****************************************************************************
<br>
Note: The information contained in this message and any attachment to it is privileged, confidential and protected from disclosure. If the reader of this message is not the intended recipient, or an employee or agent responsible for delivering this message to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please notify the sender immediately by replying to the message, and please delete it from your system. Thank you. NYSE Euronext.
</STRONG></P><pre>
15 years, 9 months
Re: [rules-users] Error with executing rules
by Fnu Mahalakshmi
Hi Guys,
Thanks a lot for help!
Got it resolved! Feels good to get it working :)
But have no idea what the problem was :) I created a brand new rule and it worked!
Thanks
M
-----Original Message-----
From: rules-users-bounces(a)lists.jboss.org [mailto:rules-users-bounces@lists.jboss.org] On Behalf Of rules-users-request(a)lists.jboss.org
Sent: Tuesday, June 15, 2010 10:11 AM
To: rules-users(a)lists.jboss.org
Subject: rules-users Digest, Vol 43, Issue 72
Send rules-users mailing list submissions to
rules-users(a)lists.jboss.org
To subscribe or unsubscribe via the World Wide Web, visit
https://lists.jboss.org/mailman/listinfo/rules-users
or, via email, send a message with subject or body 'help' to
rules-users-request(a)lists.jboss.org
You can reach the person managing the list at
rules-users-owner(a)lists.jboss.org
When replying, please edit your Subject line so it is more specific
than "Re: Contents of rules-users digest..."
Today's Topics:
1. Re: Error with executing rules (PAYET, Manuel)
2. Re: Error with executing rules (Giovanni Motta)
----------------------------------------------------------------------
Message: 1
Date: Tue, 15 Jun 2010 16:08:40 +0200
From: "PAYET, Manuel" <manuel.payet(a)capgemini.com>
Subject: Re: [rules-users] Error with executing rules
To: Rules Users List <rules-users(a)lists.jboss.org>
Message-ID:
<5104F06B63E3164FAEB2F42B920311654CCCA2DC(a)CORPMAIL05.corp.capgemini.com>
Content-Type: text/plain; charset="iso-8859-1"
a : A( modified == "false" ) ==> here "false" is a String
and a.setModified( true ); ==> here true is a boolean
from your use of modified, I presume that modified is of boolean type. If it is, you'd probably want to do something like
rule "Rule3"
dialect "mvel"
when
a : A( modified == false )
then
a.setModified( true );
update( a );
end
because, modified will never be equal to "false" in your file cause it"s a String
________________________________
De : rules-users-bounces(a)lists.jboss.org [mailto:rules-users-bounces@lists.jboss.org] De la part de Fnu Mahalakshmi
Envoy? : mardi 15 juin 2010 16:03
? : 'rules-users(a)lists.jboss.org'
Objet : [rules-users] Error with executing rules
Hi guys,
I have few .drl rules and 1 .brl rule (which I converted into a .drl rule as guided by the documentation online)
All my rules get created and fired. But the converted .brl rule does not get executed only.
I am unable to understand why.
Anyway I can check how it is working??
I put in the most basic rule which should work:
The coverted .drl file looks like this:
rule "Rule3"
dialect "mvel"
when
a : A( modified == "false" )
then
a.setModified( true );
update( a );
end
// A being my fact with attribute modified set to false in the beginning.
The import statements are in a rule.package in the same folder.
Please help me. I do not understand why this rule doesn't get executed. All others do!
Thanks
M
________________________________
Please consider the environment before printing this email.
Visit our website at http://www.nyse.com
*****************************************************************************
Note: The information contained in this message and any attachment to it is privileged, confidential and protected from disclosure. If the reader of this message is not the intended recipient, or an employee or agent responsible for delivering this message to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please notify the sender immediately by replying to the message, and please delete it from your system. Thank you. NYSE Euronext.
</PRE><p style="font-family:arial;color:grey" style="font-size:13px">This message contains information that may be privileged or confidential and is the property of the Capgemini Group. It is intended only for the person to whom it is addressed. If you are not the intended recipient, you are not authorized to read, print, retain, copy, disseminate, distribute, or use this message or any part thereof. If you receive this message in error, please notify the sender immediately and delete all copies of this message.</p><PRE>
15 years, 9 months
Re: [rules-users] Drools 5.1.0.M2 - WorkItemNodeInstance -- Listeners can't get hold of WorkItem object
by Vijay K Pandey
Any one on this issue? Any Drools Flow expert?
Appreciate your time for taking a look at it.
Thanks
Vijay
From: Vijay K Pandey
Sent: Thursday, June 10, 2010 12:03 PM
To: 'Rules Users List'
Subject: RE: Drools 5.1.0.M2 - WorkItemNodeInstance -- Listeners can't get hold of WorkItem object
Should I log this as a JIRA ticket.
Thanks
Vijay
From: Vijay K Pandey
Sent: Wednesday, June 09, 2010 9:57 AM
To: 'Rules Users List'
Subject: Drools 5.1.0.M2 - WorkItemNodeInstance -- Listeners can't get hold of WorkItem object
Hi,
There is a change done in Drools 5.1.0.M2 - org.drools.workflow.instance.node.WorkItemNodeInstance class in the method
public void triggerCompleted(WorkItem workItem) at line 196 which is setting the workItemId as -1
this.workItemId = -1;
Due to the above change the listeners which are attached to the "complete" event of the work item - such as the method below
public void beforeNodeLeft(ProcessNodeLeftEvent event) are not able to get hold of the associated workitem object as it returns null.
Is there any specific reason that workItemId is set to -1 even before the associated listeners get triggered or is this a bug?
If it was an intended change then how do I get hold of the "WorkItem" object in the attached listeners.
Thanks
Vijay
p.s This change was not there in the snapshot of 18th April 2010 which I was earlier working on. Above is the only change in this class from the snapshot of 18th April and 5.1.0.M2
15 years, 9 months
Re: [rules-users] rules-users Digest, Vol 43, Issue 72
by Fnu Mahalakshmi
Hi,
Thanks for the quick response.
I sent you the converted .drl file.
It gets set like that automatically after conversion.
I just include false in the literal field not "false".
How else could I specify that?
Thanks
M
-----Original Message-----
From: rules-users-bounces(a)lists.jboss.org [mailto:rules-users-bounces@lists.jboss.org] On Behalf Of rules-users-request(a)lists.jboss.org
Sent: Tuesday, June 15, 2010 10:11 AM
To: rules-users(a)lists.jboss.org
Subject: rules-users Digest, Vol 43, Issue 72
Send rules-users mailing list submissions to
rules-users(a)lists.jboss.org
To subscribe or unsubscribe via the World Wide Web, visit
https://lists.jboss.org/mailman/listinfo/rules-users
or, via email, send a message with subject or body 'help' to
rules-users-request(a)lists.jboss.org
You can reach the person managing the list at
rules-users-owner(a)lists.jboss.org
When replying, please edit your Subject line so it is more specific
than "Re: Contents of rules-users digest..."
Today's Topics:
1. Re: Error with executing rules (PAYET, Manuel)
2. Re: Error with executing rules (Giovanni Motta)
----------------------------------------------------------------------
Message: 1
Date: Tue, 15 Jun 2010 16:08:40 +0200
From: "PAYET, Manuel" <manuel.payet(a)capgemini.com>
Subject: Re: [rules-users] Error with executing rules
To: Rules Users List <rules-users(a)lists.jboss.org>
Message-ID:
<5104F06B63E3164FAEB2F42B920311654CCCA2DC(a)CORPMAIL05.corp.capgemini.com>
Content-Type: text/plain; charset="iso-8859-1"
a : A( modified == "false" ) ==> here "false" is a String
and a.setModified( true ); ==> here true is a boolean
from your use of modified, I presume that modified is of boolean type. If it is, you'd probably want to do something like
rule "Rule3"
dialect "mvel"
when
a : A( modified == false )
then
a.setModified( true );
update( a );
end
because, modified will never be equal to "false" in your file cause it"s a String
________________________________
De : rules-users-bounces(a)lists.jboss.org [mailto:rules-users-bounces@lists.jboss.org] De la part de Fnu Mahalakshmi
Envoy? : mardi 15 juin 2010 16:03
? : 'rules-users(a)lists.jboss.org'
Objet : [rules-users] Error with executing rules
Hi guys,
I have few .drl rules and 1 .brl rule (which I converted into a .drl rule as guided by the documentation online)
All my rules get created and fired. But the converted .brl rule does not get executed only.
I am unable to understand why.
Anyway I can check how it is working??
I put in the most basic rule which should work:
The coverted .drl file looks like this:
rule "Rule3"
dialect "mvel"
when
a : A( modified == "false" )
then
a.setModified( true );
update( a );
end
// A being my fact with attribute modified set to false in the beginning.
The import statements are in a rule.package in the same folder.
Please help me. I do not understand why this rule doesn't get executed. All others do!
Thanks
M
________________________________
Please consider the environment before printing this email.
Visit our website at http://www.nyse.com
*****************************************************************************
Note: The information contained in this message and any attachment to it is privileged, confidential and protected from disclosure. If the reader of this message is not the intended recipient, or an employee or agent responsible for delivering this message to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please notify the sender immediately by replying to the message, and please delete it from your system. Thank you. NYSE Euronext.
</PRE><p style="font-family:arial;color:grey" style="font-size:13px">This message contains information that may be privileged or confidential and is the property of the Capgemini Group. It is intended only for the person to whom it is addressed. If you are not the intended recipient, you are not authorized to read, print, retain, copy, disseminate, distribute, or use this message or any part thereof. If you receive this message in error, please notify the sender immediately and delete all copies of this message.</p><PRE>
15 years, 9 months
Error with executing rules
by Fnu Mahalakshmi
Hi guys,
I have few .drl rules and 1 .brl rule (which I converted into a .drl rule as guided by the documentation online)
All my rules get created and fired. But the converted .brl rule does not get executed only.
I am unable to understand why.
Anyway I can check how it is working??
I put in the most basic rule which should work:
The coverted .drl file looks like this:
rule "Rule3"
dialect "mvel"
when
a : A( modified == "false" )
then
a.setModified( true );
update( a );
end
// A being my fact with attribute modified set to false in the beginning.
The import statements are in a rule.package in the same folder.
Please help me. I do not understand why this rule doesn't get executed. All others do!
Thanks
M
</pre>
<P><hr size=1></P>
<P><STRONG><font color=green>Please consider the environment before printing this email.</font></STRONG></P>
<P><STRONG>Visit our website at <a href="http://www.nyse.com">http://www.nyse.com</a> <br>
*****************************************************************************
<br>
Note: The information contained in this message and any attachment to it is privileged, confidential and protected from disclosure. If the reader of this message is not the intended recipient, or an employee or agent responsible for delivering this message to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please notify the sender immediately by replying to the message, and please delete it from your system. Thank you. NYSE Euronext.
</STRONG></P><pre>
15 years, 9 months