[
https://issues.jboss.org/browse/DROOLS-3972?page=com.atlassian.jira.plugi...
]
Almas Toimbekov updated DROOLS-3972:
------------------------------------
Steps to Reproduce:
{code:java}
rule "Rule 1"
salience 30
when
then
Resource resource1 = new Resource();
resource1.setName("Resource 1");
resource1.setAmount("5");
insert(resource1);
System.out.println("First");
end
rule "Rule 2"
salience 20
//no-loop - next rule fires if use 'update()' instead
when
$resource1: Resource(name == "Resource 1")
then
modify($resource1) {setAmount("20")};
// update($resource1);
System.out.println("Second");
end
rule "Rule 3"
salience 30
when
$resource1: Resource(name == "Resource 1", Double.parseDouble(amount) ==
"20")
// - interesting that the line below fires this rule
// $resource1: Resource(name == "Resource 1",
amount.startsWith("20"))
then
System.out.println("Rule is fired"); //doesn't fire
end
{code}
was:
rule "Rule 1"
salience 30
when
then
Resource resource1 = new Resource();
resource1.setName("Resource 1");
resource1.setAmount("5");
insert(resource1);
System.out.println("First");
end
rule "Rule 2"
salience 20
//no-loop - next rule fires if use 'update()' instead
when
$resource1: Resource(name == "Resource 1")
then
modify($resource1) {setAmount("20")};
// update($resource1);
System.out.println("Second");
end
rule "Rule 3"
salience 30
when
$resource1: Resource(name == "Resource 1", Double.parseDouble(amount) ==
"20")
// - interesting that the line below fires this rule
// $resource1: Resource(name == "Resource 1",
amount.startsWith("20"))
then
System.out.println("Rule is fired"); //doesn't fire
end
Evaluation of facts hasn't been affected by 'modify()'
when parsing String to Double
-------------------------------------------------------------------------------------
Key: DROOLS-3972
URL:
https://issues.jboss.org/browse/DROOLS-3972
Project: Drools
Issue Type: Bug
Components: executable model
Affects Versions: 7.20.0.Final
Environment: Ubuntu
Reporter: Almas Toimbekov
Assignee: Luca Molteni
Priority: Major
Labels: double, evaluation, execution, parse
When I modify amount in an example below from 5 to 20 (both are Strings) and then try to
evaluate this fact parsing it to Double - the third rule doesn't fire. But it fires
when use 'update()' instead of 'modify() {}'
--
This message was sent by Atlassian Jira
(v7.12.1#712002)