Dependency enumeration
by agarwalk
Hi
I have created following enumeration and java class file.
*Enumeration:*
'OrderData.propertyState':(new com.asps.rules.OrderData()).loadStates()
'OrderData.fulfillmentReviewerName[propertyState]':'(new
com.asps.rules.OrderData()).loadReviewers("@{propertyState}")'
*Java class:*
public class OrderData implements Serializable {
private String propertyState;
private String fulfillmentReviewerName;
// getters and setters
public List<String> loadStates() {
List<String> states = new ArrayList<String>();
states.add("CA");
states.add("NY");
states.add("FL");
return states;
}
public List<String> loadReviewers(final String propertyState) {
List<String> reviewers = new ArrayList<String>();
System.out.println("### in load reviewers ### : " + propertyState);
if ("CA".equalsIgnoreCase(propertyState)) {
reviewers.add("A");
reviewers.add("B");
System.out.println("Reviewers : A & B");
} else if ("NY".equalsIgnoreCase(propertyState)) {
reviewers.add("C");
reviewers.add("D");
System.out.println("Reviewers : C& D");
} else if ("FL".equalsIgnoreCase(propertyState)) {
reviewers.add("E");
reviewers.add("F");
System.out.println("Reviewers : E& F");
} else {
reviewers.add("G");
reviewers.add("H");
System.out.println("Reviewers : G& H");
}
return reviewers;
}
}
I created a rule as follows
WHEN
There is an OrderData with:
propertyState[propertyState]* FL* --- This is a drop down which
is being displayed correctly
fulfillmentReviewerName [fulfillmentReviewerName] -- This should
have been the drop down. Values are dependent on the state selected.
When i try to create above rule the enumeration is loaded correctly for
propertyState but the enumeration is not loaded for fulfillmentReviewerName
field. When I saw the logs the correct method and condition is being
invoked (as per Sys out)but drop down does not contain anything.
ANy suggestions?
--
View this message in context: http://drools.46999.n3.nabble.com/Dependency-enumeration-tp3245703p324570...
Sent from the Drools: User forum mailing list archive at Nabble.com.
11 years, 3 months
Guvnor - Loading enums programatically using rule metadata
by GPatel@tsys.com
The Guvnor manual specifies how to load enum data programtically but it
seems like only other fields on the same Fact can be used to filter the
values that can show up in the drop-down fields, as shown below:
'Fact.field[dependentField1, dependentField2]' : '(new
com.yourco.DataHelper()).getListOfAges("@{dependentField1}",
"@{dependentField2}")'
Is it possible to somehow use other rule attributes, like package name or
rule metadata to filter the list? Something like the following:
'Fact.field[dependentField1]' : '(new
com.yourco.DataHelper()).getListOfAges("@{dependentField1}",
drools.getRule().getMetaData().get("ID"))'
Thanks
G. Patel
-----------------------------------------
The information contained in this communication (including any
attachments hereto) is confidential and is intended solely for the
personal and confidential use of the individual or entity to whom
it is addressed. If the reader of this message is not the intended
recipient or an agent responsible for delivering it to the intended
recipient, you are hereby notified that you have received this
communication in error and that any review, dissemination, copying,
or unauthorized use of this information, or the taking of any
action in reliance on the contents of this information is strictly
prohibited. If you have received this communication in error,
please notify us immediately by e-mail, and delete the original
message. Thank you
11 years, 4 months
java.lang.ClassCastException: org.drools.reteoo.BetaMemory cannot be cast to org.drools.reteoo.AlphaNode$AlphaMemory
by dcrissman
Does this mean anything to anyone?
I found this, but I am using 5.5.0.Final:
http://drools.46999.n3.nabble.com/org-drools-reteoo-AlphaNode-AlphaMemory...
java.lang.ClassCastException: org.drools.reteoo.BetaMemory cannot be cast to
org.drools.reteoo.AlphaNode$AlphaMemory
at org.drools.reteoo.AlphaNode.assertObject(AlphaNode.java:136)
at
org.drools.reteoo.CompositeObjectSinkAdapter.doPropagateAssertObject(CompositeObjectSinkAdapter.java:497)
at
org.drools.reteoo.CompositeObjectSinkAdapter.propagateAssertObject(CompositeObjectSinkAdapter.java:382)
at org.drools.reteoo.AlphaNode.assertObject(AlphaNode.java:141)
at
org.drools.reteoo.CompositeObjectSinkAdapter.doPropagateAssertObject(CompositeObjectSinkAdapter.java:497)
at
org.drools.reteoo.CompositeObjectSinkAdapter.propagateAssertObject(CompositeObjectSinkAdapter.java:382)
at org.drools.reteoo.ObjectTypeNode.assertObject(ObjectTypeNode.java:235)
at org.drools.reteoo.EntryPointNode.assertObject(EntryPointNode.java:240)
at org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:350)
at org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:311)
at
org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:903)
at
org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:847)
at
org.drools.impl.StatefulKnowledgeSessionImpl.insert(StatefulKnowledgeSessionImpl.java:269)
...
--
View this message in context: http://drools.46999.n3.nabble.com/java-lang-ClassCastException-org-drools...
Sent from the Drools: User forum mailing list archive at Nabble.com.
11 years, 5 months
RightTupleIndexHashTable
by Ming Fang
What is the purpose of RightTupleIndexHashTable?
We are getting the exception below but unable to come up with a self contained unit test to demonstrate the problem.
Caused by: java.lang.NullPointerException: null
at org.drools.core.util.index.RightTupleIndexHashTable.removeAdd(RightTupleIndexHashTable.java:344) ~[drools-core-5.5.0.Final.jar:5.5.0.Final]
at org.drools.reteoo.JoinNode.modifyRightTuple(JoinNode.java:224) ~[drools-core-5.5.0.Final.jar:5.5.0.Final]
at org.drools.reteoo.PropagationQueuingNode$ModifyToSinkAction.execute(PropagationQueuingNode.java:513) ~[drools-core-5.5.0.Final.jar:5.5.0.Final]
at org.drools.reteoo.PropagationQueuingNode.propagateActions(PropagationQueuingNode.java:280) ~[drools-core-5.5.0.Final.jar:5.5.0.Final]
at org.drools.reteoo.PropagationQueuingNode$PropagateAction.execute(PropagationQueuingNode.java:588) ~[drools-core-5.5.0.Final.jar:5.5.0.Final]
at org.drools.common.AbstractWorkingMemory.executeQueuedActions(AbstractWorkingMemory.java:993) [drools-core-5.5.0.Final.jar:5.5.0.Final]
11 years, 5 months
Guvnor seems to copy assets across External RDBMS and file system
by Yuri
I set up SQL Server as the external repository, and left everything else in
guvnor and jboss AS7 configured pretty much according to defaults.
When I create assets in guvnor, I see that changes are being made in the
MSSQL db. Despite changes to the db, however, I'm still seeing changes to
the Repository and Workspace folders. It gets more interesting when I
truncate the tables in the external guvnor db, and restart guvnor, it seems
to get all of its assets back from those two folders.
Am I doing something wrong? Is it reconstructing the assets from lucene
indexes? If MSSQL is already indexing things, is the lucene index still
necessary? Are these basic JCR concepts that I am not grasping?
Thanks, Yuri
11 years, 5 months
how to debug rules in JBoss AS?
by Marina
Hello,
I know one can debug rules (put breakpoints in .drl and ruleflow files) when
running/debugging an application as a Drools Application.
However, I would like to debug rules when my application is running in JBoss AS
- just like we do a normal debugging of a Remote application running in a
different JVM ,by enabling the JDWP on the server
(-Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=n) and then
connecting to the specified port.
Basically, I would like to be able to debug both my Java classes and rules
together. Is it possible?
thanks,
Marina
11 years, 5 months
How to set drools.dialect.mvel.strict = false?
by jeetendray
Hi,
Snippet of my DRL .
rule "Rev: Start Time < 2 Hours in Future"
when
$obj : eval(compareDatesWithTime(startDateTime, -2, 2, "<"))
then
$obj.addFailedRule("Rev: Start Time < 2 Hours in Future");
end
This fails during compilation and throws error:
org.drools.rule.InvalidRulePackage: Unable to Analyse Expression
(eval(compareDatesWithTime(startDateTime, -2, 2, "<")) ):
[Error: unable to resolve method using strict-mode: myObject.eval(boolean)]
[Near : {... (eval(compareDatesWithTime(star ....}]
^
[Line: 6, Column: 2] : [Rule name='Proposal - Start time is after current +
2 hour']
I am using Drools 5.5 and I found the cause that my code runs in strict
mode.. so If I set strict mode to false then this would work. Now I am not
sure how to make it to false.
Here's the code I am using:
PackageBuilderConfiguration packageBuilderConfiguration = new
PackageBuilderConfiguration();
PackageBuilder packageBuilder = new
PackageBuilder(packageBuilderConfiguration);
packageBuilder.addPackageFromDrl(drl.getCharacterStream());
Can someone please suggest me how to do that??
Thanks!!!
--
View this message in context: http://drools.46999.n3.nabble.com/How-to-set-drools-dialect-mvel-strict-f...
Sent from the Drools: User forum mailing list archive at Nabble.com.
11 years, 5 months