Enumerations for nested classes
by gab
Hi all,
I have a problem with data enumeration for nested classes in BRLs.
I have two classes, Promotion and Program. Promotion has a property named
"program" of type Program, which has a string property called "code".
I did a couple of enumeration in this way:
[Program.code] = ['ABC=First Program','XYZ=Second Program']
[Promotion.program.code] = ['ABC=First Program','XYZ=Second Program']
With decision table they work as expected, but in BRL rules only the first
works (the one with no nested classes), while in the other case the
drop-down list doesn't appear and it's shown only a free editable field.
How can it be? Should I write something in a different way? Is it a bug?
I'm using version 5.2.
Thanks in advance.
--
View this message in context: http://drools.46999.n3.nabble.com/Enumerations-for-nested-classes-tp34943...
Sent from the Drools: User forum mailing list archive at Nabble.com.
13 years, 2 months
How to write Drools rule basing on a changed property?
by kapokfly
Requirement:
1)
Rule
When
Person.address.address1 is changed
THEN
2) Ideally we should have 2 objects, 1 for the old person instance, the
other for the new person instance so contextually the LHS equals to
oldPerson.address.address1 != newPerson.address.address1.
A properties change listener might not be the best solution as it might span
multiple calls and the property change could be done on the web layer which
is out of the JBoss Drools knowledge session.
Ivan
--
View this message in context: http://drools.46999.n3.nabble.com/How-to-write-Drools-rule-basing-on-a-ch...
Sent from the Drools: User forum mailing list archive at Nabble.com.
13 years, 2 months
Rule Flow: Diverge/Converge Issue with one-to-many paths being exected
by dcrissman
Drools Version: 5.1 (We are looking into upgrading, but not an option at this
time)
I have need of a rule flow that will allow a diverge on one-to-many paths
and then converge and continue on only once the paths that were executed
have all finish.
Say I have path A, B, & C. The constraints on the diverge node indicate that
A & C should be executed simultaneously, but B should not. Then the converge
node should wait for A and C to finish, but not care about B as it was not
executed by the diverge.
Initial attempt was to use Diverge(OR) and Converge(AND). The problem is
that the Converge (I think) waits on B indefinitely and so the process exits
out with no error message.
It looks like n-of-m is kind of what I want, except I have no way to know
how many paths the Diverge kicked off.
Any thoughts on how this could be done?
Much Appreciated!
--
View this message in context: http://drools.46999.n3.nabble.com/Rule-Flow-Diverge-Converge-Issue-with-o...
Sent from the Drools: User forum mailing list archive at Nabble.com.
13 years, 2 months
newbie: Can rules planner provide me with the "single-steps" to the optimal binpacking solution ?
by Itai Frenkel
Hello,
I would like to solve a 2D binpacking problem. I have an existing bin-packing solution and would like to make it more "optimized". Each change (movement of items between bins) has a certain cost, and I would like to have a list of the least-cost path. There is more than one solution that is optimal.
Given an existing bin-packing solution I can tell if it is the optimal solution, and if not I can have a gross estimate to the distance to the optimal solution (although it is not guaranteed to be less than the actual distance).
It sounds to me that I need something like the A-Star algorithm. Can Drools help me in solving this problem ?
Thanks,
Itai
13 years, 2 months
Drools guvnor issue
by ANJALI
Hi guys,
i have integrated drools in my application when iam trying to save
my bpnm20 file for the frist time its saving correctly but when iam doing
for the second time its showing following error can any one tell me how to
debug this error
*Unable to save this asset, as it has been recently updated by [guest]*
iam currently using guvnor 5.3.0 final version
and designer version 1.0.0.056
Thanks in advance,
Anjali
--
View this message in context: http://drools.46999.n3.nabble.com/Drools-guvnor-issue-tp3489376p3489376.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
13 years, 2 months
Using Drools Flow with Multiple Fact Types
by Jason
I'm a relatively new user to Flows, but I have worked with a colleague to
instantiate flows that control a sequence of rule sets being applied to a
set of data in a meaningful order (e.g. I do pruning to limit the set of
facts as a first step, then generate sets of hypotheses, then score the
hypotheses and select the highest-scoring instance as a winner), so I do
have some experience and a baseline working Flow that is successfully
operating.
My next big challenge is to try to use Drools Flow to control which sets of
rules will be applied to which subsets of data - this goes beyond the uses I
have put it to before, which was just to control the single ordering of rule
sets that was then applied to all data.
My question has to do with the syntax of fact constraints used for
controlling flow, and how to control the flow using constraints that reflect
data characteristics when there are many different fact types that will be
going through the Flow. I will use an analogy to the actual problem to make
it a little simpler to describe.
What I want to do is to apply different rules based on the Program that a
particular Customer belongs to. If a customer is part of Program A, then I
want to apply RuleSet A, and if the Customer belongs to Program B then I
want to apply a different set of rules, RuleSet B.
My problem is twofold:
1.) I have not been able to demonstrate constraints working as I expected,
even when I simplified the data flow to its most basic form. The 'debug'
version of the flow that I created has a diverging OR gateway (specifically
OR, not an XOR gateway) with two criteria; the first is always true and
therefore all instances should result in an instance of LogStatementA, and
the second one has a constraint on the UserID associated with the customer
and thereby limits the set that should be exposed to a rule that generates
an instance of LogStatementB: "Customer(userId > 100)" as an example of
something I've tried, where any Customers with a UserID above 100 would then
trigger an instance of both LogStatementA and LogStatementB, while customers
with a UserID <= 100 would only trigger an instance of LogStatementA.
What I find is that if I set the constraint such that at least one Customer
instance in the data should trigger the selection, then ALL of the instances
of Customer in the data end up triggering an instance of LogStatementB (even
those instances that do not individually meet the constraint), while if I
set the constraint such that none of the Customer instances meets it, I get
zero instances of LogStatementB. In both cases, I get an instance of
LogStatementA for each Customer (as expected).
I don't understand why the existence of a single match to the Flow Control
rule (Customer(userId>100)) would trigger all instances of Customers
(including those with UserID's less than 100) to be routed to that path,
while having no matching instances correctly avoids sending any Customers
down this path.
Is there a common type of error that I might have perpetrated that would
cause this? I have tried a variety of combinations of the Type: and
Dialect: settings, though intuitively it seems like Type: Rule and
Dialect:mvel are correct given that I'm formulating the constraint as
"Customer(userId>100)". Also, if I introduce a typo in either the Customer
or userId elements of the rule, I get errors that make it clear the POJO for
this constraint is definitely being correctly imported.
2.) Assuming there is a fix to the underlying issue I'm seeing in #1, I
will want to extend this example so that I am pushing more than just
instances of Customer through my Flow. In particular, the rules that i want
to expose the data to after the diverging gateway represent different
flavors of the same type of logic, so what I want in the end is for all
Customer facts to be sent either one way or the other, and all non-Customer
facts to be sent BOTH ways. This will allow me, for instance, to apply
different thresholds to customers depending on which Program they are part
of.
I first formulated an attempt at the control rule for this as:
Customer(userId>100) or not Customer
with the idea that if the data coming through the flow is an instance of a
Customer, then I want the constraint to be applied to determine if it
proceeds down this flow, but if the data is not an instance of Customer then
I always want it to proceed down the path (e.g. all Account instances, all
RewardThreshold instances, etc.).
Is this a valid way to expect to use Drools Flow? In the examples I've
seen, there is only a single type of object that is going through a flow -
am I breaking the spirit of Drools Flow in trying to get multiple types of
facts flowing through?
Assuming I'm not committing heresy in this basic desire of what I'm trying
to do, is there an example anywhere of what the appropriate syntax for this
kind of constraint would/could be? Any of the variants I have tried (and
believe me, I've tried a bunch) have resulted in parsing errors (often of
the "unmatched then" or "unmatched (" sort when the flow is initially read
in). Can anyone point me to an example of a flow where multiple types of
facts are sent through? In fact, any pointers to examples of the syntax
that has been used within the Constraint Editor Textual Editor field could
help a lot in illustrating how to apply this element of Drools Flow control.
Any help or guidance will be greatly appreciated!
-Jason
--
View this message in context: http://drools.46999.n3.nabble.com/Using-Drools-Flow-with-Multiple-Fact-Ty...
Sent from the Drools: User forum mailing list archive at Nabble.com.
13 years, 2 months
Drools Expert 5.3.0 .war file, or standalone app ?
by eskomk
Hi all,
Drools Expert 5.3.0
Is there a .war file anywhere to be deployed on tomcat (6.0.28) ?
Didn't find it in the download zip (http://www.jboss.org/drools/downloads).
Currently, we are using Drools 5.1.1 as a web service, but due to some
shortcomings especially in windowing (window:time and window:length) and
timers, we are considering upgrading to 5.3.0.
So we are using REST interface to insert facts (events) in stateful session.
However, Drools expert as a web service is not a mandatory choice for us, a
standalone Drools java application would suit for as, as long as we can use
the REST interface.
So, if there is not .war file available for Drools Expert 5.3.0, I would
gladly hear if and how it is possible to use REST interface in a standalone
Java Drools application.
If you can point me to the right direction, I would really appreciate.
Greetings and thanks,
Esko
-----
Esko Hujanen
http://www.ebsolut.fi
--
View this message in context: http://drools.46999.n3.nabble.com/Drools-Expert-5-3-0-war-file-or-standal...
Sent from the Drools: User forum mailing list archive at Nabble.com.
13 years, 2 months
Where in DB does Guvnor store "description" of rules?
by Praveen
Hi,
Our application expects rule name and its description to be displayed in the
UI and both of
these are to be retrieved from DB.
We are aware that Guvnor stores rules in DB, not sure of the description
part.
If someone could throw light on how to get description/comments (that was
entered through Guvnor)
in UI would be great.
Initially we had the idea of parsing comments in drl.
However we saw that the description entered through Guvnor while writing a
rule does not show up in the generated source code.
TIA.
Regards,
Praveen.
--
View this message in context: http://drools.46999.n3.nabble.com/Where-in-DB-does-Guvnor-store-descripti...
Sent from the Drools: User forum mailing list archive at Nabble.com.
13 years, 2 months