[planner] taboo list question
by dmzpippo-drools@yahoo.it
Hi Geoffrey,
I'm
sorry but I have not had time to find a stable solution for
diversification, I must conclude my thesis by April and I have not
much time. For now I solved by calculating a value of penality in the move. But after graduation I will be happy to try to tackle the problem in a more efficient way :-)
Doing a bit of debugging I noticed that either do not exclude the right moves.
I try to explain better my problem. I have M vehicles and each has its own id (0, M-1). I have N customer and each of them has its own id (0,N-1). IDs are integer values.
A
move is uniquely identified by a triple of integers: the id of the
customer, the id of the source vehicle and the id of the target vehicle.
(Customer_id, source_route_id, destination_route_id)
when I make this move I would consider taboo all the moves that report the customer in the source vehicle.
If for example I have 5 vehicles and 20 customer a move could be:
(6,0,1)
so I would avoid all the moves of return, namely:
(6,1,0), (6,2,0), (6,3,0), (6,4,0);
I tried to do as you have suggested me (again if I understood correctly!)
public Collection <? extends Object> getTabuProperties () (
return Arrays. <Integer> asList (customer_id, source_route_id);
)
Only in this way excludes me all the moves that involve the customer and the vehicle source even if taken separately.
Ex: I esculde also draws (6,1,4) or
(7,0,3)
Thank you from now for all the help you gave me already.
regards,
Marco
14 years, 9 months
Usage Question
by Glenn Macgregor
Hi All,
I am in the process of evaluating Drools to use in a networks & systems management project. Some of the initial use cases are listed below.
Use Cases:
1. Simple single parameter thresholds with configurable warning and error levels.
2. Simple multi parameter thresholds from one host with configurable warning and error levels.
3. Complex multi parameter thresholds from multiple hosts with configurable warning and error levels.
4. Complex time based multi parameter thresholds from multiple hosts with configurable warning and error levels.
After reading about the Drools rules engine (Expert) and the CEP (Fusion) it seems at a glance that it would be very useful in this application. As I digging into use case 1 I am not sure Drools is actually going to fit the bill as first thought.
Imagine a small network with 300 hosts each of which is being polled for CPU data which can be massaged to produce an instantaneous CPU Utilization which I want to check against some threshold, which can be different for each host. I don't see creating 300 rules to handle this simple case as an ideal solution as I need to give control of the CPU Utilization threshold to the teams who own the hosts. Thinking about how to abstract that I imagine I could put the thresholds into a database and rebuild/reload the rules as necessary but as the thresholds could change often this seems like unnecessary overhead. I have moved on from that solution to the idea that a threshold is an attribute of the parameter as name and value are attributes. This allows me to attach the threshold value to the parameter update and potentially have a Drools rule something like (not a working rule):
rule "test rule"
when
$param : Parameter(name == someName) # comes from some map of params or something, not sure yet.
$param(value >= warningThreshold)
then
# Fire warning alert
end
Where value and warningThreshold are members of the Parameter object.
Having thought about this and discussed with some colleagues we can not impose a '>=' in the rule as some teams might what a different set of comparators. Moving on to these new requirements I thought we could have all the info encapsulated into the Parameter object as a set of functions:
* isInWarning
* isInError
rule "test rule"
when
$param : Parameter(name == someName) # comes from some map of params or something, not sure yet.
$param.isInWarning()
then
# Fire warning event
End
Questions:
* Is the above possible in Drools?
* What does Drools get me as my software is already doing all the calculation and comparison work?
* Is there a better way to handle this using Drools?
Thanks for the reply's
Glenn
14 years, 9 months
Flow Work Items - SOAP
by Swindells, Thomas
Does drools have a work item which is able to act as a client to a soap service?
Also what other work items dose flow support and where is it documented. In eclipse I just see work items for email and log but on the main drools flow page (http://jboss.org/drools/drools-flow.html) it mentions a whole list of work items (finding files, ftp, rest, rss etc) some of which are also mentioned in an old post here (http://blog.athico.com/2008/08/more-declarative-workflow.html) but I can't find any details anywhere about where to get them or how to use them.
Thanks,
Thomas
________________________________
**************************************************************************************
This message is confidential and intended only for the addressee. If you have received this message in error, please immediately notify the postmaster(a)nds.com and delete it from your system as well as any copies. The content of e-mails as well as traffic data may be monitored by NDS for employment and security purposes. To protect the environment please do not print this e-mail unless necessary.
NDS Limited. Registered Office: One London Road, Staines, Middlesex, TW18 4EX, United Kingdom. A company registered in England and Wales. Registered no. 3080780. VAT no. GB 603 8808 40-00
**************************************************************************************
________________________________
This message is confidential and intended only for the addressee. If you have received this message in error, please immediately notify the postmaster(a)nds.com and delete it from your system as well as any copies. The content of e-mails as well as traffic data may be monitored by NDS for employment and security purposes.
To protect the environment please do not print this e-mail unless necessary.
An NDS Group Limited company. www.nds.com
14 years, 9 months
Stumped by error in rule
by Tom.E.Murphy@wellsfargo.com
After all this time working with Drools 5.0.1, I thought I'd figured out all the ways my syntax could fail, but this one has me stumped.
Any help would be appreciated.
I have the following rule:
rule "RS6051.1.2_"
dialect "mvel"
when
Applicant ( $ApplicantNumber : ApplicantNumber )
not ( ScoreCard (name == "Context test", contextId == $ApplicantNumber) )
then
ScoreCard scoreCard = functions.getScoreCardManager().newScoreCard();
scoreCard.setName("Context test");
scoreCard.setContextId($ApplicantNumber);
insert(scoreCard);
end
I'm getting the following error on this rule during compilation:
Unable to create Field Extractor for 'ApplicantNumber' : [Rule name='RS6051.1.2_']
org.drools.RuntimeDroolsException: Field/method 'ApplicantNumber' not found for class 'com.wellsfargo.service.provider.sse.decisioning.x2009.Applicant'Unable to build expression for 'consequence': null '
And here is (part of) the Applicant class in question:
package com.wellsfargo.service.provider.sse.decisioning.x2009;
public class Applicant
{
public Short getApplicantNumber()
{
return applicantNumber ;
}
public void setApplicantNumber(Short applicantNumber)
{
this.applicantNumber = applicantNumber;
}
Short applicantNumber;
}
And This is (part of) the ScoreCard class:
public class ScoreCard
{
public void setName(String name) { this.name = name; }
public String getName() { return name; }
public int getContextId(){return contextId;}
public void setContextId(int id){contextId = id;}
private String name;
private int contextId;
}
Why am I getting this error?
Help!
Thanks
Tom Murphy
14 years, 9 months
Enum in Drools 4.0.7 don't work for me
by My tria
Hi all,
I've a problem with the enumeration (combo-drop down box) in Drools 4.0.7
BRMS.
I've do this steps:
--> Create an enumeration type:
'ChannelInputMessage.priority.hardcore' : ['Error=error',
'Warning=warning', 'Fatal=fatal']
--> Create the DSL and so invoce the enumeration:
[condition][MailChannelConfiguration]Per ogni messaggio di errore con
canale
mail=$mailChannelConfiguration:MailChannelConfiguration()
[condition][ChannelInputMessage]avente: = ChannelInputMessage()
[condition] - cliente {'customerValue'} = customer=="{'customerValue'}"
[condition] - processo {'processValue'} = process=="{'processValue'}"
[condition] - categoria {'categoryValue'} esempi business,it =
category=="{'categoryValue'}"
[condition] - priorita {priorityValue:ENUM:Priority} =
priority.hardcode == "{priorityValue}"
[consequence][MailChannelConfiguration]invia al destinatario:
{'recipient'} =
$mailChannelConfiguration.addRecipient("{'recipient'}");
--> The problem accours when I try to define the rule with the guided editor
http://n3.nabble.com/file/n196342/screen-rule.png
The editor appears without the Enumeration tab, but only write in the text
field the string "priorityValue:ENUM:Priority"
PLEASE HELP ME IT'S VERY IMPORTANT
THANKS IN ADVANCE
--
View this message in context: http://n3.nabble.com/Enum-in-Drools-4-0-7-don-t-work-for-me-tp196342p1963...
Sent from the Drools - User mailing list archive at Nabble.com.
14 years, 9 months
Configuring the target/language level when compiling drools.
by Brice Figureau
Hi
Is there a way to set the target level (ie jdk 1.5) when building a
rules package (especially with the drools-ant task)?
Browsing the source code, I found the drools.dialect.mvel.langLevel (and
same for java), but settings those in ant doesn't seem to do the trick:
building the rules under jdk1.6 produces 1.6 target classes which can't
be reloaded again with jdk1.5.
Thanks,
--
Brice Figureau
My Blog: http://www.masterzen.fr/
14 years, 9 months
Order process example description
by Hitoshi Ozawa
Would appreciate info on where I can find explanation of the order
process example. I've looked in the Rules Reference and Drool Flow and
it seems the explanation is not in there.
I'm not sure where the second window is being displayed from.
H.Ozawa
14 years, 9 months
Dynamic Rules
by Glenn Macgregor
Hi All,
Just getting started using Drools and I have a question about dynamic rules. I have written a simple application based on one of the tutorials.
Rule:
rule "basic rule"
when
Account($balance : balance < 100)
then
System.out.println("Account balance: " + $balance + " is less than 100");
end
This rule works fine in my test application but is there a way to replace the static 100 with a dynamic value like, AccountRulesConfig.lowBalance, basically testing against the value of another object rather than a static value?
Thanks
Glenn
14 years, 9 months
Executing on a arbitrarily complex object
by gazzaaa87
Hi all,
I am using a StatelessKnowledgeSession and therefore call the execute method
to invoke the rules engine. Having carried out a basic test, it would appear
that calling execute on an arbitrarily complex object does not insert child
objects, rather rules will only fire if they are based on the parent.
e.g. let's say you have a class called 'Father', which holds a collection of
'Child' objects. By calling session.execute(fatherObject) I need rules to
fire that use the Child pattern without having to loop through 'insert'ing
all the child elements manually.
Has anyone come across a way around this? Having originally posted on the
dev forum there were a few suggestions:
- You could use the "from" keyword but your rules wouldn't work on *any*
arbitrary object - but this could be overcome if you could identify a
suitable super-class to extend for your arbitrary objects.
- Have you considered using the "from" Conditional Element, which lets
you reason over components of a fact's collection-type element, without them
being inserted as facts. See the Drools Expert manual for details.
- One way it has been done in the past is to have some rule with a
higher salience take that "root" object and "explode" it into the children
objects (as deep as needed).
The only thing I managed to find was the use of a Batch Executor but you
have to set that up before calling execute and therefore it's still
effectively a manual process.
If only Drools used java annotations, it would be ideal to specify behaviour
similar to cascade with JPA.
Any help or pointers much appreciated!
Dan
--
View this message in context: http://n3.nabble.com/Executing-on-a-arbitrarily-complex-object-tp192130p1...
Sent from the Drools - User mailing list archive at Nabble.com.
14 years, 9 months