PlanningVariables are sometimes null
by Michiel Vermandel
Hi,
I've got an planningEntity with two planningVariables.
For both variables I build a list of objects.
While solving, it seems that the planningEntity objects are sometimes called without setting the planning variables.
When I read an attribute of such a variable in a rule I get a NPE, ofcourse.
Is it possible to always have the planningsvariables to be set before executing a rule?
Or am I missing the obvious?
Thanks,
Michiel
-----------------
http://www.codessentials.com - Your essential software, for free!
Follow us at http://twitter.com/#!/Codessentials
13 years, 7 months
rules not being reconsidered after modify
by wichtl
Hi,
I'm new to using Drools and its probably just a problem with me
understanding how this works, but I've tried everything i can think of, so I
come to you in hope for some help!
I have a set of rules which modify an object in the RHS and another set of
Rules that should be fireing after the modification of the object.
Rule modifying the Object:
rule "Wenn der BMI des Patienten >= 18.5 und < 25 ist, dann gehört der
Patient der Kategorie 'Normalgewicht' an und hat ein 'durchschnittliches'
Risiko für Begleiterkrankungen des Übergewichts"
when
MessdatenVonPatient($patient : patient && (getMessdaten().getBmi() >=
18.5) && (getMessdaten().getBmi() < 25))
$krankheitsbildVonPatient : KrankheitsbildVonPatient(patient == $patient
&& $krankheitsbild : krankheitsbild)
then
modify($krankheitsbild){setAdipositasGrad("Normalgewicht"),
setRisikoBegleiterkrankungGrad(1)
}
end
Rule that should fire after the modification:
rule "Wenn Patient der Kategorie 'Normalgewicht' angehoert, dann werden
folgende Maßnahmen vorgeschlagen"
when
KrankheitsbildVonPatient($patient : patient, krankheitsbild.adipositasGrad
== "Normalgewicht")
then
System.out.println("Some Text");
end
Also I have encountered problems (application freezes) when trying to modify
the "$krankheitsbildVonPatient" object in the RHS. And I still don't
understand why it did freeze and why modifying "$krankheitsbild" does not.
Heres my datamodel if needed:
http://drools.46999.n3.nabble.com/file/n4019463/dataModel.drl dataModel.drl
Best Regards,
wichtl
--
View this message in context: http://drools.46999.n3.nabble.com/rules-not-being-reconsidered-after-modi...
Sent from the Drools: User forum mailing list archive at Nabble.com.
13 years, 7 months
Job Opportunity - Jboss, Drools, Java Architecht/Consultant
by Pamela McGrath
I have a job opportunity available for a technology professional experienced in java, jboss and drools. This is a great opportunity and I wanted to extend it to this community. I have included some information regarding the job, if you have anymore questions, are interested, or know someone who may be interested in this opportunity please contact me at pamela(a)ttechsolutions.net
Job Description
Java Technology professionals develop applications using Java technology, a bundle of related technologies from Sun Microsystems that allow for developing and running operating system-independent programs written in Java programming language. This role provides opportunity to further develop Drools skills.
Key responsibilities may include:
- Lead the technical design process by participating in the analysis of technical application requirements
- Guide the client through key architecture design decisions
- Provide recommendations on application and architecture for performance and scalability
- Conduct analyses that will identify functional requirements and technical specifications as related to people, processes and technology
- Implementing the technical infrastructure
- Provide oversight and support client technical directors in the integration of technical and application components
- Executing conversion plans and documenting possible improvements; identifying disruptions in the processes
- Lead the technical team
Basic Qualifications
* 5 years Java development experience
* 6 months of DROOLS experience
* 3 months of DROOLS Planner experience
Professional Skill Requirements
* Architecture design experience
* Tech lead experience tech lead experience
* Federal government / large corporation experience
* Ability to work as a team member
* Collaboration skills
* Ability to work creatively and analytically in a problem-solving environment
* Desire to work in an information systems environment
* Excellent oral and written communication skills
* Flexibility
* Time management skills
Pamela McGrath
Operations Coordinator | pamela(a)ttechsolutions.net<mailto:pamela@ttechsolutions.net>
T-Tech Solutions | 1779 W. Big Beaver Rd | Troy, MI 48084
(p) 248-616-9600 | (f) 248-928-0981 | http://www.ttechsolutions.net<http://www.ttechsolutions.net/>
13 years, 7 months
enabled attribute behavior (possible bug?)
by Philipp Herzig
Dear developers,
I've stumbled over another nullpointer exception when using the
enabled attribute in conjunction with deleting and adding rules to the
kbase.
For my test I have only one simple rule
rule 'newUser'
enabled(!RuleEngineConf.LOAD)
when
$evt : EventObject(type=='new_user') from entry-point eventstream
then
updateApi.createPlayer($evt.getPlayerid(), true, $evt.getId());
retract($evt);
Not I execute the following sequence
1. setting LOAD=false
2. insert a "new_user" event (works as expected, RHS called)
3. setting LOAD=true
4. insert another "new_user" event (works as expected, RHS NOT called)
5. setting LOAD=false
6. insert another "new_user" event (works as expected, RHS called,
which ends up having two new entities in my entity provider)
7. delete the "newUser" rule; ends up with the following stacktrace
java.lang.NullPointerException
at org.drools.reteoo.RuleTerminalNode$RTNCleanupAdapter.cleanUp(RuleTerminalNode.java:514)
at org.drools.reteoo.BetaNode.doRemove(BetaNode.java:458)
at org.drools.common.BaseNode.remove(BaseNode.java:109)
at org.drools.reteoo.RuleTerminalNode.doRemove(RuleTerminalNode.java:358)
at org.drools.common.BaseNode.remove(BaseNode.java:109)
at org.drools.reteoo.ReteooBuilder.removeRule(ReteooBuilder.java:261)
at org.drools.reteoo.ReteooRuleBase.removeRule(ReteooRuleBase.java:459)
at org.drools.common.AbstractRuleBase.removeRule(AbstractRuleBase.java:1107)
at org.drools.common.AbstractRuleBase.removeRule(AbstractRuleBase.java:1085)
at org.drools.impl.KnowledgeBaseImpl.removeRule(KnowledgeBaseImpl.java:208)
8. adding the rule again is followed by stacktrace
java.lang.NullPointerException
at org.drools.reteoo.ReteooBuilder.removeRule(ReteooBuilder.java:259)
at org.drools.reteoo.ReteooRuleBase.removeRule(ReteooRuleBase.java:459)
at org.drools.common.AbstractRuleBase.removeRule(AbstractRuleBase.java:1107)
at org.drools.common.AbstractRuleBase.mergePackage(AbstractRuleBase.java:851)
at org.drools.common.AbstractRuleBase.addPackages(AbstractRuleBase.java:610)
at org.drools.reteoo.ReteooRuleBase.addPackages(ReteooRuleBase.java:472)
at org.drools.impl.KnowledgeBaseImpl.addKnowledgePackages(KnowledgeBaseImpl.java:150)
However, when I omit step 4., i.e., leaving no orphan event in the WM,
everything works fine, so obviously the ignored event is causing the
exception somehow, i.e., the object retrieved from the activation is
null (the clean up method seems to pickup the activation from the
leftTuple which is null)
Maybe I dont understand it correctly, then I would be happy if someone
explains the proper usage.
Thanks a lot in advance,
Philipp
13 years, 7 months
unable to resolve method using strict-mode
by larryc
Hello. We are attempting to migrate old 5.0.0 Guvnor rules to BRMS version
5.3. We keep running into variations of the following error:
[Error: unable to resolve method using strict-mode:
org.drools.spi.KnowledgeHelper.request()]
[Near : {... .addFieldToDocument(request, "ALL", "COVG_SR22_FEE ....}]
^ [Line: 5, Column: 37]
I've seen similar postings concerning "unable to resolve method..." but we
still haven't been able to figure out what's wrong. Here is the actual rule
from 5.0.0.
rule "VA SR22 Amount"
no-loop
ruleflow-group "default"
dialect "mvel"
when
request : FormRequest(
payload.policy.drivers != ""
&& != ( null ),
driver :
payload.policy.drivers.driver != "" && != ( null ),
payload.policy.ratingState
== "VA" )
drivers : ArrayList()
from collect( Driver( key != "",requiresSR22=="true") from driver)
then
int size = drivers.size();
for(int i =0; i < size; i++){
Driver dvr = drivers.get(i);
int drvNbr =
Integer.parseInt(dvr.getKey().substring(6));
DocumentHelper.addFieldToDocument(request, "ALL",
"COVG_SR22_FEE_AMT","$0.00");
}
End
Any help would be appreciated.
Thanks! --Larry
--
View this message in context: http://drools.46999.n3.nabble.com/unable-to-resolve-method-using-strict-m...
Sent from the Drools: User forum mailing list archive at Nabble.com.
13 years, 7 months
Extracting data from strings(regular expression)
by abing19881226
Hi:
I am trying to match a string to my regular expression and then capture
certain groups from the string.
I know previously there is no such feature , but I am just wondering if
there is one now?
Basically , what am trying to do is, insert strings into the session, and
carry out the reasoning to see if matches a certain regular expression.
In JAVA I did it as this:
public double parsingZ4_Ph_Reach(String line){
String regx="3240, Z4 Ph. Reach, .*, (.*), ohm, .*, .*,
.*";
Pattern
p=Pattern.compile(regx,Pattern.CASE_INSENSITIVE);
Matcher m =p.matcher(line);
if(m.matches()){
return Double.parseDouble(m.group(1));
}
return 0;
}
The purpose is to extract the data in the strings using drools.
Could you please give me some idea I I could do that in Drools?
Many thx.
--
View this message in context: http://drools.46999.n3.nabble.com/Extracting-data-from-strings-regular-ex...
Sent from the Drools: User forum mailing list archive at Nabble.com.
13 years, 7 months