Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Added new way and best practice.

If you need to add a piece of code to a calculation logic that is regarded as incorrect by the There is a simple way to disable built-in syntax checker for whole calculation (there is no longer need to put in each element), it will only work for the save operation, and it prevents you from saving it, add the following line at the beginning of the element script:

...

while looking for configuration (select logic), it will never abort any real calculations, create new element as 1st or 2nd, and then put a simple code:

Paste code macro
languagegroovy
if (api.isSyntaxCheck()) return

If you want to exclude only one line from the evaluation, you can use the following construction:

Code Block
def pli = api.isSyntaxCheck()? [:] : api.getElement("TargetPricePLI"){
	api.abortCalculation()
}


Note

This feature is not intended and will not work as a workaround for cases when the coding style is bad:

  • If there are real issues (bugs) in your code, of course this does not help.
  • If you have "null" references, it is a better practice to fix it by using "?:"

But, for example, when the code works fine in the Test Drive but it is not possible to save the logic, then you can consider disabling the checker.

...