5.3 ruleflow question
by St. Lawrence, Zachary
I am trying to use ruleflows to test a different approach to a problem but I am having problems finding the right implementing jars for use in my maven imports.
In 5.2 the needed builder classes were in jbpm-flow-builder. But 5.3 doesn't have that package. How does one use ruleflows in the most recent release of drools?
Zack
14 years, 1 month
DSL Build Problem
by John Peterson
I'm looking for a little help on a problem we can't figure out with some DSL errors during a build. We're working with version 5.3.0.Final on RSA 7.5.5.
The offending line of DSL is on the rule is:
Write qualifyingPoints on Result as $var01 * $var02
$var01 and $var02 are variables set in the WHEN part of this rule.
The offending line of code is translating to:
modify (Result){qualifyingPoints = $var01 * $var02};
When I execute the program that calls this rule, if fails during the build process with the following:
Unable to Analyse Expression @Modify with (Result){qualifyingPoints = $var01 * $var02 };
[Error: java/lang/String.isEmpty()Z]
[Near : {... @Modify with (Result){qualifyingPt ....}]
^
[Line: 1, Column: 9] : [Rule name=Qualifying Points rule 1']
If I modify the code to use an assignment and update instead of modify, it will build without an error:
Result.setQualifyingPoints( $var01 * $var02 );update (Result);
Note that we only see this behavior on RSA. We do not see it on Eclipse (but we need to use RSA).
I didn't find anything online so I thought I'd check to see if this is something someone has seen before.
Thanks!
14 years, 1 month
Can I insert a fact from within a drl function?
by Shur, Bob
It seems I am unable to insert a new fact from within a drl function. I tried this:
////////////////////////
package com.sample
declare Dummy
end
function void init() {
insert(new Dummy()); // Doesn't compile
}
rule "init"
salience 999
when
then
init();
insert(new Dummy()); // Compiles
end
////////////////////////
Is the above supposed to work?
14 years, 1 month
setting different value in consequence ( RHS part) based on a conditional check
by vadlam
Hi,
we have an existing BRL rule in Guvnor whereby we set the value of some
fields in RHS based on some value checks in the condition part. we have
created several of these rules already in a previous release.
In the next release, we have new requirements to set the value of an
existing field in consequence to be of 2 different values based on a
specific conditional evaluation. the rest of the rule remains the same.
to clarify,
when
samplefact1( status== "active" , state=="CA" )
then
Response fact0= new Response();
fact0.setField1( "Y" );
fact0.setName( "something " );
insert(fact0 );
end
we now have to change this to set Field1 value to Y or N based on some
updated condition for status field.
lets say if status=="active" , Field1 has to be Y, but when status=closed,
then Field1 has to be N
Please keep in mind that the rest of the rule remains the same.
is there a way to set the value of Field1 to be Y or N within the
consequence part of same rule without having to create another rule .
will the use of functions or variables be of any help in this case?
--
View this message in context: http://drools.46999.n3.nabble.com/setting-different-value-in-consequence-...
Sent from the Drools: User forum mailing list archive at Nabble.com.
14 years, 1 month
Problem splitting drl file into two files
by Shur, Bob
How do I declare a function in one drl file and call it from another drl file, without having the Eclipse plug-in flag the call as an error?
Eclipse complains that the function is undefined and puts a red X on the call.
Other than the red X, everything seems to work. Is there some equivalent of "extern" I can use to make Eclipse happy?
14 years, 1 month
How to write rules in two fact's fields?
by shanmuga
Hi,
I want to know, how to write rules in two fact's fields?
I used two facts, it will take AND condition or OR condition in between the
two facts.
Please check my code....
package Project
import com.sample.Person;
import com.sample.Price;
rule "rule_Name"
when
per:*Person*(50 <= age < 100, 10000 <= income < 50000, occupation
== "Business", category == "Military", location == "Bangalore", custype ==
"Individual")
pri:*Price*((20 <= price < 30) || price == 1)
then
System.out.println("Success");
end
The both fact values are satisfy means, what is the output?
I got output, even the *Price* fact's value is wrong. (price == 100)
Please slove my problem........!!!!
--
View this message in context: http://drools.46999.n3.nabble.com/How-to-write-rules-in-two-fact-s-fields...
Sent from the Drools: User forum mailing list archive at Nabble.com.
14 years, 1 month