RuntimeException "cannot invoke method" ArrayIndexOutOfBoundsException in Drools expert 5.5
by aleste
I've found a problem (probably a bug in mvel) running drools expert 5.5.
The MessageSourceElement constructor uses variable arguments:
public MessageSourceElement(Enum<?> enumerationElement, Object...
parameters) {
My drl contains a method with consequence:
then
insert (new
MessageSourceElement(ValidationException.MESSAGE_LIST.USER_CANT_OVERRIDE_THEMSELVES,
new Object[]{}))
end
If I manually create the array of objects and pass it to the constructor it
works correctly, but if I try to use variable parameters:
insert (new
MessageSourceElement(ValidationException.MESSAGE_LIST.USER_CANT_OVERRIDE_THEMSELVES))
insert (new
MessageSourceElement(ValidationException.MESSAGE_LIST.USER_CANT_OVERRIDE_THEMSELVES,
something, somethingElse))
I experince a very strange behavior: The first time the rule executes
properly, but any subsequent execution fails with RuntimeException "cannot
invoke method" ArrayIndexOutOfBoundsException 1
This happens because the second time mvel tries to call the two parameters
constructor (Enum, Object[]) no matter what the real constructor we are
trying to use (Enum), (Enum, SomeObject, SomeAnotherObject) and fails when
trying to extract the parameters by reflection.
I don't know if this is a known bug or if it should be reported, I hope it
will save some time someone.
--
View this message in context: http://drools.46999.n3.nabble.com/RuntimeException-cannot-invoke-method-A...
Sent from the Drools: User forum mailing list archive at Nabble.com.
12 years, 9 months
[drools-planner] please advice on IntConstraintOccurrence weight
by Michiel Vermandel
Hi,
(using drools-planner 5.5.0.Final)
I'm struggling with assigning weights to IntConstraintOccurrence in a rule's LHS.
If I assign different weights for different rules (because we think one rule is more important than an other) our end result is far worse than when we assign all equal weights.
I do not look at the total value of hard and soft score but at the number of violations.
I can imagine that the planner can evolve much easier to a better solution with all weights being the same because if not then "transient" moves will be made impossible to take.
But how should we then implement importance in rules?
Thanks
-----------------
http://www.codessentials.com - Your essential software, for free!
Follow us at http://twitter.com/#!/Codessentials
12 years, 9 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.
12 years, 9 months
Url Resource Guvnor connection + ProtocolException
by abhinay_agarwal
Hey,
I am trying to reach my guvnor repository using a very simple block of code
UrlResource urlResource = new UrlResource(url);
urlResource.setBasicAuthentication("enabled");
urlResource.setUsername("admin");
urlResource.setPassword("admin");
kbuilder.add(urlResource, ResourceType.PKG);
Now, this code works fine on standalone, but as soon as the code is deployed
with the application, it throws this exception:
*java.net.ProtocolException: Server redirected too many times (20)*
I know there is some problem with server side coding, but I am not able to
get it.
I guess, when I am trying to access the guvnor link through my application,
it gets into an infinite redirection and not able to come out from it.
Might be the Authenticator class of java.net is called and
getPasswordAuthentication() fails, but since I am not an expertise in this
locale so facing issue to resolve it.
Any help is welcome.
Regards,
Abhinay
--
View this message in context: http://drools.46999.n3.nabble.com/Url-Resource-Guvnor-connection-Protocol...
Sent from the Drools: User forum mailing list archive at Nabble.com.
12 years, 9 months
Knowledge base Import/Export?
by gilbertoy
Good afternoon everyone,
Since I am inexperienced on using Drools, I would like to ask an
information:
There is a way to export and import rules, variables and such ? I would like
to try using Drools Guvnor validations on another software knowledge base,
but for this I would have to implement a way to both programs communicate
with each other.
There is a something like that already implemented on Drools or it would be
necessary to create a way from scratch?
Any information will be helpful and appreciated.
Thanks in advance!
Yours sincerely,
Gilberto.
--
View this message in context: http://drools.46999.n3.nabble.com/Knowledge-base-Import-Export-tp4024151....
Sent from the Drools: User forum mailing list archive at Nabble.com.
12 years, 9 months
Setting a value in LHS
by stephen.masters
Hi folks,
Is there a decent way to set a value in the LHS of a rule so that it's available in the RHS?
Reason being I have a DSL driving the guided rules editor which will pluck out the value of a field, where the name of that field is driven by a drop down menu enumeration.
A change I now have would be a lot easier if I could assign a string to a variable in the LHS, which could be read by the RHS. Otherwise I might need to extend the RHS DSLs to include the same enumeration as the LHS. Which looks a bit redundant for a business user wondering why the need to write the same thing twice.
Any thoughts?
Steve
Sent from Samsung Mobile
12 years, 9 months
Separate selectable drl files in drools kbase.. Or agenda groups
by Ramon Buckland
Hi,
I am using a Stateless Knowledge session backed behind a web rest api.
The rest api is provided by spring Mvc, so I have a stateless ksession
injected in.
As it is stateless, I have found it difficult to use agenda groups to
meet my need. And have a question to how I set this up.
My task.
In short, I have 10 or so set up rules (init rules), then a 300 odd
(work) rules, then I need to fire a few (5) (finalisation) rules.
They need to be processed in that order. If I were using stateful I
see how an agenda group solves that need.. In the calling java that is
nice. setFocus().. But stateless blocks that api.
So I have attempted with auto-focus..
In the DRL (from XLS) however getting the agenda group settings right
has been a small 'mare. Suffice to say I haven't got it working.
My options:
1. get agenda groups working.
2. split the three groups into 3 DRL files. and execute in sequence
each one using a different ksession for each.
--- on 1.
How would I construct the flow.. .. Do I use three separate auto focus
rules , one for each a.group and set a salience ( I don think
salience helps here ) ? How do I guarantee to stack the focus using
auto-focus to follow my ordering?
-- on 2.
Can I create a separate ksession for each DRL file (injecting them in
from spring).
--
Thoughts ? Am I solving right ?
Many thanks. Ramon
12 years, 9 months