subscription_admissions_update ()

subscription_admissions_update ()

Function prototype

subscription_admissions_update (session, subscription , [from_version], [to_version])

API Version

2.7.31 and higher

Supported interfaces

SOAP, REST

Description

Updates the version of the ADMISSIONS of a SUBSCRIPTION to a newer PROGRAM version

When the PROGRAM version of a SUBSCRIPTION is updated to a most recent version of the PROGRAM, the ADMISSIONs that belong to that SUBSCRIPTION are not modified (remain with the same PROGRAM version that they had when created).

This function allows to update the version of the ADMISSIONS in a SUBSCRIPTION to a newer version.

Updating the version of an ADMISSION involves the following actions:

  • The version number of the ADMISSION is updated

  • The TASKS defined in the stage “MIGRATION” are inserted. This mechanism allows to perform actions that the designer of the PROGRAM consider necessary when an ADMISSION is updated from a lower version to a greater one. Note that when the new version is several steps ahead of the current ADMISSION version, all migration actions in the intermediate versions are applied (e.g. when updating from version 2 to 5, the migration actions of versions 3, 4 and 5 will be executed)

Required permissions: The active user must have role LIBRARY MANAGER in the TEAM owner of the SUBSCRIPTION. Otherwise an INSUFFICIENT_PRIVILEGES error will be returned.

Input parameters:

  • session: is the session token obtained in the session_init() call

  • subscription: Reference of the SUBSCRIPTION

  • from_version: (default = null). Accepted values are:

    • null or “ALL”: all ADMISSIONS with a version lower than to_version will be updated

    • a valid PROGRAM version number: only the ADMISSIONS with the given PROGRAM version will be updated. If the value provided is greater than the current SUBSCRIPTION version, the function will return an error.

  • to_version: (default = null). If provided, the ADMISSIONS will be updated to the selected PROGRAM version. Otherwise, the ADMISSIONS will be updated to the current version of the SUBSCRIPTION. If to_value has a value greater than the SUBSCRIPTION’s version, the function will return an error.

Output parameters:

  • result: The update of the ADMISSIONS is performed by a background job because depending on the number of ADMISSIONS affected, the operation may take a long time (see SYSTEM DAEMON: AUTOMATED PROCESSES for additional information). The response of the function includes information about the background job:

    • from_version: version of the ADMISSIONS that will be updated

    • to_version: version to which the ADMISSIONS will be updated

    • background_job:

      • ref: reference to the background job in charge of changing the version of the ADMISSIONS.

  • ErrorMsg: If any error occurs, then this value contains a description of the error translated to the current language

  • ErrorCode: If any error occurs, then this value contains any of the standard ERROR CODES

Request example

Update the version of all the outdated ADMISSIONS of the SUBSCRIPTION to version 5

subscription_admissions_update ( “LCAAAAAAAAAAAA”, 1336, null, 5)

Response

The response format is XML when the function has been invoked via the SOAP API, and JSON when it has been invoked via the REST API

Return Error codes

ERROR CODE

 

ERROR CODE

 

INVALID_TOKEN

The session token provided is not valid

INSUFFICIENT_PRIVILEGES

The session user does not have the necessary privileges to update the ADMISSIONS of the selected SUBSCRIPTION

SUBSCRIPTION.NOT_FOUND

The SUBSCRIPTION reference doesn’t correspond to an existing SUBSCRIPTION

WRONG_PARAMS

An invalid version number has been provided

ADMISSION.UPDATE.INVALID_VERSION

The ADMISSIONS can't be updated because the selected version is greater than the SUBSCRIPTION version

PROGRAM.NOT_FOUND

The PROGRAM version requested doesn’t exist