API for Resetting Design Basis (Retrieve) - Integration - Update 46 - Help - Hexagon

SmartPlant Integration .NET Help

Language
English
Product
Integration
Search by Category
Help
SmartPlant Foundation / SDx Version
10
Smart P&ID Version
9 (2019)
Smart Engineering Manager Version
10 (2019)

A design basis is a document retrieved by the design tool. With every retrieved document, a tombstone container is retrieved containing the tombstones, unclaims, and updates.

The rules for retrieval of tombstones, unclaims, and updates are as follows:

  • Tombstones, unclaims, and updates must be retrieved by the design tool.

  • A tombstone/unclaim/update must be retrieved only once.

  • SmartPlant Foundation database keeps track of the design basis by storing the retrieval information for tools in the SmartPlant Foundation database to make sure that the above rules are followed. To satisfy the first rule, if a version of a document is skipped in the retrieve process, it adds the tombstones/unclaims/update instructions of the skipped version to the current version of document retrieved. To satisfy the second rule, if a document version is re-retrieved, the tombstones/unclaims/updates are skipped in the retrieve because they have been retrieved once before.

  • If a tool restores its data from a backup, the design basis information in the SmartPlant Foundation database may not be valid anymore, as there are document versions and tombstones/unclaims/updates that need to be retrieved again.

The following methods help tools to synchronize the design basis in SmartPlant Foundation with the restored data in the tool. Tools can call any of the following methods depending on the scope of data restored.

ResetDesignBasis Methods in ISPClientApplicationUI Interface

ResetDesignBasis As Long

This method resets the design basis in the SmartPlant Foundation database to the beginning of the project for all documents if the sRetDocUID is NULL. All tombstones/unclaims/update instructions are retrieved again in the next retrieve. If the sRetDocUID is specified, then only that document is reset to the beginning and only the tombstones/unclaims/Update instructions associated with that document are retrieved when the document is retrieved next time.

Arguments

None.

Arguments (overloaded)

Name

Data type

Input/output

Description

sRetDocUID

String (maximum 128 characters)

Input

Optional. The UID of the retrieved document that is being reset. If the argument is NULL, then the reset is done on all retrieved documents.

Return Value

  • 0 if the method is successful.

  • A negative number if the method fails (check the LastErrorMessage property for error message).

ResetDesignBasisByGMTTime As Long

This method resets the design basis in the SmartPlant Foundation database to the time specified in GMT for all documents if the sRetDocUID is NULL. All tombstones/unclaims/update instructions generated since the time specified, are retrieved again in the next retrieve. If the sRetDocUID is specified, then only that document is reset to the time specified so that only the tombstones/unclaims/update instructions (generated since the time specified) associated with that document are retrieved when the document is retrieved next time.

Arguments

Name

Data type

Input/output

Description

sDateTime

Date

Input

Time in GMT. The design basis reset is done to the time specified.

Arguments (overloaded)

Name

Data type

Input/output

Description

sDateTime

Date

Input

Time in GMT. The design basis reset is done to the time specified.

sRetDocUID

String (maximum 128 characters)

Input

Optional. The UID of the retrieved document that is being reset. If the argument is NULL, then the reset is done on all retrieved documents.

Return Value

  • 0 if the method is successful.

  • A negative number if the method fails (check the LastErrorMessage property for error message).

ResetDesignBasisByVersion As Long

This method resets the design basis in the SmartPlant Foundation database to the document version specified. All tombstones/unclaims/update instructions that are associated with newer versions of the specified document will be retrieved in the next retrieve.

Arguments

Name

Data type

Input/output

Description

sRetDocUID

String (maximum 128 characters)

Input

The UID of the retrieved document that is being reset.

sRetDocVersionUID

String (maximum 128 characters)

Input

The UID of the document version to which the design basis is being reset.

Return Value

  • 0 if the method is successful.

  • A negative number if the method fails (check the LastErrorMessage property for error message).

GetSPFCurrentGMTTime As Long

This method returns the current time on the SmartPlant Foundation server in GMT. This method is called if a tool stores the current SmartPlant Foundation time in the backup set during a backup. Storing the SmartPlant Foundation server time in the tool backup data helps tools pass that time in the ResetDesignBasisByGMTTime method after a backup is restored.

Arguments

Name

Data type

Input/output

Description

dtDateTime

Date

Output

The current time on SmartPlant Foundation server in GMT.

Return Value

  • 0 if the method is successful.

  • A negative number if the method fails (check the LastErrorMessage property for error message).

ResetDesignBasisByGMTTime As Long

This method resets the design basis in the SmartPlant Foundation database to the time specified in GMT for all documents if the sRetDocUID is NULL, meaning that all tombstones/unclaims/update instructions generated since the time specified, will be retrieved again in the next retrieve. If the sRetDocUID is specified, then only that document is reset to the time specified so that only the tombstones/unclaims/update instructions (generated since the time specified) associated with that document are retrieved when the document is retrieved next time.

Arguments

Name

Data type

Input/output

Description

dtDateTime

Date

Input

Time in GMT. The design basis reset is done to the time specified.

Arguments (overloaded)

Name

Data type

Input/output

Description

dtDateTime

Date

Input

Time in GMT. The design basis reset is done to the time specified.

sRetDocUID

String (maximum 128 characters)

Input

Optional. The UID of the retrieved document that is being reset. If the argument is NULL, then the reset is done on all retrieved documents.

Return Value

  • 0 if the method is successful.

  • A negative number if the method fails (check the LastErrorMessage property for error message).

ResetDesignBasisByVersion As Long

This method resets the design basis in the SmartPlant Foundation database to the document version specified. All tombstones/unclaims/update instructions associated with document versions of the specified document generated after the specified document version, will be retrieved again in the next retrieve.

Arguments

Name

Data type

Input/output

Description

sRetDocUID

String (maximum 128 characters)

Input

The UID of the retrieved document that is being reset.

sRetDocVersionUID

String (maximum 128 characters)

Input

The UID of the document version to which the design basis is being reset.

Return Value

  • 0 if the method is successful.

  • A negative number if the method fails (check the LastErrorMessage property for error message).

GetSPFCurrentGMTTime As Long

This method returns the current time on the SmartPlant Foundation server in GMT. This method is called, if a tool stores the current SmartPlant Foundation time in the backup set during a backup. Storing the SmartPlant Foundation server time in the tool backup data helps tools pass that time in the ResetDesignBasisByGMTTime method after a backup is restored.

Arguments

Name

Data type

Input/output

Description

sDateTime

Date

Output

The current time on SmartPlant Foundation server in GMT.

Return Value

  • 0 if the method is successful.

  • A negative number if the method fails (check the LastErrorMessage property for error message).