Re: [rules-users] Need help related to collection of data accessing in rule file.
by prasad raju sagi
Hi ,
I am trying to create rule on a fact , which contains arraylist of collection and the object in the collection internally contains an arraylist of another collection of objects.
This looks like object A contains collection of objects B and B contains collection object C
A -> blist ( Arraylist<B> )
B -> clist (ArrayList<C> )
C-> dlist( ArrayList<D>)
D-> type ( string)
I am inseting A as fact to the working memory.
I am in confusion state like how to write the rule to place conditions on collection C.
Can I use from in the form of nested from in rule statment.
Thanks
Prasad Raju Sagi
Mobile: 847-644-4103
________________________________
From: Aziz Boxwala <boxwala(a)yahoo.com>
To: rules-users(a)lists.jboss.org
Sent: Thursday, June 11, 2009 1:58:28 PM
Subject: [rules-users] process order example not working fully
I am trying to execute a ruleflow and use rules to assign tasks within the ruleflow in Drools 5.0.1. I have a drl file included in my knowledge base that tries to assign a task to a user when a new human task is created. This is based on the example in org.drools.example.process.order. I can't get my code to work. I don't the rules in the example are working either (dslr for the task assignment or the drl for dynamic logging). After some attempts, I found that this condition
WorkItemNodeInstance()
does not evaluate to true ever.
Do I have to do anything special to make the WorkItemNodeInstance appear in working memory?
Thanks for any help.
--Aziz
15 years
Flow (human task) and web apps
by Rodrigo
Just a newbie question...
To use drools flow with human tasks in a Seam application for example, i
will need to start a mina server in another thread (and interact by a mina
client), like documentation suggest?
Anyone have a sample web app that use this approach, drools flow + human
task + webapps.
Thanks in advance.
Rodrigo Valério.
15 years, 1 month
Re: [rules-users] unable to determine value type class *** URGENT***
by Corneil du Plessis
Srithu wrote:
>
> I have a wired behavior..
>
> I have a set of rules and i have used drools-guvnor to packaging them...
> It is working in windows machines where i have jboss which is running on
> IBM java 5 and 6..
>
> When i connect the same from jboss Which is running on 64 bit IBM java 6
> on linux is not working...
> The same is working If i used 64 bit IBM java 5 on linux.....
>
>
> I getting following exception...
>
>
>
> Please help....
>
>>> [2009-02-11 12:30:29,697] [705980] [http-0.0.0.0-8080-12] [ERROR]
>>> [STDERR ] - org.drools.RuntimeDroolsException: unable to determine
>>> ValueType for Class [class java.lang.Object]
>
>>> [2009-02-11 12:30:29,698] [705981] [http-0.0.0.0-8080-12] [ERROR]
>>> [STDERR ] - at
>>> org.drools.base.ValueType.determineValueType(ValueType.java:193)
>
>>> [2009-02-11 12:30:29,698] [705981] [http-0.0.0.0-8080-12] [ERROR]
>>> [STDERR ] - at
>>> org.drools.base.ValueType.readResolve(ValueType.java:125)
>
>>> [2009-02-11 12:30:29,698] [705981] [http-0.0.0.0-8080-12] [ERROR]
>>> [STDERR ] - at
>>> sun.reflect.GeneratedMethodAccessor121.invoke(Unknown Source)
>
>>> [2009 -02-11 12:30:29,698] [705981] [http-0.0.0.0-8080-12]
>>> [ERROR] [STDERR ] - at
>>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
>
>>> [2009-02-11 12:30:29,698] [705981] [http-0.0.0.0-8080-12] [ERROR]
>>> [STDERR ] - at java.lang.reflect.Method.invoke(Method.java:599)
>
> [deleted stacktrace]
>
>
We are experiencing same issue on WebSphere 6.1 FP 23 on Linux and AIX.
Has anyone found a resolution?
Regards
Corneil
--
View this message in context: http://www.nabble.com/unable-to-determine-value-type-class--***-URGENT***...
Sent from the drools - user mailing list archive at Nabble.com.
15 years, 2 months
Conversion from Normal Decision Tables to Web-Based Tables and vice-versa
by Vikrant Yagnick
Hi All,
I am wondering if anyone has had a requirement where they would need to convert their normal decision tables into web-based decision tables(or vice-versa).
If someone has already done this, can they share either some code or pointers to how this can be done? (I guess it will involving parsing the Excel and creating the XML for the decision table).
Will this be a useful feature to have?
Cheers,
Vikrant
MASTEK LTD.
Mastek is in NASSCOM's 'India Top 20' Software Service Exporters List.
In the US, we're called MAJESCOMASTEK
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Opinions expressed in this e-mail are those of the individual and not that of Mastek Limited, unless specifically indicated to that effect. Mastek Limited does not accept any responsibility or liability for it. This e-mail and attachments (if any) transmitted with it are confidential and/or privileged and solely for the use of the intended person or entity to which it is addressed. Any review, re-transmission, dissemination or other use of or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. This e-mail and its attachments have been scanned for the presence of computer viruses. It is the responsibility of the recipient to run the virus check on e-mails and attachments before opening them. If you have received this e-mail in error, kindly delete this e-mail from desktop and server.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
15 years, 2 months
"extends" in rules
by Chandana Pingle
Hi,
I found an example on using "extends" to extend a rule from another rule.
Using extends would only include the WHEN side of the rule.
I want to use the variable defined in the parent rule in sub rule
,something like below example,how do i do that?
rule A
when
$a:String( )
eval($a=="abc")
then
do something
end
rule B extends A
when
$b:String( )
$c:SomeClass()
then
$c.someMethod($a,$b) //i am not able to use $a here
end
Any suggestions?
Thanks
Chandana
15 years, 3 months
loading rules dynamically
by techy
Hi,
If the rules,conditions,consequences have to loaded from the database. I
can think of following two approach. what would be right approach( I will
have upto 1200 rules in the db)
1. Programmatically inject the rules into rule engine using drools API.
2. Read the rules from the database and create drl or dsl file for them and
inject into rule engine.
Thanks
--
View this message in context: http://www.nabble.com/loading-rules-dynamically-tp20274919p20274919.html
Sent from the drools - user mailing list archive at Nabble.com.
15 years, 3 months
Drools and Eclipse 3.5
by J Michael Dean
Sorry because I am sure this has been answered, but cannot find.
Compelling reasons to switch to Eclipse 3.5 because of recent changes
to Mac OSX but documentation pretty clearly indicates 3.4 for Drools
5.0. Is Drools 5.0 compatible with Eclipse 3.5?
- Mike
15 years, 3 months
Problem with JPA session persistence in Drools Flow (5.0.1)
by Alan.Gairey@tessella.com
I'm currently using Drools Flow with JPA session persistence enabled as
described in section 5.1 of the User Guide.
As a process executes, session information is saved to the H2 database
correctly.
The problem comes if a process only executes part way through, and I then
try to finish the process by recreating a session using the code:
// recreate the session from database using the sessionId
ksession = JPAKnowledgeService.loadStatefulKnowledgeSession( sessionId,
kbase, null, env );
This gives me a NullPointerException.
Having looked into the Drools Flow source code, I think the problem is in
the class
drools-persistence-jpa\src\main\java\org\drools\persistence\session\SingleSessionCommandService.java.
The 4th constructor of this class is called as part of the loading of a
knowledge session from the H2 database; this in turn leads to the
afterCompletion method of the inner class SynchronizationImpl being
called. The final two lines of this method are:
((JPAProcessInstanceManager) ((ReteooWorkingMemory)
session).getProcessInstanceManager()).clearProcessInstances();
((JPAWorkItemManager) ((ReteooWorkingMemory)
session).getWorkItemManager()).clearWorkItems();
However, when called via the route described above, the session member
variable of SingleSessionCommandService has not been set, thus causing the
NullPointerException.
(Interestingly, running the unit tests for drools-persistence-jpa does
result in the NullPointerException being thrown multiple times, although
the tests are still listed as having passed.)
I believe enclosing the above two lines as follows will fix the problem:
if (session != null) {
((JPAProcessInstanceManager) ((ReteooWorkingMemory)
session).getProcessInstanceManager()).clearProcessInstances();
((JPAWorkItemManager) ((ReteooWorkingMemory)
session).getWorkItemManager()).clearWorkItems();
}
Also, in the 4th constructor of SingleSessionCommandService, after the
session has been set, the following line needs to be added to ensure the
session id is the same as the session info id:
((ReteooStatefulSession) this.session).setId( this.sessionInfo.getId() );
(This line is present at the end of the 3rd constructor.)
It would be great if this fix could make it into the Drools 5.1 release.
Thanks.
15 years, 3 months
Using Drools for modeling with rule-driven agents
by Russ Abbott
Hi,
I'm interested in developing (if it doesn't already exist) and then using a
framework for agent-based modeling in which the agents are rule driven. An
important feature is that the agents and their rules must be dyanically
manipulable. That is, both the agents and the rules must be first class
objects that can be manipulated as the system is running. Can Drools support
that?
As someone not familiar with Drools I did my best to find out by looking at
the Drools Expert User's
Manual<http://hudson.jboss.org/hudson/job/drools/lastSuccessfulBuild/artifact/tr...>.
>From what I could tell, the Template
feature<http://hudson.jboss.org/hudson/job/drools/lastSuccessfulBuild/artifact/tr...>in
which one uses Java objects as Template data sources comes close. I'd
like your advice before putting too much development effort into attempting
to use it for that purpose.
In particular, would it be possible to set up a mechanism that could: create
and delete agents on the fly; associate rule sets with agents on the fly;
and modify the rules associated with an agent on the fly? After each such
action the system would change to reflect the change in agents and rules.
Thanks for your help.
-- Russ Abbott
P.S. If Drools would not be a good choice, is there some other system that
you could recommend?
15 years, 3 months
Maven Plugin to build pkg files
by Bernd Rücker
Hi all.
I wonder if there exists a maven plugin to build pkg files out of the rule
base during the maven packaging. Because we dont use the Guvnor
repository in this project and I want to package the pkg files with the
overall ear.
I searched a bit, but didnt found anything
Okay, not hard to write
ourself, but would be nicer to reuse existing stuff
Thanks
Bernd
15 years, 3 months