WorkingMemory problem when reading using ObjectInputStream (Drools 4.0.7)
by Przemysław Różycki
Hi,
I experienced the problem while reading WorkingMemory using
ObjectInputStream. I'm attaching the code that cause the following
exception:
java.lang.ClassCastException: java.io.ObjectInputStream
at org.drools.reteoo.Rete$ClassObjectTypeConf.readObject(Rete.java:605)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:946)
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1809)
at
java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1719)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1305)
at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1908)
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1832)
at
java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1719)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1305)
at java.io.ObjectInputStream.readArray(ObjectInputStream.java:1634)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1299)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:348)
at
org.drools.util.AbstractHashTable.readExternal(AbstractHashTable.java:66)
at org.drools.util.ObjectHashMap.readExternal(ObjectHashMap.java:41)
at java.io.ObjectInputStream.readExternalData(ObjectInputStream.java:1755)
at
java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1717)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1305)
at java.io.ObjectInputStream.readArray(ObjectInputStream.java:1634)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1299)
at java.io.ObjectInputStream.readArray(ObjectInputStream.java:1634)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1299)
at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1908)
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1832)
at
java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1719)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1305)
at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1908)
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1832)
at
java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1719)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1305)
at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1908)
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1832)
at
java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1719)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1305)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:348)
at com.sample.DroolsTest5.main(DroolsTest5.java:52)
What's wrong?
Best regards!
--
Przemysław Różycki
IT Architect
AMG.net, A Bull Group Company
ul. Łąkowa 29
90-554 Łódź
www.amg.net.pl
15 years, 12 months
Drools 5 Accumulate Function
by Steven Williams
Hi all,
I am converting over to Drools 5 and have run into a problem with
AccumulateFunction. I changed my classes to implement
org.drools.runtime.rule.AccumulateFunction however this causes the
ClassCastException below:
Caused by: java.lang.ClassCastException:
au.com.promedicus.rules.MaxPriceAccumulateFunction cannot be cast to
org.drools.base.accumulators.AccumulateFunction
at
org.drools.compiler.PackageBuilderConfiguration.getAccumulateFunction(PackageBuilderConfiguration.java:489)
at
org.drools.rule.builder.dialect.java.JavaAccumulateBuilder.build(JavaAccumulateBuilder.java:108)
...
My guess is this is a bug. For now I will just go back to implementing
org.drools.base.accumulators.AccumulateFunction.
cheers
Steve
--
Steven Williams
Supervising Consultant
Object Consulting
Office: 8615 4500 Mob: 0439 898 668 Fax: 8615 4501
steven.williams(a)objectconsulting.com.au
www.objectconsulting.com.au
consulting | development | training | support
our experience makes the difference
15 years, 12 months
Executing Rules using BRMS Snapshot
by Ashish Soni
Hi ,
I have created a rules package using BRMS and then trying to execute rules
using below code can some one please let me know how i can see the modified
object back.
>
> The Rules is very simple as if the name of the customer is "Ashish' then
> set the phone to some value as given in the rule .
>
>
> public static void main(String[] args) {
>
> Properties properties = new Properties();
> try {
> properties.load(new
> FileInputStream("C:\\Dev\\MyTest\\src\\com\\mytest\\MyRules.properties"));
> } catch (IOException e) {
> }
>
> RuleAgent ruleAgent = RuleAgent.newRuleAgent(properties);
> RuleBase rb = ruleAgent.getRuleBase();
> StatefulSession session = rb.newStatefulSession();
> session.addEventListener( new DebugAgendaEventListener() );
> session.addEventListener( new DebugWorkingMemoryEventListener() );
> WorkingMemoryFileLogger logger = new WorkingMemoryFileLogger(
> session );
> Customer customer = new Customer();
> customer.setName("Ashish");
> logger.setFileName(
> "C:\\Dev\\MyTest\\src\\com\\mytest\\helloworld.txt" );
> session.insert(customer);
> session.fireAllRules();
>
> logger.writeToDisk();
> session.dispose();
>
>
> Properties File
>
> newInstance=true
> url=
> http://localhost:8080/drools-jbrms/org.drools.brms.JBRMS/package/AshwinPK...
> poll=30
> name=MyConfig
>
>
> Regards,
> Ashish soni
>
>
15 years, 12 months
Re: [rules-users] Decision Tree input?
by Lasse.Wallentin@APCC.com
Mark Proctor wrote:
> Wilson O Ojwang wrote:
>> All,
>>
>> Is there something in the works to support Decision Tree Inputs in
>> addition to Decision Table?
> Someone in the community is working on this in eclipse, but they start
> and stop work on it, nothing is commited yet so no idea if they will
> deliver or when.
Where could one find more information on the work being done on the
Decision trees?
I would like to know more about the project, its status and the
possibillity to help out!?
any pointers would be appreciated.
/W
15 years, 12 months
Are you using Drools 5 ?
by Cristiano Gavião
Hi people, I was introduced to Drools 5 some weeks ago. And I have
started to lear since. I got really excited and surprised with its
amazing features and power.
I really want to learn some tricks on it as soon as possible and be
able to use it on one of my next projects....
I didn't test 5.0M4 version too much, just some basic rules firing....
I would like to hear from you guys that are using drools 5 about your
experiences...
Its safe to start a project (development starts on 4 weeks) with
drools 5 on this actual stage? Anyone could tell me if the GA version
will have too much structurally differences from this M4? (change
public classes and methods or anything else that could generate
reworks !!)
Thanks for your time....
best regards
Cristiano
15 years, 12 months
Adding Rules and Packages to existing rule base (4.0.7)
by cfili
What is the proper way to add rules to existing packages that are already
part of a rule base?
When adding rules to the package directly, those rules are listed in the
rule base however they do not seem to be "active" and will never trigger. I
get the same results if I add rules to a package that was created by the
PackageBuilder but not part of an existing rule base. Allowing Drools to
"merge" the packages also seems to yield a similar result where the first
set of rules are active, but what was added later or merged will not be
active.
I know that this type of activity is supported I just want to make sure I do
it the right way.
Thanks.
--
View this message in context: http://www.nabble.com/Adding-Rules-and-Packages-to-existing-rule-base-%28...
Sent from the drools - user mailing list archive at Nabble.com.
16 years
Auditing Feature
by Ashish Soni
Hi Mark,
I am evaluating Jboss Rules for our upcoming project and wanted to know if
there is any Auditing feature available from Drools / Jboss Rules , below
are more details -
If i have executed number of rules for a given use case , will Jboss rules
/ Drools maintain a Audit History of what all given rules are applied or
will there be any feature for configuring this.
Please let me know .
Ashish Soni
16 years