Drools Persistence Prob : No values going into 'VaraibleInstanceInfo' Table
by Pardeep.Ruhil@lntinfotech.com
Hi,
I am working on persisting Drools session info into the database.
For that I have taken a sample project from
http://blog.athico.com/2009/09/drools-flow-variable-persistence.html.
When I tried to debug the project, no values are inserted into the table
'VaraibleInstanceInfo' table.
However In between the debugging I am able to see data going into the
table 'SessionInfo' , 'ProcessInstaceInfo', WorkItemInfo' table. But no
data is going into the 'VaraibleInstanceInfo' and
'ProcessInstanceEventInfo' table.
I have taken the code for VariableInstanceInfo.java,
SerializablePersistedVariable.java, JPAPersistedVariable.java and other
required classes for running the project from
http://anonsvn.jboss.org/repos/labs/labs/jbossrules/trunk/drools-persiste...
Kindly tell me what going wrong in this. I am using Mysql database for
persistence storage.
Thanks & Regards
Pardeep Ruhil
L&T Infotech Ltd
Mumbai
Ph: +919820283884
Larsen & Toubro Infotech Ltd.
www.Lntinfotech.com
This Document is classified as:
L&T Infotech Proprietary L&T Infotech Confidential L&T Infotech
Internal Use Only L&T Infotech General Business
This Email may contain confidential or privileged information for the
intended recipient (s) If you are not the intended recipient, please do
not use or disseminate the information, notify the sender and delete it
from your system.
______________________________________________________________________
15 years
boics ufwlvbbk
by Returned mail
Your message was not delivered due to the following reason:
Your message could not be delivered because the destination server was
unreachable 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 3 days:
Host 40.187.131.135 is not responding.
The following recipients did 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.
15 years
Specific Agenda strategy to control which rules to fire
by Costigliola Joel (EXT)
Hello all,
I need some help to to set a specific Agenda strategy in order to control finely which activated rules will be fired.
Problem context :
-----------------
My company is a bank where traders are making deals on markets, these deals must be classified in book, this is what we call "booking process".
Booking is done according to booking criteria : which trader has made the deal ? on which product ? wich market ? etc ...
A booking rule defines a set of criteria and the target book where the deal will classified, it also has a priority, note that it is ok that two booking rule have same priority.
I want to implement booking rule as Drools rule.
Several booking rule can be applied to a deal, in that case choosing the right booking rule to fire depends on the following algorithm :
- look all the activated booking rule of the highest priority,
--- if there is a unique rule apply it
--- if there is no unique rule (0 rule or more than one), look at rules of a lesser priority and apply the same logic.
Next section is an example that will clear things (I hope).
Example :
---------
A deal D1 has been done by Alex on NY market to buy Google stocks.
We have 3 booking rules :
- BR1 : criteria = trader=Alex / book = B1
- BR2 : criteria = trader=Alex and product = google stock / book = B2
As BR2 is more precise than BR1, il will matches the deal and book it in B1
If the deal was on another product, BR1 would have been applied.
Things gets more complicated when 2 rules of same priority can be applied.
Let's imagine we add the following booking rule
- BR3 : criteria = trader=Alex and market = NY / book = B3
We have a problem to book D1 since BR2 and BR3 can be applied but have same priority.
We can't choose one over the other thus we must apply a less precise/prioritary rule (if unique at its own precision level).
In my example, that would lead to apply BR1.
Question :
----------
If I define BR1,BR2,BR3 as Drools rules, how can I tell Drools :
- to execute a rule only if there is no other active rule with same precision that could be applied ?
- to look for a unique matching rule with less precision level ?
I think it's the Agenda responsibility to take this decision, but I don't know how implement that.
Can you give some advices on that ?
Thanks for your lights in advance,
Regards,
Joel
--------------------------------------------------------
Ce courriel et toutes les pieces jointes sont confidentiels et peuvent etre couverts par un privilege ou une protection legale. Il est etabli a l'attention exclusive de ses destinataires. Toute utilisation de ce courriel non conforme a sa destination, toute diffusion ou toute publication, totale ou partielle, est interdite, sauf autorisation expresse prealable. Toutes opinions exprimees dans ce courriel ne sauraient necessairement refleter celle de Natixis, de ses filiales. Elles sont aussi susceptibles de modification sans notification prealable. Si vous recevez ce courriel par erreur, merci de le detruire et d'en avertir immediatement l'expediteur. L'Internet ne permettant pas d'assurer l'integrite de ce courriel, Natixis decline toute responsabilite s'il a ete altere, deforme ou falsifie et chaque destinataire qui utilise ce mode de communication est suppose en accepter les risques.
This email and any attachment are confidential and may be legally privileged or otherwise protected from disclosure. It is intended only for the stated addressee(s) and access to it by any other person(s) is unauthorised. Any use, dissemination or disclosure not in accordance with its purpose, either in whole or in part, is prohibited without our prior formal approval. Any opinion expressed in this email may not necessarily reflect the opinion of Natixis, its affiliates. It may also be subject to change without prior notice. If you are not an addressee, you must not disclose, copy, circulate or in any other way use or rely on the information contained in this email. If you have received it in error, please inform us immediately and delete all copies. The Internet can not guarantee the integrity of this email therefore Natixis shall not be liable for the email if altered, changed or falsified and anyone who communicates with us by e-mail is taken to accept these risks.
--------------------------------------------------------
15 years
Can DSL / DSLR be loaded in a changeset?
by Pegram, Macon
All,
I asked this question earlier this week, but didn't get a response. I
may have provided too much information, so let me distill it down to
this simple question....
Can DSL/DSLR files be loaded and accessed as part of a KnowledgeBase
constructed using the KnowledgeAgent / changeset model in Drools 5.0.1
My test code, attached to my earlier post, suggests this does not work.
Macon
15 years
java.lang.NoClassDefFoundError
by Hemanth kumar
hi iam working on sample drools project.
In that i was dynamically loading a fact ang running the rule engine.
Based on the reply from the people of y previous post i have made some
modifications.
In the Eclipse editor it works fine.but when i call it externally it is
throwing the error.I guess class path was recognised by the ruleengine
------------------------------------------------------------------------------------
java class
static String path="C:\\Program Files\\Apache Software Foundation\\Tomcat
6.0\\webapps\\JStudio\\WEB-INF\\classes\\";
try{
System.out.println("Initializing Fact....");
URL[] urls = new URL[]{ new URL("file://"+path) };
ClassLoader loader = new URLClassLoader(urls);
Class clazz = loader.loadClass("test.Message");
Object factObj = clazz.newInstance();
Method method = clazz.getMethod("setMessage", new
Class[]{String.class});
Method method1 = clazz.getMethod("getMessage");
//System.out.println("facts loaded\n");
method.invoke(factObj, new Object[]{"Hello"});
System.out.println("initializing packageBuilder");
PackageBuilderConfiguration config = new PackageBuilderConfiguration();
config.setClassLoader(loader);
KnowledgeBuilder kbuilder =
KnowledgeBuilderFactory.newKnowledgeBuilder(config);
System.out.println("finding Rule");
kbuilder.add(ResourceFactory.newClassPathResource("test/Sample.drl"),ResourceType.DRL);
if (kbuilder.hasErrors())
throw new RuntimeException("Unable to compile rules. " +
kbuilder.getErrors().toString());
KnowledgeBase kbase = KnowledgeBaseFactory.newKnowledgeBase(new
RuleBaseConfiguration(loader));
kbase.addKnowledgePackages(kbuilder.getKnowledgePackages());
StatelessKnowledgeSession session =
kbase.newStatelessKnowledgeSession();
System.out.println("running rule....... \n");
session.execute(factObj);
System.out.println("\nend...\n");
}
catch (Throwable t) {
t.printStackTrace();
}
---------------------------------------------------------------------------------
tomcat output console
http://www.nabble.com/file/p26109542/console.PNG console.PNG
suggest me any ideas
Hemanth
--
View this message in context: http://www.nabble.com/java.lang.NoClassDefFoundError-tp26109542p26109542....
Sent from the drools - user mailing list archive at Nabble.com.
15 years
[droolsflow] JPAVariablePersister - Multiple Entries for Variables passed into ForEach
by Bill Tarr
I'm seeing some strange behavior in the JPAPersistedVariable.
In this case, my Claim has 2 Role objects. So my Claim workflow has a ForEach, passing in a Role to each.
Here is the console output, notice the same Role @Entity having JPAPersistedVariable objects added for them twice.
Variable claim -> Persisting external Entity for the first time =com.csatp.svc.rulesmgr.claim.Claim @ 3881fab4
Saving JPAPersistedVariable id=1 entityId=1 class=com.csatp.svc.rulesmgr.claim.Claim value=com.csatp.svc.rulesmgr.claim.Claim @ 51414b4
<<<<< Persisting variable claim = com.csatp.svc.rulesmgr.claim.Claim @ 51414b4
Variable 3:2:role -> Updating external Entity = com.csatp.svc.rulesmgr.claim.Role @ a87f09d8
Saving JPAPersistedVariable id=2 entityId=1 class=com.csatp.svc.rulesmgr.claim.Role value=com.csatp.svc.rulesmgr.claim.Role @ a87f09d8
<<<<< Persisting variable 3:2:role = com.csatp.svc.rulesmgr.claim.Role @ a87f09d8
Variable 3:3:role -> Updating external Entity = com.csatp.svc.rulesmgr.claim.Role @ b3ee9f8b
Saving JPAPersistedVariable id=3 entityId=2 class=com.csatp.svc.rulesmgr.claim.Role value=com.csatp.svc.rulesmgr.claim.Role @ b3ee9f8b
<<<<< Persisting variable 3:3:role = com.csatp.svc.rulesmgr.claim.Role @ b3ee9f8b
Variable role -> Updating external Entity = com.csatp.svc.rulesmgr.claim.Role @ a87f09d8
Saving JPAPersistedVariable id=4 entityId=1 class=com.csatp.svc.rulesmgr.claim.Role value=com.csatp.svc.rulesmgr.claim.Role @ a87f09d8
<<<<< Persisting variable role = com.csatp.svc.rulesmgr.claim.Role @ a87f09d8
Variable role -> Updating external Entity = com.csatp.svc.rulesmgr.claim.Role @ b3ee9f8b
Saving JPAPersistedVariable id=5 entityId=2 class=com.csatp.svc.rulesmgr.claim.Role value=com.csatp.svc.rulesmgr.claim.Role @ b3ee9f8b
<<<<< Persisting variable role = com.csatp.svc.rulesmgr.claim.Role @ b3ee9f8b
I've attached a screenshot of my SQL Server, lets see if it gets scrubbed out...
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
15 years
Decision tables
by Chris Richmond
Hello,
What is the most straightforward example of using a decision table for
rules(CSV or Excel) within the sample code?
Essentially I want to check if it would work for the usage case where I want
the end user to be able to set all sorts of parameter limit values for rules
on objects being evaluate by rules. Also I would like for them to be able
to set limits on combinations of objects via decision tables. Allowing the
user to state specifically in the decision table something like:
If I have more than 3 of these objects then look at the fieldB of all these
objects, if any of these have "X" for fieldB then look at fieldC for all of
them and sum the total of all fieldC 's for all objects in memory and if
that number is above "Z" then do something
But if there are less than 3 but more than 1(essentially 2) of these
objects, then simply look at fieldC for both objects and reset fieldD for
whichever object has a lower value for fieldM.
Can decision tables be made to handlie this sort of flexible and extensible
decision matrix, or would that not be good fit for scenarios like this?
Thanks,
Chris
15 years
Drools fusion and absence of events
by Richard Ambridge
Hi,
Trying to get to grips with Fusion and absence of events...
If I have a Bean that has just a simple variable, e.g. class
MyBean { private String name; getter+setter }
I want to use events to determine when an object with name=="one"
is available, and no object with name=="two" appears within 10 seconds..
So, I write a rule:
declare MyBean
@role( event)
end
rule "myrule'
when
$a : MyBean(name=="one");
not( MyBean(name=="two", this after [0s,10s] $a))
then
//do something
end
If I inject an object with Name="one", and then wait 10seconds, I
get the 'myrule' fired, great!
But, if i inject an object with name="one" and then 1second later I
inject an object with name="other"
the 'myrule' is fired..
Looking at the manual, this seems kind of correct, the rule says if
I have a "one" and not a bean with name=="two"
which I do, as I have a 'one' and a 'other'
But, how do I write the rule to say, I have a 'one' and 'two' doesn't
turn up?
Cheers
Ric
15 years
question about Process Instances
by Daniel Miller
Another question about Process Instances:
Is there a way to inject variables into a running process instance? I
know when I start the process I can pass a Map of variables, but is
there a way to continue injecting variables -- like
processInstance.setVariable("myVariable",myValuedObject); ?
Thanks,
Dan Miller
15 years
Question about signalEvent method
by Daniel Miller
Alright, I feel dumb posting this question, but I can't seem to find
an answer anywhere.
When I use signalEvent, I know I'm passing it the event I want to
fire, but then there is the "Object event" parameter. What exactly
happens if I fill this parameter? What I'd like to do is the following:
Get a running process id, and signal an event on the process -- in my
case "AttachAudio". However, the AttachAudio is going to be proceeded
by an action, which will be responsible for actually attaching my
audio object to a running Alert in my system.
So, obviously I need to inject the audio object into my process
instance. Is that what the "event" parameter does on signalEvent?
And if so, how does it know what variable to inject the object into?
If not, how can I do something like processInstance.setVariable
("audio",audioObject); processInstance.signalEvent
("AttachAudio",null); ?
Thanks for your help in advance.
Dan Miller
15 years