Dear Customers and Partners
On Tuesday, 19th April, SAP plans to update the underlying JS-Engine of Business Rules, which is GraalVM, to a newer version. This newer version will contain some corrections and also some performance improvements.
Regarding these corrections SAP identified one very specific corrective measure, which might change the way how BR executions behave in case of an invalid moment.js expression:
If you have an expression which should return a number – such as moment(xy).day() – but it could not determine this number because for example variable xy contains null value, then moment.js returns NaN, which means Not a Number.
The older previously used version of GraalVM by mistake allowed to handle NaN like a number with value zero.
The newer version will point to such an invalid expression via a related error message in the execution log of the Business Rule, mentioning the expression which contains NaN.
In case you have Business Rules, where maybe a null value could be applied to such a moment.js function which should return a number, you could improve it like this:
Old previous example expression:
${moment(xy).day()}
New example expression, in this example we take the current week day as default:
${xy == null ? moment().day() : moment(xy).day()}
New example expression, in this example we take null value as default:
${xy == null ? null : moment(xy).day()}
In case you need further assistance with this change, please do not hesitate to contact our support via ticket.
Best Regards
Karsten
Comments
0 comments
Please sign in to leave a comment.