Web Service deploy out of memory
by Edgardo
Hi list,
I have developed a web service for deploy my rule package, this rule
package is in the BRMS, the source code of the web service class is:
public class ValidaLlamadaWS {
RuleAgent agent = RuleAgent.newRuleAgent("/brmsdeployedrules.properties");
RuleBase ruleBase = agent.getRuleBase();
StatelessSession session = ruleBase.newStatelessSession();
public Object[] ValidaLlamada(Integer cantsegundos){
Validaciones validaciones = new Validaciones();
validaciones.setCantsegundos(cantsegundos);
session.execute(validaciones);
return validaciones.getResult();
}
}
The BRMS run over JBoss AS 4.2.1.GA and the web service over Apache Tomcat
5.5 on the same machine, the rule base contain only 2 rules
The problem is that I need to call the web service more than 400.000
times, and with 1000 times, I obtain the Java Heap Exception.
If I monitoring my machine memory, this only increase between calls. And
the process that more memory expensive is java.exe (JBoss AS 4.2.1.GA).
The process javaw.exe (Apache Tomcat 5.5)also is expensive, but less than
java.exe
The question are:
How I can "dispose" the objects that I use?
Is correct this use for StatelessSession?
You are the experts, any other idea for implement my web service?
PD: sorry for my bad english.
Greetings
--
Edgardo Ibañez O.
17 years, 3 months
Salience type
by Yuri
I have the following dynamic salience:
salience ( -10000 / (c.size * t.size) )
which throws a ClassCastException when it is not a whole division.
In my case I dont really care about the decimals.
Any ideas?
thanks.
17 years, 3 months
RE: [rules-users] in 4.0.1 "this" required in nested accessors?
by Manukyan, Sergey
Also,
Just found,
In nested acessors the order has meaning?
f.e.
TestSupplier(this.testBusiness.statusActive == oldStatus) --> OK!
TestSupplier(oldStatus = this.testBusiness.statusActive) --> FAILED TO
COMPILE!
Bug ???
-Sergey
-----Original Message-----
From: rules-users-bounces(a)lists.jboss.org
[mailto:rules-users-bounces@lists.jboss.org] On Behalf Of Manukyan,
Sergey
Sent: Tuesday, September 04, 2007 2:44 PM
To: Rules Users List
Subject: [rules-users] in 4.0.1 "this" required in nested accessors?
Edson,
Didn't receive reply on my previous post.
Please take a look, below is the copy of the post:
---------------
I started using 4.0.1,
Regarding nested accessors, looks like they work, but they require to
put "this" at the beginning.
So rule
when
TestSupplier(testBusiness.statusActive == true) --> FAILS
When
TestSupplier(this.testBusiness.statusActive == true) --> OK!
It fails with the following exception:
org.drools.rule.InvalidRulePackage: Unable to determine the used
declarations : [Rule name=MY_RULE, agendaGroup=MAIN, salience=10,
no-loop=false]
at org.drools.rule.Package.checkValidity(Package.java:419)
Please confirm this to be a bug and then I will open JIRA for this, or
please let me know the reason behind this functionality,
Thanks,
-Sergey
**********************
** LEGAL DISCLAIMER **
**********************
This E-mail message and any attachments may contain
legally privileged, confidential or proprietary
information. If you are not the intended recipient(s),
or the employee or agent responsible for delivery of
this message to the intended recipient(s), you are
hereby notified that any dissemination, distribution
or copying of this E-mail message is strictly
prohibited. If you have received this message in
error, please immediately notify the sender and
delete this E-mail message from your computer.
_______________________________________________
rules-users mailing list
rules-users(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users
17 years, 3 months
PredicateConstraints and MVEL issue?
by Yuri
Consider the following rules:
rule (1)
when
a: Criteria(
$criteriaA : criteriaA,
$criteriaB : criteriaB )
b: Criteria(){
matchCriteriaA == true && criteriaA == $criteriaA
|| matchCriteriaB == true && criteriaB == $criteriaB
}
then
...
end
rule (2)
when
a: Criteria(
$criteriaA : criteriaA,
$criteriaB : criteriaB )
b: Criteria(){
eval(
matchCriteriaA == true && criteriaA == $criteriaA
|| matchCriteriaB == true && criteriaB == $criteriaB
)
}
then
...
end
I am seeing different behavior for the same test cases. I am basically inserting
"a" and "b" with matching criteriaA and criteriaB and I am testing different
combinations of matchCriteriaA and matchCriteriaB (i.e. F/F, F/T, T/F, T/T).
Results for rule (1):
F/F -> rule activated (incorrect)
T/F -> rule activated (correct)
F/T -> rule activated (correct)
Results for rule (2):
F/F -> rule activated (incorrect)
T/F -> rule activated (correct)
F/T -> rule activated (correct)
Any ideas?
17 years, 3 months
in 4.0.1 "this" required in nested accessors?
by Manukyan, Sergey
Edson,
Didn't receive reply on my previous post.
Please take a look, below is the copy of the post:
---------------
I started using 4.0.1,
Regarding nested accessors, looks like they work, but they require to
put "this" at the beginning.
So rule
when
TestSupplier(testBusiness.statusActive == true) --> FAILS
When
TestSupplier(this.testBusiness.statusActive == true) --> OK!
It fails with the following exception:
org.drools.rule.InvalidRulePackage: Unable to determine the used
declarations : [Rule name=MY_RULE, agendaGroup=MAIN, salience=10,
no-loop=false]
at org.drools.rule.Package.checkValidity(Package.java:419)
Please confirm this to be a bug and then I will open JIRA for this, or
please let me know the reason behind this functionality,
Thanks,
-Sergey
**********************
** LEGAL DISCLAIMER **
**********************
This E-mail message and any attachments may contain
legally privileged, confidential or proprietary
information. If you are not the intended recipient(s),
or the employee or agent responsible for delivery of
this message to the intended recipient(s), you are
hereby notified that any dissemination, distribution
or copying of this E-mail message is strictly
prohibited. If you have received this message in
error, please immediately notify the sender and
delete this E-mail message from your computer.
17 years, 3 months
Problem with existing drl and dsl from drools 3
by Paul Smith
Hi Guys,
I've decided to bite the bullet and try and move up to 4.01 but I'm having
trouble getting the rules to compile. I have the following drl
/*******************
Code type rules
********************/
package au.com.codeprotechnology.online.ejb3.logic.common
import au.com.codeprotechnology.online.bi.exception.ValidationError
import
au.com.codeprotechnology.online.ejb3.logic.constants.CodeTypeConstants
import au.com.codeprotechnology.online.persistence.ejb.core.CodeType
expander common.dsl
rule "Code type is mandatory"
when
The code types type is null or empty
then
Send the message that the code types type is mandatory
end
rule "Long name is mandatory"
when
The code types long name is null or empty
then
Send the message that the code types long name is mandatory
end
rule "Short name is mandatory"
when
The code types short name is null or empty
then
Send the message that the code types short name is mandatory
end
rule "Short name too long"
when
The short name for the code type is too long
then
Send the message that the code types short name is too long
end
rule "Sort order is mandatory"
when
The code types sort order is null or zero
then
Send the message that the code types sort order is mandatory
end
With the corresponding dsl
#Common domain specific language.
[when]The code types type=$obj : CodeType(val : codeType)
[when]The code types long name=$obj : CodeType(val : longName)
[when]The code types short name=$obj : CodeType(val : shortName)
[when]The short name for the code type is too long=$obj : CodeType(val :
shortName -> (val != null && val.trim().length() >
CodeTypeConstants.MAX_SHORT_NAME_LENGTH))
[when]The code types sort order=$obj : CodeType(val : sortOrder)
[when]The documentation text=$obj : Documentation(val : documentationText)
[when]The documentation type is null=$obj : Documentation(val : type -> (val
== null))
[when]is null or empty=eval(val == null || val.trim().length() == 0);
[when]is null or zero=eval(val == null || val.longValue() == 0);
[when]is not null=eval($obj != null);
[when]is not numeric=eval(!isNumeric(val));
[when]is not a valid expiry date=eval(!isValidExpiry(val));
[when]length is greater than {len}=eval(val.length() > {len});
[when]length is less than {len}=eval(val.length() < {len});
[then]Print the message '{msg}'=System.out.println("{msg}");
[then]Send the message that the code types type is
mandatory=$obj.addValidationError(new ValidationError(
CodeTypeConstants.MSG_KEY_CODE_TYPE_MANDATORY,
CodeTypeConstants.MSG_CODE_TYPE_MANDATORY));
[then]Send the message that the code types long name is
mandatory=$obj.addValidationError(new ValidationError(
CodeTypeConstants.MSG_KEY_LONG_NAME_MANDATORY,
CodeTypeConstants.MSG_LONG_NAME_MANDATORY));
[then]Send the message that the code types short name is
mandatory=$obj.addValidationError(new ValidationError(
CodeTypeConstants.MSG_KEY_SHORT_NAME_MANDATORY,
CodeTypeConstants.MSG_SHORT_NAME_MANDATORY));
[then]Send the message that the code types short name is too
long=$obj.addValidationError(new ValidationError(
CodeTypeConstants.MSG_KEY_SHORT_NAME_TOO_LONG,
CodeTypeConstants.MSG_SHORT_NAME_TOO_LONG));
[then]Send the message that the code types sort order is
mandatory=$obj.addValidationError(new ValidationError(
CodeTypeConstants.MSG_KEY_SORT_ORDER_MANDATORY,
CodeTypeConstants.MSG_SORT_ORDER_MANDATORY));
[then]Send the message that the documentation text is
mandatory=$obj.addValidationError(new ValidationError(
DocumentationConstants.MSG_KEY_TEXT_MANDATORY,
DocumentationConstants.MSG_TEXT_MANDATORY));
[then]Send the message that the documentation type is
mandatory=$obj.addValidationError(new ValidationError(
DocumentationConstants.MSG_KEY_TYPE_MANDATORY,
DocumentationConstants.MSG_TYPE_MANDATORY));
But I keep getting the following errors when trying to build the package
unknown:14:36 Unexpected token 'val'
unknown:14:60 Unexpected token ')'
unknown:14:61 Unexpected token '.'
unknown:14:71 mismatched token: [@106,457:458='==',<75>,14:71]; expecting
type THEN
unknown:23:36 Unexpected token 'val'
unknown:23:60 Unexpected token ')'
unknown:23:61 Unexpected token '.'
unknown:23:71 mismatched token: [@171,723:724='==',<75>,23:71]; expecting
type THEN
unknown:33:37 Unexpected token 'val'
unknown:33:61 Unexpected token ')'
unknown:33:62 Unexpected token '.'
unknown:33:72 mismatched token: [@236,995:996='==',<75>,33:72]; expecting
type THEN
unknown:53:37 Unexpected token 'val'
unknown:53:66 Unexpected token ')'
unknown:53:68 Unexpected token '=='
These are the errors from PackageBuilder. Used to work fine with 3 and I
can't see any drastic differences between this and your examples in the
documentation.
17 years, 3 months
new-bie problem
by Rajeev Dave
Hello all,
I am working on the excel driven rules application and have a small query. The app is for a mobile service provider. The following are the requirements.
The company has 3 plans(apart from a default plan) which a user can opt from while taking the connection. However if the user does not choose any one, company grants a default plan to the user.
Problem statement: I need to default to a plan using rules and not hardcode in my javacode. The rules should say that the user has not chosen any plan, hence grant him the default plan. I am not able to comeup with an excel sheet containing the rules.
Rgds,
rajeev
17 years, 3 months