Guvnor WAR files build question
by chema
Hi all,
I'm quite new with Guvnor and i have to add some config files to it in order
to deploy the application in a server (security things and other custom
modules).
To do that I choosed to download the sources (Maven project from official
github) of Guvnor for the version 5.3.0.Final and I started to add the
things i needed. This way the operation could be done as a normal dev (all
application tests are run, etc...)
Here is my problem. Usually when you add a file (xml file in this case) in
the WEB-INF directory (I'm talking about the guvnor-webapp module and the
directory src/main/webapp/WEB-INF) and you run the build (Maven war plugin,
in this case i perform a clean install of the module
guvnor-distribution-wars) you'll find these files in the WEB-INF directory
of the war produced.
I have no errors, all the wars (wars for jboss versions 5.1, 6, 7 and tomcat
6) are generated, but my file is not in the WEB-INF directory of the war (in
fact no war produced has it).
As I'm scratching my head with this, I rolled back all the changes I made
and restarted the process only adding a test.xml file in the WEB-INF
directory and building Guvnor again. Same result...
I may be not understanding how it works or doing something wrong, but I'll
really appreciate all the help you can give me to resolve this simple (I
think it should be simple, but as I can't get over it...) issue.
Many thanks.
--
View this message in context: http://drools.46999.n3.nabble.com/Guvnor-WAR-files-build-question-tp38869...
Sent from the Drools: User forum mailing list archive at Nabble.com.
12 years, 7 months
mvel strict-mode not applied in drools 5.3.1.Final
by korgen
Hi folks,
In the process of upgrading from Java 1.6 to Java 1.7 (1.7.0_03 to be
precise) we updated Drools from 5.1.1 to 5.3.1 (as in 5.1.1 language level
1.7 is not supported).
However with Drools 5.3.1 the system property "drools.dialect.mvel.strict"
seems not to be applied all the time. I know this sounds fishy, but this is
the behaviour:
In a (junit based) test we create the knowledgebase by loading multiple drl
files. Each of them has the dialect 'mvel' set in its beginning.
In our @BeforeClass of the test we do a:
System.setProperty("drools.dialect.mvel.strict", "false");
and I also tried using a KnowledgeBuilderConfiguration with the appropriate
settings.
But still sometimes the test fails with a "unable to resolve method using
strict-mode..." message. I say sometime because running the test multiple
times via maven "mvn -Dtest=ClassicDroolsTest test" sometimes produces
failure, sometimes produces success.
It might by noteworthy that the method called in the test expects two
parameters of type Double, but as it seems Drools is not seeing the
covariant return type of the class which is actually used (the abstract base
method has return type Object, the concrete method has return type Double).
I tried to reproduce the issue with a simpler test setup to be able to post
it here but did not succeed.
I also applied the patch
https://github.com/droolsjbpm/drools/commit/1c20018abeef8bee86f896ffff794...
(comming from https://issues.jboss.org/browse/JBRULES-3163) to the Drools
5.1.1 sources, compiled them myself and everything works like a charm with
it. However I cannot use this unofficial work around as I can't (and don't
want) use a patched version of Drools in my environment.
Also when I compile & run my sources with jdk 1.6.0_31 everything is fine.
I'd really appreciate any help on this topic as I couldn't find any hints on
this behaviour in the release notes from Drools versions > 5.1.1
Thanks
Joerg
--
View this message in context: http://drools.46999.n3.nabble.com/mvel-strict-mode-not-applied-in-drools-...
Sent from the Drools: User forum mailing list archive at Nabble.com.
12 years, 7 months
Usings joins in decision tables
by sumatheja
Hi All,
I'm new to using decision tables. I'm trying to create a join in
the condition column like
when
Header($a:id)
SubHeader($b:id==$a)
How to achieve this in decision tables. Any help will be appreciated.
--
cheers
12 years, 7 months
[rules user] different behavior on double type
by Zeke
Hi, guys:
I am using Drools 4.0.7. I find a strange behavior. When my LHS is
"Message( varDouble == 99.9 )" and "varDouble" equals "new Double(99.9)",
the condition is true. But when my LHS is "Message( types.doubleType ==
99.9 )" and the "doubleType" field is also equal to "new Double(99.9)", the
condition is false. I debug the code, and find that:
When the LHS is "Message( varDouble == 99.9 )", the logic will handle the
literal 99.9 as *Double.valueOf( “99.9” )*, and the comparison is between *(new
Double(99.9)).doubleValue(*) and *Double.valueOf( “99.9” ).doubleValue()*,
When the LHS is "Message( types.doubleType == 99.9 )", the logic is
different from above. The comparison is between *new BigDecimal((Double)
99.9, MathContext.DECIMAL64)* (which double value is 99.90000000000001) and
*new BigDecimal(“99.9”, MathContext.DECIMAL64)* (which double value is
99.9).
I think we need make things consistent. "varDouble" and
"types.doubleType" are of the same type and value. It doesn't make sense to
have different behavior just because of one field is nesting while the
other is not. I know Drools is using MVEL to evaluate the condition. But I
am not sure it is a MVEL bug or Drools uses MVEL wrong. It will be much
appreciated if you can give me any comments!
12 years, 7 months
Possible "memory leak" in 5.3 with update?
by thenim
I'm using a stateful session (in a slightly odd way - obviously this is the
problem), I have a stream of "messages" coming into my system and each
message one of a set of unique keys. Now my rules test various attibutes of
this message and makes some changes (to the messages) etc. (the rules aren't
the problem here - infact in my test case, I have no rules).
I tested the "normal" approach where each message is inserted and the fact
handle retained, and subsequently after firing, the handle is removed (yes
this sounds like a good case for Fusion, except for the making changes bit.)
I noticed that I could get better throughput, if took the following
approach:
1. On the first time the unique key is detected, the handle is saved
2. Then each time a message with that key is received, "update" is called
with the handle for that key
Now, the important thing here is that the "fact" is a *different* object not
an updated version of the original associated with the handle.
Now with this approach, I was getting better numbers, however every so often
there would be a "pause", with GC details being printed out, I see
immediately that it's sitting there doing full GC's very frequently, and
switching to the concurrent collector, I can see mode failures regularly
(i.e. full GCs). With a low message rate, I didn't notice it initially, but
with higher message rates, this is a serious issue.
It appears that the approach I've taken highlights a "leak". I wanted to
find out if others have encountered this before digging around in the code,
for the moment, I will "fix" my approach so that I update the "same object"
- but is "update" not meant to be used this way?
Thanks,
Nim
--
View this message in context: http://drools.46999.n3.nabble.com/Possible-memory-leak-in-5-3-with-update...
Sent from the Drools: User forum mailing list archive at Nabble.com.
12 years, 7 months
need design suggestion
by Joe Zendle
Hi,
Trying to build net mgmt system but having problem with basic cause/effect
(mostly not understanding the engine).
I have a a Port object that contains a Card object. They both have separate
states (up or down). I want to have a Port go to down state if the
containing Card goes to down state - very basic now until i get the feel of
it.
The state of the Card changes if a Notification is injected into the
session (at least this is my understanding)
Here are my rules:
rule "card going down"
when
$card : Card($name : name , state == State.UP)
$notif : Notification( id == $name, type == NotificationType.CARD ,
state == State.DOWN )
then
System.out.println(" got notification for card down " + $card );
modify($card) {
setState(State.DOWN);
}
retract($notif);
end
// is the following rule correct??
rule "port going down"
when
$port : Port($name : name , state == State.UP, $card : card)
Card ( state == State.DOWN) from $card
then
System.out.println(" port down because card is down port: " + $port +
" card: " + $card );
modify($port) {
setState(State.DOWN);
}
end
Here is the test case in a nutshell:
Port port1 = new Port();
Port port2 = new Port();
port1.setName("port1");
port2.setName("port2");
Card card1 = new Card();
card1.setName("port1 card1")
port1.setCard(card1);
// stateful session
ksession.insert(port1);
ksession.insert(port2);
ksession.insert(card1);
System.out.println(" firing rules");
new Thread(new Runnable() {
public void run() {
ksession.fireUntilHalt();
}
}).start();
System.out.println("*** injecting notification down");
Notification notif = new Notification();
notif.setType(NotificationType.CARD);
notif.setState(State.DOWN);
notif.setId("port1 card1");
FactHandle notifHandle = ksession.insert(notif);
ksession.halt();
ksession.dispose()
I would expect the card down notification to cause the port to do down by
the second rule above but it does not fire.
Here is output
card1: Card [state=UP, name=port1 card1,
ne=org.plugtree.examples.model.NE@1e2670b]
OBJECT ASSERTED value:Port [state=UP, name=port1, card=Card [state=UP,
name=port1 card1, ne=org.plugtree.examples.model.NE@1e2670b]] factId: 1
OBJECT ASSERTED value:Port [state=UP, name=port2, card=Card [state=UP,
name=port1 card1, ne=org.plugtree.examples.model.NE@1e2670b]] factId: 3
OBJECT ASSERTED value:Card [state=UP, name=port1 card1,
ne=org.plugtree.examples.model.NE@1e2670b] factId: 5
firing rules
3
*** injecting notification down
ACTIVATION CREATED rule:card going down activationId:card going down [6, 5]
declarations: $name=port1 card1(5);
$notif=org.plugtree.examples.model.Notification@4a9a7d(6); $card=Card
[state=UP, name=port1 card1, ne=org.plugtree.examples.model.NE@1e2670b](5)
OBJECT ASSERTED value:org.plugtree.examples.model.Notification@4a9a7dfactId: 6
BEFORE ACTIVATION FIRED rule:card going down activationId:card going down
[6, 5] declarations: $name=port1 card1(5);
$notif=org.plugtree.examples.model.Notification@4a9a7d(6); $card=Card
[state=UP, name=port1 card1, ne=org.plugtree.examples.model.NE@1e2670b](5)
got notification for card down Card [state=UP, name=port1 card1,
ne=org.plugtree.examples.model.NE@1e2670b]
OBJECT MODIFIED value:Card [state=DOWN, name=port1 card1,
ne=org.plugtree.examples.model.NE@1e2670b] factId: 5
OBJECT RETRACTED value:org.plugtree.examples.model.Notification@4a9a7dfactId: 6
AFTER ACTIVATION FIRED rule:card going down activationId:card going down
[-1, 5] declarations: $name=port1 card1(5); $card=Card [state=DOWN,
name=port1 card1, ne=org.plugtree.examples.model.NE@1e2670b](5)
Is the second rule written incorrectly? or do i have a gap in my
expectations of how the engine should work (or both)
Thanks in advance,
Joe.
12 years, 7 months
Need drl help for arraylist
by arup
Hi all,
i need to write a rule to compare a String with a list of Strings (say
String[] nameList).
Person()
{
String name;
}
Values()
{
String[] nameList = new String[]{ "abc", "abcdef" }
}
how can i write the rule??
when
name of the person is same as any names in the nameList
then
do .....
i have tried different rule but still not able to get the desired output.
Thanks a lot in advance.... :) :) :)
--
View this message in context: http://drools.46999.n3.nabble.com/Need-drl-help-for-arraylist-tp3883683p3...
Sent from the Drools: User forum mailing list archive at Nabble.com.
12 years, 7 months