[JBoss JIRA] Created: (JBRULES-1611) "from" CE is not supported within "forall" CE
by aldib (JIRA)
"from" CE is not supported within "forall" CE
---------------------------------------------
Key: JBRULES-1611
URL: http://jira.jboss.com/jira/browse/JBRULES-1611
Project: JBoss Drools
Issue Type: Bug
Security Level: Public (Everyone can see)
Components: Drl Parser/Builder
Affects Versions: 4.0.7
Reporter: aldib
Assigned To: Mark Proctor
The current parser is limiting the forall() CE, not allowing nested "from" CEs.
E.g. Given the classes:
ExpenseReport{
Collection<ExpenseDetails> expenseDetails
}
ExpenseDetails{ \
ExpenseReport document
ExpenseType expenseType
}
it is not possible to write the following rule:
rule "Do Not Process TAX"
when
$report: ExpenseReport($expenseDetails: expenseDetails)
forall ( ExpenseDetails( expenseType == ExpenseType.TAX ) from $expenseDetails )
then
System.out.println("################ It works ##################");
end
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
15 years, 8 months
[JBoss JIRA] Created: (JBRULES-1654) eval() Incorrectly Evaluating BigDecimal to False
by Andrew Frederico (JIRA)
eval() Incorrectly Evaluating BigDecimal to False
-------------------------------------------------
Key: JBRULES-1654
URL: http://jira.jboss.com/jira/browse/JBRULES-1654
Project: JBoss Drools
Issue Type: Bug
Security Level: Public (Everyone can see)
Components: Decision tables
Affects Versions: 4.0.7
Reporter: Andrew Frederico
Assigned To: Mark Proctor
Even when the condition of an eval() in the "where" block results in TRUE when used in normal code the rule does not fire directly because of the eval() statement.
My class definition:
class BuyOffer() {
private BigDecimal amount;
...
}
The getter from the class:
public BigDecimal getAmount() {
return amount;
}
Assuming that I've setAmount() to something non-zero earlier in the code, the line of code that evaluates to TRUE (verified by System.outing the result):
buyOffer.getAmount().compareTo(BigDecimal.ZERO) > 0
My eval() statement:
eval( buyOffer.getAmount().compareTo(BigDecimal.ZERO) > 0 )
With eval() in place the rule does NOT fire. When removed it DOES and the following line of code prints TRUE.
System.out.printf("buyOffer.getAmount().compareTo(BigDecimal.ZERO) > 0: %s\n", buyOffer.getAmount().compareTo(BigDecimal.ZERO) > 0);
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
15 years, 8 months
[JBoss JIRA] Created: (JBRULES-1023) Typing the parameter to be replace by DSL/DRL replacement
by christian bastin (JIRA)
Typing the parameter to be replace by DSL/DRL replacement
---------------------------------------------------------
Key: JBRULES-1023
URL: http://jira.jboss.com/jira/browse/JBRULES-1023
Project: JBoss Rules
Issue Type: Feature Request
Security Level: Public (Everyone can see)
Reporter: christian bastin
Assigned To: Mark Proctor
We have a very long DSL including more 150 différent lines (wich could be very similar). We have no posibility to be sure of the replacement operarted by the parsing. We often dicover problem that force us to move the order of the lines in the DSL. This is an simple example of what I think could be improved.
If you have a DSL
test {code} is {value}
this could replace this 2 rules in the DRL
rule "Rule-1"
when
test 10 is 10
then
> System.out.println("test 1 OK");
end
rule "Rule-1"
when
test 10 + 10 is 10
then
> System.out.println("test 1 OK");
end
I would like the ability to type the parameter of my DSL, for example with regular expression.
test {code|[0-9]+} is {value|[0-9]+}
so the only rule available for replacement should be the first rule ("Rule-1"). The other rule would not find a replacement and should be implemented in the DSL.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
15 years, 8 months