JDT, JCI and Janino
by Leonardo Gomes
Hi Guys,
I was wondering why am I limited to JDT and Janino compiler (using Drools
4.0.7)?
Using JCI I would theoretically be able to plug another compiler (javac?),
wouldn't I?
I had a look at the JavaDialectConfiguration and it doesn't allow anything
other than:
- org.eclipse.jdt.internal.compiler.Compiler
- org.codehaus.janino.Parser
Thanks in advance!
Cheers,
Leo.
15 years, 1 month
drools fusion: rule of type 2 minutes before event A finishes
by Maciej Prochniak
Hello,
I have following use case in drools fusion:
event A has specified duration (different for each occurence)
I would like to fire rule if event B does not happen eventA.endTimestamp
-2minutes.
e.g. event A has duration 20minutes, it's inserted on 13:22:00, then
rule should fire on 13:40 if event B does not occur before.
I looked on temporal operators - but could not find anything suitable,
it should be sth like:
when
$eventA
not (EventB( this after[ negative infinity, -2m ] $eventA )
then
...
end
- but there's no infinity symbol in drools, nor java ;)
Any ideas?
thanks & br,
maciek
15 years, 1 month
[droolsflow] JPAVariablePersister - ClassCastException on ForEachNodeInstance
by Bill Tarr
This seems more like a bug, I thought I'd post it here, but point me to the JIRA if I need to enter an issue.
Still testing out JPAVariablePersister. It appears the session, processes, and variables are persisted. However, when I try to load the session again, and reopen the process as follows, I get a ClassCastException.
StatefulKnowledgeSession session = JPAKnowledgeService.loadStatefulKnowledgeSession( 1, knowledgeBase, null, env );
ProcessInstance processClm = session.getProcessInstance(1);
The second line (ClaimsDemoJpaTest.java:182) is the source of the stack trace below. The error makes sense, as:
ForEachNodeInstance extends CompositeNodeInstance
CompositeContextNodeInstance extends CompositeNodeInstance
So they clearly cannot be cast to each other, but I'm not of how to troubleshoot this beyond that. The line of code throwing the error clearly expects to be able to cast the nodeInstance.
restoreVariable(variableInfo, parentIds, variableName, (CompositeContextNodeInstance) nodeInstance);
Here is the stack:
java.lang.ClassCastException: org.drools.workflow.instance.node.ForEachNodeInstance cannot be cast to org.drools.workflow.instance.node.CompositeContextNodeInstance
at org.drools.persistence.processinstance.ProcessInstanceInfo.restoreVariable(ProcessInstanceInfo.java:198)
at org.drools.persistence.processinstance.ProcessInstanceInfo.restoreVariables(ProcessInstanceInfo.java:166)
at org.drools.persistence.processinstance.ProcessInstanceInfo.getProcessInstance(ProcessInstanceInfo.java:144)
at org.drools.persistence.processinstance.JPAProcessInstanceManager.getProcessInstance(JPAProcessInstanceManager.java:62)
at org.drools.common.AbstractWorkingMemory.getProcessInstance(AbstractWorkingMemory.java:1720)
at org.drools.impl.StatefulKnowledgeSessionImpl.getProcessInstance(StatefulKnowledgeSessionImpl.java:261)
at org.drools.command.runtime.process.GetProcessInstanceCommand.execute(GetProcessInstanceCommand.java:29)
at org.drools.command.runtime.process.GetProcessInstanceCommand.execute(GetProcessInstanceCommand.java:12)
at org.drools.persistence.session.SingleSessionCommandService.execute(SingleSessionCommandService.java:254)
at org.drools.command.impl.CommandBasedStatefulKnowledgeSession.getProcessInstance(CommandBasedStatefulKnowledgeSession.java:92)
at com.csatp.svc.rulesmgr.claim.ClaimsDemoJpaTest.validateDocumentWorkflow2(ClaimsDemoJpaTest.java:182)
Obviously this is a flow with a ForEach node. The ForEach calls a subflow for each item in the List claim.roles, in my test case, there are 2 subflows.
I don't know if it helps, but here is the forEach node from the flow:
<forEach id="2" name="ForEach" x="423" y="62" width="200" height="150" variableName="role" collectionExpression="claim.roles" >
<nodes>
<subProcess id="1" name="Document Workflow" x="36" y="40" width="132" height="48" processId="DocumentWorkflow2" >
<mapping type="in" from="role" to="role" />
</subProcess>
</nodes>
<connections>
</connections>
<in-ports>
<in-port type="DROOLS_DEFAULT" nodeId="1" nodeInType="DROOLS_DEFAULT" />
</in-ports>
<out-ports>
<out-port type="DROOLS_DEFAULT" nodeId="1" nodeOutType="DROOLS_DEFAULT" />
</out-ports>
</forEach>
15 years, 1 month
FW: Re: Stumped on forall usage
by Tom.E.Murphy@wellsfargo.com
Edson - please disregard my question on this - we've found out the root cause. The data types of the borrowerNumber and the creditBorrowerNumber attributes, which are deep inside a complex object hierarchy, are different - one is string and one is short.
We'll deal with that issue now that we understand it. Thanks for your time.
Tom Murphy
Business Process Consultant
Wells Fargo HCFG - CORE Deal Decisioning Platform
800 S. Jordan Creek Parkway | West Des Moines, IA 50266
MAC: X2301-01B
Office: 515 324 4853 | Mobile: 941 320 8014
This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose, or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation.
_____________________________________________
From: Murphy, Tom E.
Sent: Tuesday, October 20, 2009 2:04 PM
To: 'rules-users(a)lists.jboss.org'
Subject: Re: Stumped on forall usage
Edson -
Sorry, I forgot to mention the version number.
I'm using Drools 5.0.1.
If you also observe the incorrect behavior in 5.0.1, I'll try the trunk.
If you're not able to, then it must be something I'm doing.
Date: Tue, 20 Oct 2009 12:38:08 -0400
From: Edson Tirelli <ed.tirelli(a)gmail.com>
Subject: Re: [rules-users] Stumped on forall usage
To: Rules Users List <rules-users(a)lists.jboss.org>
Message-ID:
<e6dd5ba30910200938g6ea41adco22a8801146b60519(a)mail.gmail.com>
Content-Type: text/plain; charset="windows-1252"
Tom,
What version are you using? I just tried with trunk and it works fine. I added your test case to the code base, anyway. Disclaimer: I did fixed a couple things in forall last week, not related to your scenario, but who knows?
http://fisheye.jboss.org/changelog/JBossRules/?cs=29700
If you can try it with trunk or tell me what version you are using I will check it out.
Edson
2009/10/20 <Tom.E.Murphy(a)wellsfargo.com<mailto:Tom.E.Murphy@wellsfargo.com>>
> I?m having trouble with the forall CE.
>
> I have the following rule:
>
> rule "RS6524"
> when
> Borrower ( $borrowerNumber1 : borrowerNumber )
> forall
> (
> $fico : FICO (creditBorrowerNumber ==
> $borrowerNumber1 )
> FICO (this == $fico, validScoreIndicator ==
> false)
> )
> then
> System.out.println("RS6524 fired?); end
>
> I pass in objects whose data is described below:
>
> *Borrower* { borrowerNumber = *1* }
> *FICO* { creditBorrowerNumber = *1*, validScoreIndicator = *true* }
>
> Although the rule should not fire with this data, it does.
>
> Am I misunderstanding the way this CE should work?
>
> *Tom Murphy
Tom Murphy
Business Process Consultant
Wells Fargo HCFG - CORE Deal Decisioning Platform
800 S. Jordan Creek Parkway | West Des Moines, IA 50266
MAC: X2301-01B
Office: 515 324 4853 | Mobile: 941 320 8014
This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose, or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation.
15 years, 1 month
FW: Re: Stumped on forall usage
by Tom.E.Murphy@wellsfargo.com
Edson - please disregard the issue - we've found out the root cause. The datatypes of the borrowerNumber and the creditBorrowerNumber, which are deep inside an object hierarchy, are different - one is string and one is short.
We'll deal with that issue now that we understand it. Thanks for your time, though.
Tom Murphy
Business Process Consultant
Wells Fargo HCFG - CORE Deal Decisioning Platform
800 S. Jordan Creek Parkway | West Des Moines, IA 50266
MAC: X2301-01B
Office: 515 324 4853 | Mobile: 941 320 8014
This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose, or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation.
_____________________________________________
From: Murphy, Tom E.
Sent: Tuesday, October 20, 2009 2:04 PM
To: 'rules-users(a)lists.jboss.org'
Subject: Re: Stumped on forall usage
Edson -
Sorry, I forgot to mention the version number.
I'm using Drools 5.0.1.
If you also observe the incorrect behavior in 5.0.1, I'll try the trunk.
If you're not able to, then it must be something I'm doing.
Date: Tue, 20 Oct 2009 12:38:08 -0400
From: Edson Tirelli <ed.tirelli(a)gmail.com>
Subject: Re: [rules-users] Stumped on forall usage
To: Rules Users List <rules-users(a)lists.jboss.org>
Message-ID:
<e6dd5ba30910200938g6ea41adco22a8801146b60519(a)mail.gmail.com>
Content-Type: text/plain; charset="windows-1252"
Tom,
What version are you using? I just tried with trunk and it works fine. I added your test case to the code base, anyway. Disclaimer: I did fixed a couple things in forall last week, not related to your scenario, but who knows?
http://fisheye.jboss.org/changelog/JBossRules/?cs=29700
If you can try it with trunk or tell me what version you are using I will check it out.
Edson
2009/10/20 <Tom.E.Murphy(a)wellsfargo.com<mailto:Tom.E.Murphy@wellsfargo.com>>
> I?m having trouble with the forall CE.
>
> I have the following rule:
>
> rule "RS6524"
> when
> Borrower ( $borrowerNumber1 : borrowerNumber )
> forall
> (
> $fico : FICO (creditBorrowerNumber ==
> $borrowerNumber1 )
> FICO (this == $fico, validScoreIndicator ==
> false)
> )
> then
> System.out.println("RS6524 fired?); end
>
> I pass in objects whose data is described below:
>
> *Borrower* { borrowerNumber = *1* }
> *FICO* { creditBorrowerNumber = *1*, validScoreIndicator = *true* }
>
> Although the rule should not fire with this data, it does.
>
> Am I misunderstanding the way this CE should work?
>
> *Tom Murphy
Tom Murphy
Business Process Consultant
Wells Fargo HCFG - CORE Deal Decisioning Platform
800 S. Jordan Creek Parkway | West Des Moines, IA 50266
MAC: X2301-01B
Office: 515 324 4853 | Mobile: 941 320 8014
This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose, or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation.
15 years, 1 month
Re: [rules-users] Stumped on forall usage
by Tom.E.Murphy@wellsfargo.com
Edson -
Sorry, I forgot to mention the version number.
I'm using Drools 5.0.1.
If you also observe the incorrect behavior in 5.0.1, I'll try the trunk.
If you're not able to, then it must be something I'm doing.
Date: Tue, 20 Oct 2009 12:38:08 -0400
From: Edson Tirelli <ed.tirelli(a)gmail.com>
Subject: Re: [rules-users] Stumped on forall usage
To: Rules Users List <rules-users(a)lists.jboss.org>
Message-ID:
<e6dd5ba30910200938g6ea41adco22a8801146b60519(a)mail.gmail.com>
Content-Type: text/plain; charset="windows-1252"
Tom,
What version are you using? I just tried with trunk and it works fine. I added your test case to the code base, anyway. Disclaimer: I did fixed a couple things in forall last week, not related to your scenario, but who knows?
http://fisheye.jboss.org/changelog/JBossRules/?cs=29700
If you can try it with trunk or tell me what version you are using I will check it out.
Edson
2009/10/20 <Tom.E.Murphy(a)wellsfargo.com<mailto:Tom.E.Murphy@wellsfargo.com>>
> I?m having trouble with the forall CE.
>
> I have the following rule:
>
> rule "RS6524"
> when
> Borrower ( $borrowerNumber1 : borrowerNumber )
> forall
> (
> $fico : FICO (creditBorrowerNumber ==
> $borrowerNumber1 )
> FICO (this == $fico, validScoreIndicator ==
> false)
> )
> then
> System.out.println("RS6524 fired?); end
>
> I pass in objects whose data is described below:
>
> *Borrower* { borrowerNumber = *1* }
> *FICO* { creditBorrowerNumber = *1*, validScoreIndicator = *true* }
>
> Although the rule should not fire with this data, it does.
>
> Am I misunderstanding the way this CE should work?
>
> *Tom Murphy
Tom Murphy
Business Process Consultant
Wells Fargo HCFG - CORE Deal Decisioning Platform
800 S. Jordan Creek Parkway | West Des Moines, IA 50266
MAC: X2301-01B
Office: 515 324 4853 | Mobile: 941 320 8014
This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose, or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation.
15 years, 1 month
Stumped on forall usage
by Tom.E.Murphy@wellsfargo.com
I'm having trouble with the forall CE.
I have the following rule:
rule "RS6524"
when
Borrower ( $borrowerNumber1 : borrowerNumber )
forall
(
$fico : FICO (creditBorrowerNumber == $borrowerNumber1 )
FICO (this == $fico, validScoreIndicator == false)
)
then
System.out.println("RS6524 fired");
end
I pass in objects whose data is described below:
Borrower { borrowerNumber = 1 }
FICO { creditBorrowerNumber = 1, validScoreIndicator = true }
Although the rule should not fire with this data, it does.
Am I misunderstanding the way this CE should work?
Tom Murphy
Business Process Consultant
Wells Fargo HCFG - CORE Deal Decisioning Platform
800 S. Jordan Creek Parkway | West Des Moines, IA 50266
MAC: X2301-01B
Office: 515 324 4853 | Mobile: 941 320 8014
This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose, or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation.
15 years, 1 month
Question about backing up a flow
by Nair, Mahesh
Hello everyone,
I'm new to drools & I'm trying my hand at creating a rule-flow in which I can back a couple of steps &
the KnowledgeSession is restored to the same state it was in earlier. I'm using Drools 5.1.0 M1 & Eclipse 3.5.
I have a rule-flow with the following nodes:
A->B->C
where A would be a node asking for an input (our fact), B would be a Rule Task that would apply certain rules on our fact &
at C, I may decide that I need to back up to node A. Both A & C are custom work items.
I've managed to rollback the transaction (I borrowed a lot of code from the test classes in the source, thanks a ton for them).
But I just can't get my process to start again.
I'll paste a couple of lines of code from my test class below:
.....
ProcessInstance pi = ksession.startProcess("sampleflow");
ksession.fireAllRules();
ut = (UserTransaction) new InitialContext().lookup( "java:comp/UserTransaction" );
ut.begin();//Is beginning the transaction boundary here correct?
.....
//Now I roll back the transaction depending on the input at node C
ut.rollback();
.....
//And recreate the knowledge session
ksession = JPAKnowledgeService.loadStatefulKnowledgeSession(id, kbase, null, env);
I expected the session to restart the process from node A once it was recreated. Am I going in the right direction?
Or is my basic understanding of how session persistence works in Drools Flow flawed?
I'd really appreciate a push in the right direction.
Thanks in advance,
Mahesh.
15 years, 1 month
Hippo drools
by Christine
Friend of mine wanted to know if Hippo uses Drools. He used Google. He
found a nice description of how hippos drool.
dagdag
Christine
--
dagdag is just a two-character rotation of byebye.
15 years, 1 month