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
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
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
OSGI, classloading, and imports in KnowledgeBuilder
by msully
So I'm playing with Drools in Equinox OSGi, and so far it's behaving quite
nicely - one bit of weirdness though.
What I'm trying to do:
I have a bundle with a 'flow manager' that listens for instances of
WorkItemHandler in the service broker (well, really my own subinterface that
has a getName method). It also listens for new bundles with a
META-INF/drools directory with *.rf files in them, and parses the .rf files
it finds there.
The Flow Manager is itself published as an OSGI Service with a 'perform'
method. It encapsulates all of its Drools calls within the perform method
though - they aren't exposed to clients.
My test involves a simple start->work item->end workflow.
I pass in an instance of a class "Tablex" that can be saved to hibernate. I
also pass in a String that has the table name, and an empty List to get the
results.
My .rf file tries to import Tablex. It declares the three values I mention
above, and maps them to the work item in the work item definition.
<p>
<imports>
<import name="my.pkg.Tablex" />
</imports>
...
<variable name="my.pkg.newrecord" >
<type
name="org.drools.process.core.datatype.impl.type.ObjectDataType"
className="my.pkg.Tablex"/>
</variable>
...
<workItem id="2" name="DBWorkItem" x="165" y="374" width="80"
height="40" >
<work name="DBWorkItem" >
</work>
<mapping type="in" from="my.pkg.tablename" to="my.pkg.tablename" />
<mapping type="in" from="my.pkg.newrecord" to="my.pkg.newrecord"/>
<mapping type="in" from="my.pkg.outlist" to="my.pkg.outlist"/>
</workItem>
</p>
In my manifest for my .rf file and for the flow manager (where the parsing
occurs) I Import-Package Tablex's package.
When my flow manager tries parsing the rule, it gives an error saying the
the import failed. BUT, everything still works, and my WorkItemHandler works
correctly (the WorkItemHandler imports Tablex itself, since it needs to
manipulate it).
If I declare my Tablex variable as a java.util.Object in the ruleflow then I
don't get the error and things also still work.
If I declare my Tablex as Tablex in the rule flow AND import it in the class
that does the parsing (it's already 'OSGI' imported to the parsing bundle,
but now I'm doing a plain old Java import on it) then everything works fine
with no error message.
Kind of a hybrid question but I figured I'd start with the Drools folks.
Any ideas would be appreciated.
Thanks,
Mike
--
View this message in context: http://www.nabble.com/OSGI%2C-classloading%2C-and-imports-in-KnowledgeBui...
Sent from the drools - user mailing list archive at Nabble.com.
15 years, 3 months
Drools and Clojure (maps as facts)
by André Thieme
Hello group!
I am a Clojure user and would like to look into using Drools with it.
From Clojure I can use all Java classes and call all methods. So,
instantiating a KnowledgeBase, KnowledgePackages or a KBFactory is no
problem, and calling the respective methods, to get the system started,
or insert facts into a session, dispose it and fireAllRules is also
fine.
It is just that in Clojure one typically does not use POJOs.
The most typical data structures used are: hashmaps, vectors, structs,
lists, structuremaps and sets (in no particular order).
Those are persistent and "concurrency ready" Clojure DSs, and btw, also
usable from Java directly.
Now the basic Drools examples I saw all work with POJOs.
They were mostly comparisons of native typed fields in a class.
I however would be interested to compare different qualities of key/
value pairs in a hashmap, or compare structs with each other.
Comparing structuremaps is maybe what comes closest to the POJO examples.
For example, we may have a struct (defstruct person :name :age :type)
and store it's instances in a vector. And we would also insert it into
our Drools session object:
(doseq [p all-persons] (.insert session p))
which would correspond roughly to
for (Person p : allPersons) { session.insert(p); }
Only that "person" is a map, not a class.
Well, of course it is also an object and under the hood a class, a
java.util.Map even - but I mean that unlike POJOs the key/value pairs
are stored differently (fields in classes are also just key/value pairs).
So, is there a way to insert maps (let it be java.util.HashMaps for
example) and also to reason about them? I won't care if the syntax
for that is complicated. As Clojure is a Lisp I would just write a
little macro and have a very nice and readable syntax (probably a bit
similar to the one of Jess or Lisa).
Instead of looking at all instances of the type Person AND then have
their age compared, I would look at all maps/structs which have a key
:type with the value :person AND then compare the value of their :age
key with a number, such as:
(rule "example person rule, matching non-adults"
:when (= :type :person)
(< :age 18)
:then
(println "No service for minors."))
In Java terms it would mean that we insert several instances of
java.util.HashMap, all having the k/v pairs for name, age and type.
HashMap<String, Object> hm = new HashMap<String, Object>();
hm.put("name", someName);
hm.put("age", someAge);
hm.put("type", "person");
session.insert(hm);
Is that in principle possible with Drools 5?
Sunny greetings,
André
--
Lisp is not dead. It’s just the URL that has changed:
http://clojure.org/
15 years, 4 months
questions on guvnor and drools 5.0
by Garner, Shawn
I was wondering if somebody can help me with some questions:
1) Is there any more detail on how to setup Guvnor with a database?
2) How do you use the test scenarios with complex object structures?
-eg Create a fact in working memory that has another Object in it which in turn has a list of Objects in it.
-Seems like any Fact in working memory is assumed to only have only primitive values like Strings or numbers.
-We would like a more depth of objects where objects have a deep relationship to other objects at least 2-4 levels deep.
3) Why add ruleflow-group to the rule definition instead of adding the rule to a ruleflow-group? If the ruleflow-group is part of the rule then you can't use the same rule in multiple ruleflow-groups and leads to copy and maintaining the rule in two different spots.
4) DSL seems to be very inconvenient to edit in a text box especially when it wraps. Why not a table where you can add rows and each row is a translation. Also there are no examples how to do translation into Drools syntax that is multiple lines long and not just a single line.
5) Is Java 5 Type Enumerations supported? I was assuming I'd get a list of values if a field was an Enumeration.
6) There seems to be a vast functionality difference between the Guvnor decision tables and examples that use spreadsheets.
7) Guvnor lost the ability to select variables for use in other statements. Functionality was in BRMS of drools 4.0.7
8) I was not able to insert a fact using a constructor that needed parameter values. Seems like it assumes everything is a bean but I couldn't find this requirement stated in the documentation anywhere. Examples in documentation show inserting facts with constructor parameters.
9) It would be nice when you upload a domain model jar that you could explore the objects and fields somehow.
10) When you write a rule using one particular editor it would be nice if you could switch to another editor. Switch between Guided, DSL, Technical, etc.
11) It seems hard to reorder the statements in a when or then block. If I put them in the wrong order I have to delete them all. Would be nice if a statement could be moved up or down.
12) When calling a method on an object the choices only showed me public methods that take in one parameter. I had a method with two parameters and it wouldn't show me the method. I had to do a DSL or custom drools statement to get around it.
13) Guvnor seems to limit the drools syntax. I couldn't do a "from $collection" statement without a custom drools statement line.
14) It would be nice if I could declare a global dialect "java" for all the rules.
15) It would be nice to define an existing agenda-group as part of a ruleflow-group without adding the ruleflow-group on the rules in that agenda-group.
Thanks,
SG
-----Message Disclaimer-----
This e-mail message is intended only for the use of the individual or
entity to which it is addressed, and may contain information that is
privileged, confidential and exempt from disclosure under applicable law.
If you are not the intended recipient, any dissemination, distribution or
copying of this communication is strictly prohibited. If you have
received this communication in error, please notify us immediately by
reply email to Connect(a)principal.com and delete or destroy all copies of
the original message and attachments thereto. Email sent to or from the
Principal Financial Group or any of its member companies may be retained
as required by law or regulation.
Nothing in this message is intended to constitute an Electronic signature
for purposes of the Uniform Electronic Transactions Act (UETA) or the
Electronic Signatures in Global and National Commerce Act ("E-Sign")
unless a specific statement to the contrary is included in this message.
While this communication may be used to promote or market a transaction
or an idea that is discussed in the publication, it is intended to provide
general information about the subject matter covered and is provided with
the understanding that The Principal is not rendering legal, accounting,
or tax advice. It is not a marketed opinion and may not be used to avoid
penalties under the Internal Revenue Code. You should consult with
appropriate counsel or other advisors on all matters pertaining to legal,
tax, or accounting obligations and requirements.
15 years, 4 months
Why is a flat object recommended?
by Christie, Blair
In the documents this is dicussed briefly:
"). Object models can often have complex relationships and hierarchies
in them - for rules you will want to simplify and flatten the model
where possible, and let the rule engine infer relationships (as it
provides future flexibility."
What does it mean that the rule engine can infer relationships?
Are there performance reasons for having a flat model?
Cheers,
Blair
15 years, 4 months
MySQL and Derby issues with Guvnor
by Sumant Kumar
Hi ,
I have changed the defualt Derby DB to MySQL DB for the JacRabbit in Guvnor. I see this below exception when I try to bring up the JBOSS AS and Guvnor.
Any idea what is the issue
2009-07-30 16:58:09,499 INFO [STDOUT] (main) ERROR 30-07 16:58:09,499 (BundleDbPersistenceManager.java:storeBundle:1270) failed to write bundle: cafebabe-cafe-babe-cafe-babecafebabe
ERROR 23505: The statement was aborted because it would have caused a duplicate key value in a unique or primary key constraint or unique index identified by 'SQL090729054055150' defined on 'DEFAULT_BUNDLE'.
Is there a way to get rid of JacRabbit and use more robust Implemenentation of JCR.
15 years, 5 months