Need help with syntax for arrays in rules
by DavidIsaac
Hello-
We are writing rules against complex objects (derived from XML) that contain
nested arrays, notionally like this:
Record {
Detail[] recordDetails;
}
Detail {
Activity[] yearlyActivity;
}
Activity {
int year;
}
Is it really true that I must use a "from" clause to navigate the hierarchy,
assuming that my main program only inserts Record into working memory?
Right now, I have:
rule "Long way using From"
when
$r: Record()
$d: Detail () from $r.recordDetails
$a: Activity (year == 1990) from $d.yearlyActivity
then
...
because I get errors if I try directly navigating the objects:
rule "Short way using Dots"
when
Record (recordDetails.yearlyActivity.year = 1990)
then
...
Is it really true I can't navigate through arrays using dot notation, and I
must use the from clause? This bit of awkwardness makes my rules
significantly harder to read. I was hoping for something like XPath where I
can navigate right through repeating elements.
Apologies in advance for the naieve comparison, and thank for any hints.
--
View this message in context: http://old.nabble.com/Need-help-with-syntax-for-arrays-in-rules-tp2627384...
Sent from the drools - user mailing list archive at Nabble.com.
16 years, 4 months
rule help
by SzA84
Hi I am working on a simple drools project.
I have now one rule, but it not works.
This is the drl:
package orvosi;
import orvosi.orvosimeres.Adattipus;
import orvosi.orvosimeres.Mertadat;
rule "Your First Rule"
when
Adattipus(ertek="heart_rate");
Mertadat(ertek>180, mertekegyseg=="/min",
mozgas==true);
then
System.out.println ("riasztas");
end
And this is the orvosi.java in the package but I think it's not good so.
Suggest me any ideas how I can make it work.
Thx!
package orvosi;
import java.io.InputStreamReader;
import java.io.Reader;
import org.drools.RuleBase;
import org.drools.RuleBaseFactory;
import org.drools.WorkingMemory;
import org.drools.compiler.PackageBuilder;
import org.drools.rule.Package;
public class orvosimeres {
public static final void main(String[] args) {
try {
RuleBase ruleBase = readRule();
WorkingMemory workingMemory = ruleBase.newStatefulSession();
Adattipus ertek = new Adattipus();
Mertadat mertekegyseg = new Mertadat ();
Mertadat mozgas = new Mertadat ();
workingMemory.insert( ertek );
workingMemory.insert( mertekegyseg );
workingMemory.insert( mozgas );
workingMemory.fireAllRules();
} catch (Throwable t) {
t.printStackTrace();
}
}
private static RuleBase readRule() throws Exception {
Reader source = new InputStreamReader(
orvosimeres.class.getResourceAsStream( "/vernyomas.drl" ) );
PackageBuilder builder = new PackageBuilder();
builder.addPackageFromDrl( source );
Package pkg = builder.getPackage();
RuleBase ruleBase = RuleBaseFactory.newRuleBase();
ruleBase.addPackage( pkg );
return ruleBase;
}
public static class Adattipus{
public int ertek;
}
public static class Mertadat{
public int mertekegyseg;
boolean mozgas=false;
}
}
--
View this message in context: http://old.nabble.com/rule-help-tp26245649p26245649.html
Sent from the drools - user mailing list archive at Nabble.com.
16 years, 4 months
Drools flow web console (5.1.M1) deployment in JBoss
by satjo
Could some one share the experience in getting the Drools Flow 5.1 web
console working in JBoss?
I downloaded the “Standalone Guvnor with JBoss AS” (Drools 5.1.0.M1 Guvnor
Standalone) from the download site.
As it did not have the gwt-console war files
(gwt-console-server-drools-{version}.war and
gwt-console-drools-{version}.war) in the Standalone download, I built them
from source code and deployed in JBoss.
I uploaded a test rule flow in Guvnor’s default package and rebuilt the
package.
After log into gwt-console, when I click on process definition, I see a
HTTP 500 error ‘class com.google.gwt.http.client.RequestException', ‘ Could
not initialize stateful knowledge session: null’.
Any comments on the required steps for viewing the process definitions are
appreciated.
satjo
--
View this message in context: http://www.nabble.com/Drools-flow-web-console-%285.1.M1%29-deployment-in-...
Sent from the drools - user mailing list archive at Nabble.com.
16 years, 4 months
ConcurrentModificationException during runtime at org.drools.reteoo.ClassObjectTypeConf.getMatchingObjectTypes
by karthizap
I am using Drools-core.jar(version-5.0.0.CR1) and getting the following
exception. I could see similar stacktrace reported with
JIRA-1888(https://jira.jboss.org/jira/browse/JBRULES-1888) and its marked as
closed. Fix related to this Jira is not available (Rete.java) in the Drools
5.0.1 and 5.1.0 source code/drools-core jar files.
public void readExternal(ObjectInput in) throws IOException,
ClassNotFoundException {
entryPoints = Collections.synchronizedMap((Map<EntryPoint,
EntryPointNode>) in.readObject());
ruleBase = ((DroolsObjectInputStream)in).getRuleBase();
super.readExternal( in );
}
java.util.ConcurrentModificationException
at java.util.HashMap$HashIterator.nextEntry(HashMap.java:841)
at java.util.HashMap$ValueIterator.next(HashMap.java:871)
at
org.drools.reteoo.ClassObjectTypeConf.getMatchingObjectTypes(ClassObjectTypeConf.java:171)
at
org.drools.reteoo.ClassObjectTypeConf.getObjectTypeNodes(ClassObjectTypeConf.java:163)
at org.drools.reteoo.EntryPointNode.assertObject(EntryPointNode.java:143)
at
org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:1066)
at
org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:1022)
at
org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:810)
Please let me know the correct fix for this problem.
--
View this message in context: http://old.nabble.com/ConcurrentModificationException-during-runtime-at-o...
Sent from the drools - user mailing list archive at Nabble.com.
16 years, 4 months
MVEL and Maps
by Leonardo Gomes
Hello,
I'm feeding my working memory with Maps (unfortunately, this is a
requirement and I can't use beans).
To access the values in this maps I use the following MVEL expression :
Map ( this["airportCode"] == "GIG"
, this["numberOfPassengers"] > "1"
, this["class"] memberOf ("BUSINESS", "FIRST") )
And it works fine, except for dates where I get a ClassCastException,
even tough I'm using the right pattern:
Map ( this["departureDate"] > "07-Nov-2009" ) --- fails
Is there anything I need to do to make the dynamic cast of dates work,
in this particular case?
--
Morever, I get NPEs if there's no value for a given key. For example,
the expression Map ( this ["name"] == 'Leonardo' ) would fail if
there's no entry with "name" as the key.
Any help is welcome!
Thanks in advance,
Leo.
16 years, 4 months
Inconsistent behavior between LHS and RHS ...
by Javier Vera Gomez
Hi,
I've been using drools 4.07 for a while. I have found a weird case. It
seems that when evaluating the LHS some fact is true but the RHS probes
it wasn't actually true.
The example code is at the end. It is very weird to me I have no clue
about how to solve this or what could be happening!
rule "A-Rule"
no-loop true
ruleflow-group "validate-task"
salience -9999999
when
>$task : Task( type == "Creacio_Profile_Radius" )
>eval($task.getParameter("PRIMARYDNS")==null)
then
>System.out.println(">>>DBGPar0:
"+$task.getTechnicalParams().get(0).getName());
>System.out.println(">>>DBGPar1:
"+$task.getTechnicalParams().get(1).getName());
>System.out.println("Getparam PRIMARYDNS:
"+$task.getParameter("PRIMARYDNS"));
end
further explanation:
The Task class has a List<Parameter> technicalParams, originally the
eval part was:
not(Parameter (name=="PRIMARYDNS") from $task.technicalParams())
it didn't work and I coded this "getParameter" method just to make some
tests. So, it seems the collection appears "empty" to the LHS but in
fact it isnt!
any clue?
thanks a lot,
Javier
16 years, 4 months
Re: [rules-users] [droolsflow] Code-based constraints for EventWait nodes - is this possible?
by Alan.Gairey@tessella.com
Kris,
Thanks yes - the null check fixes the NPE I was seeing.
Unfortunately, I now have a more difficult problem. In my work item
handler, I use the following code to get the ID of a work item in the rule
flow (i.e. the .rf file itself) given a
org.drools.runtime.process.WorkItem instance:
private long getCurrentNodeId(WorkItem workItem) {
ProcessInstance processInstance =
ksession.getProcessInstance(workItem.getProcessInstanceId());
if (processInstance instanceof WorkflowProcessInstanceImpl) {
Collection<NodeInstance> nodeInstances =
((WorkflowProcessInstanceImpl) processInstance).getNodeInstances();
for (NodeInstance nodeInstance : nodeInstances) {
System.out.println(String.format("Node instance: %s",
nodeInstance));
if (nodeInstance instanceof WorkItemNodeInstance) {
WorkItemNodeInstance workItemNodeInstance =
(WorkItemNodeInstance) nodeInstance;
if (workItemNodeInstance.getWorkItem() == workItem) {
return workItemNodeInstance.getNodeId();
}
}
}
}
throw new RuntimeException(String.format("Error determining node
ID for work item: %s", workItem.toString()));
}
The work item in the attached test case, the first time it executes sets a
property on a fact in memory that causes a subsequent Split node to send
the flow to an Event Wait. The code in the overall main() method (in
PersistenceTest.java) then updates the fact in memory so that the Event
Wait's constraint is satisfied, and the work item node is executed again.
The second time around, it sets the property on the fact in memory so that
the subsequent Split node sends the flow to its end. (I hope this makes
sense; looking at the rule flow in the test case should show you what I'm
trying to do.)
If I execute the test case with my session created using the code:
StatefulKnowledgeSession ksession = kbase.newStatefulKnowledgeSession();
everything works as I would expect, and the output from the
System.out.println() statement in my getCurrentNodeId() method above is:
Node instance:
org.drools.workflow.instance.node.WorkItemNodeInstance@125d568
Node instance:
org.drools.workflow.instance.node.WorkItemNodeInstance@37a04c
However, if I use JPA persistence:
StatefulKnowledgeSession ksession =
JPAKnowledgeService.newStatefulKnowledgeSession(kbase, null, env);
then the RuntimeException in getCurrentNodeId() is thrown, and the output
is:
Node instance:
org.drools.workflow.instance.node.WorkItemNodeInstance@2209db
Node instance:
org.drools.workflow.instance.node.MilestoneNodeInstance@d8fd1a
Somehow it seems as though the node instance isn't quite synchronised with
the overall state when using JPA persistence.
Any help you could give me here would be very much appreciated.
Regards,
Alan
Kris Verlaenen <kris.verlaenen(a)cs.kuleuven.be>
30/10/2009 20:10
To
Alan.Gairey(a)tessella.com
cc
Subject
Re: [rules-users] [droolsflow] Code-based constraints for EventWait nodes
- is this possible?
Alan,
Thanks, this indeed seems to be the issue. I have changed this on
trunk. Does adding this null check solve your issue?
Thx,
Kris
Quoting Alan.Gairey(a)tessella.com:
> Kris,
>
> Some more information: the NullPointerException from GetObjectCommand
> is
> thrown by the line:
>
>
>
((StatefulKnowledgeSessionImpl)ksession).session.getExecutionResult().getResults().put(
>
> this.outIdentifier,
> object );
>
> Method getExecutionResult() is returning null. Debugging my test
> case, I
> also notice that this.outIdentifier is also null.
>
> I then had a look at the GetObjectsCommand class; in its execute
> method,
> there is a line similar to that above. However, it is contained
> within an
> if block that checks this.outIdentifier is not null:
>
> if ( this.outIdentifier != null ) {
> List objects = new ArrayList( col );
>
>
>
((StatefulKnowledgeSessionImpl)ksession).session.getExecutionResult().getResults().put(
>
> this.outIdentifier, objects );
> }
>
> If something similar was done in GetObjectCommand, presumably this
> would
> fix my problem?
>
> Hope this is of some use - regards,
>
> Alan
>
>
>
>
> Alan.Gairey(a)tessella.com
> Sent by: rules-users-bounces(a)lists.jboss.org
> 29/10/2009 17:35
> Please respond to
> Rules Users List <rules-users(a)lists.jboss.org>
>
>
> To
> Kris Verlaenen <kris.verlaenen(a)cs.kuleuven.be>
> cc
> Rules Users List <rules-users(a)lists.jboss.org>
> Subject
> Re: [rules-users] [droolsflow] Code-based constraints for EventWait
> nodes
> - is this possible?
>
>
>
>
>
>
>
> Kris,
>
> Thanks - making the class SimpleFact serializable fixed that error.
>
> However, I now have a new problem: I have a rule flow containing a
> work
> item - the handler attempts to update the SimpleFact instance in
> memory
> before completing the task. The code in the executeWorkItem method is
> as
> follows:
>
> Collection<FactHandle> factHandles =
> ksession.getFactHandles(new
> ObjectFilter() {
> public boolean accept(Object object) {
> return (object instanceof SimpleFact);
> }
> });
> for (Iterator<FactHandle> iterator = factHandles.iterator();
>
> iterator.hasNext(); ) {
> FactHandle factHandle = iterator.next();
> SimpleFact fact = (SimpleFact)
> ksession.getObject(factHandle);
>
> fact.setStatus("Error");
> ksession.update(factHandle, fact);
> }
>
> workItemManager.completeWorkItem(workItem.getId(), null);
>
> The call to getObject() causes the following exception to be thrown:
>
>
> java.lang.NullPointerException
> at
>
org.drools.command.runtime.rule.GetObjectCommand.execute(GetObjectCommand.java:35)
>
>
> at
>
org.drools.persistence.session.SingleSessionCommandService.execute(SingleSessionCommandService.java:254)
>
>
> at
>
org.drools.command.impl.CommandBasedStatefulKnowledgeSession.getObject(CommandBasedStatefulKnowledgeSession.java:369)
>
>
> at
>
com.test.StatusChangeWorkItemHandler.executeWorkItem(StatusChangeWorkItemHandler.java:37)
>
>
> ...
>
> I've attached another test case to illustrate the problem.
>
>
>
> Once again, my sincere thanks for helping me with this.
>
> Regards,
>
> Alan
>
>
>
> Kris Verlaenen <kris.verlaenen(a)cs.kuleuven.be>
> 29/10/2009 12:00
>
>
> To
> Alan.Gairey(a)tessella.com
> cc
> Rules Users List <rules-users(a)lists.jboss.org>
> Subject
> Re: [rules-users] [droolsflow] Code-based constraints for EventWait
> nodes
> - is this possible?
>
>
>
>
>
>
>
>
> Alan,
>
> The cause of the rollback of the transaction is this:
> Caused by: java.io.NotSerializableException: com.test.SimpleFact
>
> The reason is that, if you use persistence for your session, the
> persister will try to save all runtime state of the engine. This
> does
> not only include process instances, but also rule-related state. By
> default, this also includes the data inserted in the memory. We
> support
> two strategies for storing this data: serialization of the data
> (default) or JPA-based storage of entities (by reference). In this
> case, the persister is trying to serialize the test object you
> inserted
> and fails. Making it serializable should fix this.
>
> Kris
>
> Quoting Alan.Gairey(a)tessella.com:
>
> > Kris,
> >
> > I've attached a simple test case (transaction manager, data
> source,
> > etc.
> > are configured via Spring). The error is thrown on line:
> >
> > ksession.insert(new SimpleFact());
> >
> > If this line is commented out, the rule flow executes without
> error.
> >
> >
> >
> > Many thanks for looking at this.
> >
> > Regards,
> >
> > Alan
> >
> >
> >
> >
> > Kris Verlaenen <kris.verlaenen(a)cs.kuleuven.be>
> > 28/10/2009 10:40
> >
> > To
> > Alan.Gairey(a)tessella.com
> > cc
> > Rules Users List <rules-users(a)lists.jboss.org>
> > Subject
> > Re: [rules-users] [droolsflow] Code-based constraints for
> EventWait
> > nodes
> > - is this possible?
> >
> >
> >
> >
> >
> >
> > Alan,
> >
> > Could you send me the entire output / stack trace (as the rollback
> > of
> > the transaction is usually caused by another exception)?
> >
> > Or a simple test case that shows the error, so I can take a look?
> >
> > Thx,
> > Kris
> >
> > Quoting Alan.Gairey(a)tessella.com:
> >
> > > Kris,
> > >
> > > After posting my last question, I quickly came to the same
> > conclusion
> > > as
> > > you, so I'm now using a rule-based constraint in my EventWait
> > node.
> > >
> > > This however has presented a different problem. If I create my
> > > session
> > > from JPAKnowledgeService, then when I try to insert my fact into
> > the
> > >
> > > session, I get the following error:
> > >
> > > bitronix.tm.internal.BitronixRollbackException: transaction was
> > > marked as
> > > rollback only and has been rolled back
> > > at
> > >
> >
> bitronix.tm.BitronixTransaction.commit(BitronixTransaction.java:153)
> > > at
> > >
> >
>
bitronix.tm.BitronixTransactionManager.commit(BitronixTransactionManager.java:96)
> > > at
> > >
> >
>
org.drools.persistence.session.SingleSessionCommandService.execute(SingleSessionCommandService.java:258)
> > > at
> > >
> >
>
org.drools.command.impl.CommandBasedStatefulKnowledgeSession.insert(CommandBasedStatefulKnowledgeSession.java:305)
> > > (Everything works fine if I create my session from the knowledge
> > base
> > > -
> > > i.e. with no state persistence.)
> > > Prior to using a rule-based constraint (with no call to
> > > CommandBasedStatefulKnowledgeSession.insert), the session
> created
> > > from
> > > JPAKnowledgeService worked OK.
> > > I'm using the default JPA configuration from the Drools
> > documentation
> > >
> > > (persisting to H2 database, etc.).
> > > Any ideas what might be causing the problem?
> > > Many thanks,
> > > Alan
> > >
> > >
> > >
> > >
> > > Kris Verlaenen <kris.verlaenen(a)cs.kuleuven.be>
> > > 23/10/2009 03:00
> > >
> > > To
> > > Rules Users List <rules-users(a)lists.jboss.org>,
> > > Alan.Gairey(a)tessella.com
> > > cc
> > > Rules Users List <rules-users(a)lists.jboss.org>
> > > Subject
> > > Re: [rules-users] [droolsflow] Code-based constraints for
> > EventWait
> > > nodes
> > > - is this possible?
> > >
> > >
> > >
> > >
> > >
> > >
> > > No, the constraint of an EventWait node (or the State node in
> > Drools
> > > 5.1) can only be rule-based. The reason for this is that the
> rule
> > > engine knows when to re-evaluates rules (based on the evailable
> > > input).
> > > If you would use a code-based constraint, the engine would have
> > no
> > > idea
> > > when this code constraint might become true (if it was false at
> > the
> > > start). Only constant re-evaluation of the code constraint
> could
> > > achieve this (which would be tremendously inefficient). Could
> you
> > > explain why you would like to have this behaviour? Maybe there
> is
> > > an
> > > alternative way to model this.
> > >
> > > To change the value of a variable from inside the process (using
> > an
> > > action), simply use kcontext.setVariable(name, value). We do
> not
> > > recommend manually changing the value of a process variable from
> > > outside
> > > the engine. Again, could you explain why you would like to have
> > > this
> > > functionality?
> > >
> > > Kris
> > >
> > > Quoting Alan.Gairey(a)tessella.com:
> > >
> > > > Can the constraint for an EventWait node in a flow be
> code-based
> > > > (rather
> > > > than rule-based)? The Eclipse plug-in (v 5.0.1) doesn't allow
> > this
> > > to
> > > > be
> > > > specified, unlike say for a Split node, although the relevant
> > XML
> > > can
> > > > of
> > > > course be edited.
> > > > Trying to load such a process flow results in a
> > > NullPointerException,
> > > >
> > > > because the constraint is always interpreted as a rule.
> > > >
> > > > Ideally what I'd like to do is have an EventWait node where
> the
> > > > constraint
> > > > tests the value of a process variable. This then leads me to
> > > another
> > > >
> > > > question; is there a way of setting the value of a process
> > > variable
> > > > via
> > > > the Drools Flow API?
> > > >
> > > > Thanks in advance for any help,
> > > >
> > > > Alan
> > > > Tessella plc
> > > > 26 The Quadrant, Abingdon Science Park, Abingdon, Oxfordshire,
> > > OX14
> > > > 3YS
> > > > E: Alan.Gairey(a)tessella.com, T: +44 (0)1235 555511, F: +44
> > (0)1235
> > > > 553301
> > > > www.tessella.com Registered in England No. 1466429
> > > >
> > > > This message is commercial in confidence and may be
> privileged.
> > It
> > > is
> > > >
> > > > intended for the addressee(s) only. Access to this message by
> > > anyone
> > > > else
> > > > is unauthorized and strictly prohibited. If you have received
> > this
> > > > message
> > > > in error, please inform the sender immediately. Please note
> that
> > > > messages
> > > > sent or received by the Tessella e-mail system may be
> monitored
> > > and
> > > > stored
> > > > in an information retrieval system.
> > > >
> > >
> > >
> > >
> > >
> > > Disclaimer: http://www.kuleuven.be/cwis/email_disclaimer.htm
> > >
> > >
> >
> >
> >
> >
> > Disclaimer: http://www.kuleuven.be/cwis/email_disclaimer.htm
> >
> >
>
>
>
>
> Disclaimer: http://www.kuleuven.be/cwis/email_disclaimer.htm
> [attachment "drools-persistence-test.zip" deleted by Alan
> Gairey/Tessella]
> _______________________________________________
> rules-users mailing list
> rules-users(a)lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
>
Disclaimer: http://www.kuleuven.be/cwis/email_disclaimer.htm
16 years, 4 months
Fusion [Error]- java.lang.ClassCastException: org.drools.common.DefaultFactHandle cannot be cast to org.drools.common.EventFactHandle
by Chetan Mahadev
Hi I am getting the following error while inserting into the entrypoint.
rule "Check if EligibleAlert is an Signature Event"
agenda-group "enrichment"
auto-focus true
no-loop true
when
$list : EventSignatureList();
$p : EligibleAlert($a : alert, $a.eventSignatureProcessingStatus!="TRUE"
);
eval((ifMatchesSyslog($list.getAllSyslogMnemonics(), $a)!=null) )
then
try{
WorkingMemoryEntryPoint eventsignaturestream =
drools.getEntryPoint("EVENT SIGNATURE STREAM") ;
eventsignaturestream.insert($p);
} catch(Exception e)
{
log.error("[EventSignatureRules] - exception in Check if
EligibleAlert is an Signature Event alert[ids=" + $p.getAlert().getId() +
"][error:" + e.toString() + "]");
}
end
And I am creating the session this way:
*
knowledgeBaseConfig =
KnowledgeBaseFactory.newKnowledgeBaseConfiguration();
knowledgeBaseConfig.setOption( EventProcessingOption.STREAM );
kBase = KnowledgeBaseFactory.newKnowledgeBase( knowledgeBaseConfig
);
kBase.addKnowledgePackages(knowledgeBuilder.getKnowledgePackages());
KnowledgeSessionConfiguration knowledgeSessionConfig =
KnowledgeBaseFactory.newKnowledgeSessionConfiguration();
((SessionConfiguration) knowledgeSessionConfig).setClockType(
ClockType.REALTIME_CLOCK );
kBase.newStatefulKnowledgeSession(knowledgeSessionConfig,null);*
I get the Following error when my rule fires:
2009-11-09 15:02:00,675 FATAL pool-2-thread-1 LogStream -
java.lang.ClassCastException: org.drools.common.DefaultFactHandle cannot be
cast to org.drools.common.EventFactHandle
2009-11-09 15:02:00,676 FATAL pool-2-thread-1 LogStream - at
org.drools.base.evaluators.AfterEvaluatorDefinition$AfterEvaluator.evaluateCachedRight(AfterEvaluatorDefinition.java:321)
2009-11-09 15:02:00,676 FATAL pool-2-thread-1 LogStream - at
org.drools.rule.VariableRestriction.isAllowedCachedRight(VariableRestriction.java:116)
2009-11-09 15:02:00,676 FATAL pool-2-thread-1 LogStream - at
org.drools.rule.VariableConstraint.isAllowedCachedRight(VariableConstraint.java:112)
2009-11-09 15:02:00,676 FATAL pool-2-thread-1 LogStream - at
org.drools.common.DefaultBetaConstraints.isAllowedCachedRight(DefaultBetaConstraints.java:200)
2009-11-09 15:02:00,676 FATAL pool-2-thread-1 LogStream - at
org.drools.reteoo.JoinNode.assertObject(JoinNode.java:172)
2009-11-09 15:02:00,676 FATAL pool-2-thread-1 LogStream - at
org.drools.reteoo.SingleObjectSinkAdapter.propagateAssertObject(SingleObjectSinkAdapter.java:42)
2009-11-09 15:02:00,676 FATAL pool-2-thread-1 LogStream - at
org.drools.reteoo.PropagationQueuingNode$AssertAction.execute(PropagationQueuingNode.java:326)
2009-11-09 15:02:00,676 FATAL pool-2-thread-1 LogStream - at
org.drools.reteoo.PropagationQueuingNode.propagateActions(PropagationQueuingNode.java:221)
2009-11-09 15:02:00,676 FATAL pool-2-thread-1 LogStream - at
org.drools.reteoo.PropagationQueuingNode$PropagateAction.execute(PropagationQueuingNode.java:394)
2009-11-09 15:02:00,676 FATAL pool-2-thread-1 LogStream - at
org.drools.common.AbstractWorkingMemory.executeQueuedActions(AbstractWorkingMemory.java:1486)
2009-11-09 15:02:00,676 FATAL pool-2-thread-1 LogStream - at
org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:158)
2009-11-09 15:02:00,676 FATAL pool-2-thread-1 LogStream - at
org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:122)
2009-11-09 15:02:00,676 FATAL pool-2-thread-1 LogStream - at
org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:80)
2009-11-09 15:02:00,676 FATAL pool-2-thread-1 LogStream - at
org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:28)
2009-11-09 15:02:00,676 FATAL pool-2-thread-1 LogStream - at
pnoc.alertProcessor.Rule_Check_if_EligibleAlert_is_an_Signature_Event_0.consequence(Rule_Check_if_EligibleAlert_is_an_Signature_Event_0.java:16)
2009-11-09 15:02:00,676 FATAL pool-2-thread-1 LogStream - at
pnoc.alertProcessor.Rule_Check_if_EligibleAlert_is_an_Signature_Event_0ConsequenceInvoker.evaluate(Rule_Check_if_EligibleAlert_is_an_Signature_Event_0ConsequenceInvoker.java:24)
Pls help!
Regds
Chetan
16 years, 4 months
Drools Flow : Persistence :- Getting Null Pointer Exception in JPAWorkItemManager.java
by Pardeep.Ruhil@lntinfotech.com
Hi,
When I try to run a sample test case using drools-persistence.jar it works
successfully.
But when I try to include the persistence in my OFBiz application, I am
getting null pointer exception in class JPAWorkItemManager.java.
java.lang.NullPointerException
at
org.drools.persistence.processinstance.JPAWorkItemManager.completeWorkItem(
JPAWorkItemManager.java:85).
Null Pointer is because of getting EntityManager object as NULL. In the
below line of JPAWorkItemManager.java
EntityManager em = (EntityManager) this.workingMemory
.getEnvironment().get( EnvironmentName.ENTITY_MANAGER );
the em is null.
Because of this I am getting Null Pointer exception when it try to run the
code
if (workItemInfo == null) {
workItemInfo = em.find(WorkItemInfo.class, id);
}
Can you tell me why I getting NPE when I try to run the jar file in my
application.
While the code run successfully when I try to run sample test case for
that.
Please help me to get through the situation.
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.
______________________________________________________________________
16 years, 4 months