The Forward Migration Script


If an element is changed completely in a newer library, compatibility can be maintained by defining the migration logic.
For more detailed information, please take a look at the section called “Forward Migration script”.

Example:

actualGUID = FROM_GUID

! ==============================================================================
! Subroutines
! ==============================================================================

    _startID    = "AAAA-AAAA-...AAA"
    _endID      = "BBBB-BBBB-...BBB"
gosub "migrationstepname_FWM"

! ==============================================================================
! Set Migration GUID
! ==============================================================================

setmigrationguid actualGUID

! ==============================================================================
end ! end ! end ! end ! end ! end ! end ! end ! end ! end ! end ! end ! end ! en
! ==============================================================================

! ==============================================================================
! migrationstepname
! ==============================================================================
"migrationstepname_FWM":
    if actualGuid = _startID then
        newParameter = oldParameter
        parameters newParameter = newParameter
        actualGuid = _endID
    endif
return
				


FROM_GUID is the global variable holding the main ID of the original object which the migration is run on.


In case the script succeeds, the instance gets substituted by the new element with the updated parameters.

SETMIGRATIONGUID

SETMIGRATIONGUID guid

The command tells the running environment, which element will be the matching migration element for the current object.
If the returned ID belongs to the current element, the migration of the object gets complete.

STORED_PAR_VALUE

STORED_PAR_VALUE ("oldparname", outputvalue)

Retrieves the value of a parameter, which is present in the migrated object, and present or deleted in the new version object.
This command form is suggested for those parameters present in the new object as well.
To get the value of an old array Parameter, the outputvalue parameter must be initialized as an array (with the dim command).

oldparname: string expression, name of the parameter in the old parameter list.

outputvalue: output variable to store the value of the parameter.

Return value: 1 on success, 0 otherwise (for example, if there is no parameter with that name in the parameter list of the old object).
During checking the script the return value is always 0, because the old Parameters section is not known.

DELETED_PAR_VALUE

DELETED_PAR_VALUE ("oldparname", outputvalue)

Retrieves the value of a parameter, which is present in the migrated object, and present or deleted in the new version object.
This command form is suggested for those parameters deleted from the new object.
To get the value of an old array Parameter, the outputvalue parameter must be initialized as an array (with the dim command).

oldparname: string expression, name of the parameter in the old parameter list.

outputvalue: output variable to store the value of the parameter.

Return value: 1 on success, 0 otherwise (for example, if there is no parameter with that name in the parameter list of the old object).
During checking the script the return value is always 0, because the old Parameters section is not known.