[
https://issues.jboss.org/browse/DROOLS-1481?page=com.atlassian.jira.plugi...
]
Edson Tirelli updated DROOLS-1481:
----------------------------------
Description:
Function signatures as of now are only validated in runtime. We can improve it to add
static validation as well. For instance, in the expression:
{code}"$"+ (if Payment < 1000 then string(Payment) else
(substring(string(Payment),1,1) + "," +
substring(string(decimal(Payment,2),2)))){code}
In runtime I get:
{quote}Unable to find function 'string( class java.math.BigDecimal, class
java.math.BigDecimal )'{quote}
Because of:
{code}...string(decimal(Payment,2),2)...{code}
Instead of (see the misplaced parenthesis):
{code}...string(decimal(Payment,2)),2...{code}
I think we can also improve the error message to say:
{quote}Unable to find function 'string( number, number )'{quote}
was:
Function signatures as of now are only validated in runtime. We can improve it to add
static validation as well. For instance, in the expression:
"$"+ (if Payment < 1000 then string(Payment) else
(substring(string(Payment),1,1) + "," +
substring(string(decimal(Payment,2),2))))
In runtime I get:
Unable to find function 'string( class java.math.BigDecimal, class
java.math.BigDecimal )'
Because of:
...string(decimal(Payment,2),2)...
Instead of (see the misplaced parenthesis):
...string(decimal(Payment,2)),2...
I think we can also improve the error message to say:
Unable to find function 'string( number, number )'
Validate function signature at compile time and improve error
message
---------------------------------------------------------------------
Key: DROOLS-1481
URL:
https://issues.jboss.org/browse/DROOLS-1481
Project: Drools
Issue Type: Feature Request
Components: dmn engine
Affects Versions: 7.0.0.Beta7
Reporter: Edson Tirelli
Assignee: Edson Tirelli
Fix For: 7.0.0.Final
Function signatures as of now are only validated in runtime. We can improve it to add
static validation as well. For instance, in the expression:
{code}"$"+ (if Payment < 1000 then string(Payment) else
(substring(string(Payment),1,1) + "," +
substring(string(decimal(Payment,2),2)))){code}
In runtime I get:
{quote}Unable to find function 'string( class java.math.BigDecimal, class
java.math.BigDecimal )'{quote}
Because of:
{code}...string(decimal(Payment,2),2)...{code}
Instead of (see the misplaced parenthesis):
{code}...string(decimal(Payment,2)),2...{code}
I think we can also improve the error message to say:
{quote}Unable to find function 'string( number, number )'{quote}
--
This message was sent by Atlassian JIRA
(v7.2.3#72005)