I am using drools 5.2.0.M2 and I still get this error:Caused by: java.lang.NullPointerExceptionat org.drools.marshalling.impl.InputMarshaller.readLeftTuple(InputMarshaller.java:469)Which was reported on drools 5.1.0 JIRA and claimed to be fixed. I see the error when trying to load a session that was persisted that had objects inserted that are time depended and cause rules to fire that use terms from flow such as "after". I only see this error if create a new session, submit some facts to it, close it, and then try to reload. If i do not submit any facts to it I do not get the error. I.E. If all i do is create the KB with my rules I can reload a session from the DB no problem, but if i submit some facts and persist the session, then i cannot reload it. This seems to be an issue with the JPA loading of the session that has facts in it that use Flow (JBPM). Any help would be greatly appreciated. Below are my simple rules followed by the test code used to submit the facts:package com.inventrio.rules.readings
import com.inventrio.healthmonitoring.model.*;declare Reading@role(event)@timestamp(readingTime)endrule "High Blood Pressure"when$systolic : Value( this.valueType.name == "SYSTOLIC" ) from $eventA.values$diastolic : Value( this.valueType.name == "DIASTOLIC" ) from $eventA.valueseval( $systolic.getLongValue() > 180 && $diastolic.getLongValue() > 120 )thenSystem.out.println("HIGH BLOOD PRESSURE" );endrule "Weight Trending Up"when$weight3 : Value( this.valueType.name == "WEIGHT" ) from $eventC.values$weight2 : Value( this.valueType.name == "WEIGHT" ) from $eventB.values$weight1 : Value( this.valueType.name == "WEIGHT" ) from $eventA.valueseval( $weight3.getDoubleValue().doubleValue() < $weight2.getDoubleValue().doubleValue() + 1.0 && $weight2.getDoubleValue().doubleValue() < $weight1.getDoubleValue().doubleValue() + 1.0 )thenSystem.out.println("WEIGHT IS GOING UP" );endrule "Weight Trending Down"when$weight3 : Value( this.valueType.name == "WEIGHT" ) from $eventC.values$weight2 : Value( this.valueType.name == "WEIGHT" ) from $eventB.values$weight1 : Value( this.valueType.name == "WEIGHT" ) from $eventA.valueseval( $weight3.getDoubleValue().doubleValue() > $weight2.getDoubleValue().doubleValue() + 1.0 && $weight2.getDoubleValue().doubleValue() > $weight1.getDoubleValue().doubleValue() + 1.0 )thenSystem.out.println("WEIGHT IS GOING DOWN" );endAnd next is my object i insert before closeing and then trying to reload the session.public void testWeightRules() {try {Reading reading = new Reading();reading.setReadingTime(new Date(System.currentTimeMillis()));ReadingType type = new ReadingType();type.setName("WEIGHT");type.setDescription("");reading.setReadingType(type);Value value = new Value();value.setDoubleValue(140.0);ValueType valueType = new ValueType();valueType.setName("WEIGHT");valueType.setDataType(ValueDataType.DOUBLE);value.setValueType(valueType);reading.getValues().add(value);reading.setReadingType(type);engine.process(reading);Thread.sleep(7000);reading = new Reading();reading.setReadingTime(new Date(System.currentTimeMillis()));type = new ReadingType();type.setName("WEIGHT");type.setDescription("");reading.setReadingType(type);value = new Value();value.setDoubleValue(142.0);valueType = new ValueType();valueType.setName("WEIGHT");valueType.setDataType(ValueDataType.DOUBLE);value.setValueType(valueType);reading.getValues().add(value);reading.setReadingType(type);engine.process(reading);Thread.sleep(7000);reading = new Reading();reading.setReadingTime(new Date(System.currentTimeMillis()));type = new ReadingType();type.setName("WEIGHT");type.setDescription("");reading.setReadingType(type);value = new Value();value.setDoubleValue(144.0);valueType = new ValueType();valueType.setName("WEIGHT");valueType.setDataType(ValueDataType.DOUBLE);value.setValueType(valueType);reading.getValues().add(value);reading.setReadingType(type);engine.process(reading);} catch (Throwable t) {t.printStackTrace();}}Shannon HastingsInventrio
545 Metro Place South, Suite 475
Dublin, OH 43017
Phone: (614) 389-2795 x101
Fax: (614) 522-6249
Email: shannon.hastings@inventrio.com
http://www.inventrio.com
_______________________________________________
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users