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
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, 4 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
Re: [rules-users] java.lang.ClassCastException: [Lorg.drools.rule.Package; cannot be cast to org.drools.rule.Package
by Manasi
Hi,
I am also getting same error when trying to a call rule stored in guvnor.
Following error I am getting:
Exception in thread "main" java.lang.ClassCastException:
[Lorg.drools.rule.Package; cannot be cast to org.drools.rule.Package
at org.drools.agent.HttpClientImpl.fetchPackage(HttpClientImpl.java:82)
at org.drools.agent.URLScanner.readPackage(URLScanner.java:171)
at org.drools.agent.URLScanner.getChangeSet(URLScanner.java:143)
at org.drools.agent.URLScanner.loadPackageChanges(URLScanner.java:119)
at org.drools.agent.RuleAgent.checkForChanges(RuleAgent.java:427)
at org.drools.agent.RuleAgent.refreshRuleBase(RuleAgent.java:379)
at org.drools.agent.RuleAgent.configure(RuleAgent.java:364)
at org.drools.agent.RuleAgent.init(RuleAgent.java:264)
at org.drools.agent.RuleAgent.newRuleAgent(RuleAgent.java:204)
at org.drools.agent.RuleAgent.newRuleAgent(RuleAgent.java:164)
at org.drools.agent.RuleAgent.newRuleAgent(RuleAgent.java:273)
I am using Drools 5.4 version.
The error is coming when trying to get the RuleAgent:
RuleAgent agent = RuleAgent.newRuleAgent("/com/model/drools.properties");
drools.properties contains:
url =
http://localhost:8080/guvnor/org.drools.guvnor.Guvnor/package/FeltKnapRes...
name=guvnorAgent
enableBasicAuthentication=True
username=admin
password=admin
FeltKnapRestriktionerKundeMedAnl is the package name I have created in
guvnor ,and I want to call one of the rule in this package.
Thanks,
Manasi
--
View this message in context: http://drools.46999.n3.nabble.com/java-lang-ClassCastException-Lorg-drool...
Sent from the Drools: User forum mailing list archive at Nabble.com.
11 years, 5 months
Fire Rule in Stateless Knowledge Session
by snehils
Hi,
I am new in Drools. I am using Drools version 5.1.0
My requirement is kind of request response, where I have to perform some
checks for the request and respond the result. Hence, I decided to go with
stateless knowledge session.
I have prepared .DRL file and it contains set of rules. When some request
receives I have to identify the rule(s) belongs to that request and then
fire the rule(s).
I am not able to figure out how to categories the rules request wise in DRL
file? Also, how to fire only those rules which belongs to the category.
For example, there are three kinds of requests Rq1, Rq2 and Rq3. There are
rules in DRL file: R1, R2, R3, R4 and R5. R1, R2 belongs to Rq1, R3 belongs
to Rq2 and R4, R5 belongs to Rq3.
When some request receives only its belonging rules should be fired. For
example, on receiving of Rq2 only R3 should be fired.
Please provide me some code snipped or link.
Thanks
--
View this message in context: http://drools.46999.n3.nabble.com/Fire-Rule-in-Stateless-Knowledge-Sessio...
Sent from the Drools: User forum mailing list archive at Nabble.com.
11 years, 6 months
Guvnor: Accessing Bound Variable in "Then" Statement
by Vann_the_Red
Hello. I started with a search and didn't find an answer. I apologize if my
search-fu was lacking today.
I'm a non-developer tasked with rules creation and testing using guvnor. I
have found some scenarios where I can bind a variable to either the whole
input model or a fact in the input model and then later access those in the
output model by selecting "Bound Variable" from the popup box in the Then
statement. In other scenarios, "Bound Variable" is not an option (only
Literal or Formula). What must I do to be able to access the bound
variables from the When statement(s) in the Then statement(s)?
TIA,
Vann
This is a repost because I wasn't on the mailing list yet and I gather most
didn't see it. Apologies again.
--
View this message in context: http://drools.46999.n3.nabble.com/Guvnor-Accessing-Bound-Variable-in-Then...
Sent from the Drools: User forum mailing list archive at Nabble.com.
11 years, 6 months
Guvnor-5.5
by Ricardo
Is any one tried guvnor-5.5 in websphere application server?
What happen to the conponents.xml?
Why guvnor is tightly coupled with jbossAS even each version (jbossAS) got
separate war file?
this seems a big impediment for using guvnor as rule authoring tools.
Is one knows well aware these and already know how to deal this, please
advise me?
-----
with kind regards,
--
View this message in context: http://drools.46999.n3.nabble.com/Guvnor-5-5-tp4022096.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
11 years, 6 months
How to write Hibernate query lang(HQL) in .DRL file
by zeeshan
Hi !
According to my requirement I need to fetch and Insert data from database
using Hibernate Query from .DRL file.
I have idea how to execute HQL in Plain Java class but according to my
requirement,I need to fire query to database from .DRL file which I tried
but unable to get output instead I was getting errors.
Can anyone suggest me process to execute Hibernate Query from DRL file
or please provide me some sample code or any link.
Thanks !!
--
View this message in context: http://drools.46999.n3.nabble.com/How-to-write-Hibernate-query-lang-HQL-i...
Sent from the Drools: User forum mailing list archive at Nabble.com.
11 years, 7 months