Breaking Changes for Power Scripts

We try really hard to make sure every new version of Power Scripts will work with your existing scripts and configurations. However, sometimes in order to bring new features to life we need to break a few eggs.

Version 5.8.0.x

In order to help mitigate the impact of these changes we have created a script (attached) that is designed to help files that could be impacted. This script does not guarantee that all functional changes will be captured. However, it should greatly assist those users who have a large number of scripts that require checking. See the attachments section at the bottom of this page for a link to the script(s).

Introduction of Null Constant

Since the concept of a null constant has been introduced in version 5.8.0+, any variables that may have been named ‘null' or ‘nil’ will cause an error since those are now reserved keywords for the language.

Introduction of Integer Type

Due to the introduction of the integer type some values that were intended as numbers will be automatically interpreted as integers. This could cause the results of a calculation to loose all decimal values or cause the result of the calculation to change due to rounding differences.

1 return 3/2;

In older SIL, the result would have been 1.5. In the new SIL, the result is 1, because the literals 3 & 2 are now integers. In order to maintain the same results the code must be changed like in the examples below:

1 2 3 4 5 6 7 return 3.0/2.0; //or, explicity declare the type number x = 3; number y = 2; return x/y;

The introduction of the integer type has also the following consequence:

1 2 3 4 5 6 7 8 9 10 11 12 13 try { ..... if( ... ) { throw 1; //integer! } if( .... ) { throw 2; //these are integers literals now } } catch integer i { //you need to add this block in order to deal with the above throws } catch number n { //you need to move code from here in the above block! }

Packages

We added package and the “use“ keyword, please consider “use“ and “package“ keywords as inappropriate for variable names ('package' may be used in the future)

Issue Type and Project fields

are now read-only and will error if you are trying to set them. In previous versions, changing the issue type and project would not error, although they didn’t do anything.

Arrays

When accessing an invalid element in the array for read (in older versions) the array was automatically grown. By invalid element we mean the element arr[i] with i >= size(arr). This was changed in new SIL Engine, reading an invalid array element no more increase the size of the array. Only by setting it the array is increased. Normally this should not have any impact, but some may have used this mechanism to reserve the space in an array, so please be aware that you will now need to do an explicit arr[i] = null; before size is grown, if needed.

Workflow Validators

In version 5.8.0.1 we fixed older bug, changing the way fields in validators are handled. getInput() routine took values from the screen, but accessing the field directly got the same value. To make a difference between the values stored in the issue and the value from the transition screen, we made the following convention:

We know that there are customers who have already implemented scripts using the wrong version, but we assumed the risk of upsetting them, by knowing that the fix is really needed.

Attachments

  File Modified

Text File compatibilityCheck.txt Script is compatible with all versions of SIL.

Nov 26, 2021 by Jonathan Muse

Text File compatibilityCheck_5.8.0.txt Script should only be used with SIL 5.8.0 and above.

Nov 26, 2021 by Jonathan Muse