Revise Methods in ISPClientApplicationNoUI Interface - 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)

GetDocumentContainersForRevise As Long

This method is called first when the authoring tool is reserving one or more revisions for one or more documents. In this method, Schema Component containers are created and returned to the calling application.

This method indicates the start of Revise transaction by creating document data containers and document meta-data containers. The calling application fills the data container with selected document objects.

If one or more of the documents in the set being revised lacks an applicable revision scheme, those documents will be removed from the oDocUIDs container and will not be added to oDocIContainer. Additionally, the issue will be logged in the log file.

Arguments

Name

Data type

Input/output

Description

oDocUIDs

ISPDocUIDs

Input

List of document UIDs generated by the tool for the documents that have been selected by the user in the tool user interface.

oDocIContainer

IContainer

Output

IContainer pointer to documents container with document objects previously revised or published for the given document UIDs in the oDocUIDs argument. These document objects contain only the UIDs.

oNewDocIContainer

IContainer

Output

IContainer pointer to documents container with new document objects that have not been published previously for the given document UIDs in the oDocUIDs argument.

oRevisionIContainer

IContainer

Output

IContainer pointer to document revision objects for given document UIDs in the oDocUIDs argument. These revision objects are empty for new documents. Otherwise, each document has corresponding revision object with the next revision values. If a document has been revised or published before, employs both major and minor revisions, and has another minor revision available for its current major revision, then there will be two revision objects in the container for the document: one revision object with the current major revision and that major revision’s next minor revision and another revision object with the next major revision and that major revision’s first minor revision.

oSelectedDocIContainer

IContainer

Output

Empty IContainer for the authoring tool to fill with document objects and pass in the Revise method.

oSelectedRevisionIContainer

IContainer

Output

Empty IContainer for the authoring tool to fill with document revision objects (one per document) and pass in the Revise method.

Return Value

  • 0 if the method is successful.

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

ReviseDocuments As Long

This method is called after the GetDocumentContainersForRevise method. Calling this method completes the Revise transaction started in GetDocumentContainersForRevise method. Before calling this method, the application fills in the oSelectedDocIContainer and oSelectedRevisionIContainer containers as described in the above section.

The ReviseDocuments method processes the documents and document revision objects as follows:

  1. For each document selected for Revise, a DocumentRevision object is added in the meta-data container with IDocumentRevision.MajorRev_ForRevise and IDocumentRevision.MinorRev_ForRevise set to user-selected values for document revision. A RevisedDocument relationship between the document object and the DocumentRevision object is added in the meta-data container.

  2. The document container with the document object and the meta-data container with the DocumentRevision and RevisedDocument relationship are passed to the tool’s SmartPlant Adapter’s ReviseDocuments method on ISPAdapter2 interface. In the SP Adapter’s ReviseDocuments method, the tool must get the major and minor revision numbers and retain them into its database.

If one or more of the documents added to oSelectedDocIContainer lacks an applicable revision scheme, those documents will be removed from the container and the issue will be logged in the log file.

Arguments

Name

Data type

Input/output

Description

oSelectedDocIContainer

IContainer

Input

Pointer to Schema Component container object with documents that need to be revised.

oSelectedRevisionIContainer

IContainer

Input

Pointer to Schema Component container object with DocumentRevision objects for documents in oSelectedDocIContainer

sLogFile

String

Output

Full path of a log file with revise failure messages if there is a failure in revise operation.

Return Value

  • 0 if the method is successful.

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

ReleaseReviseDocumentListContainers As Long

This method is called in conjunction with GetDocumentContainersForRevise. The purpose of this method is to cancel the revise transaction started in the GetDocumentContainersForRevise method called previously. The authoring tool should call this method if an error occurs after GetDocumentContainersForRevise is called, if the authoring tool allows users to cancel the operation after GetDocumentContainersForRevise is called, or if the authoring tool’s logic forces a cancel.

This method releases all pointers to Container Compositions and Containers created in the GetDocumentContainersForRevise method and terminates the revise transaction.

Arguments

None.

Return Value

  • 0 if the method is successful.

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

Comments

The design tool should release all local pointers to containers.

GetNextRevisionCode

This method returns the next revision values for a document based on a revision scheme, starting major revision value, and starting minor revision value using the following criteria:

  • If the minor value is empty but not the major, returns only the next major value.

  • If the major value is empty but not the minor, returns only the next minor value.

  • If both major value and minor value are empty, returns the first revision values for both major and minor.

  • If both major value and minor value are not empty, returns the next combined code, incrementing the major value only if the revision scheme has run out of minor revision values for the starting major value.

Optionally, the method returns information about the next revision code in r_eriRevisionInformation from SchemaCompInterfaces.eRevisionInformation as follows:

  • NoComment = 0 - No extra information available about the next revision code.

  • Error = 1 - An error occurred.

  • NoFirstMajor = 2 - SmartPlant Foundation did not return a first major value for the revision scheme.

  • NoFirstMinor = 4 - SmartPlant Foundation did not return a first minor value for the revision scheme.  This could occur if the revision scheme lacks minor revisions.

  • NoNextMajor = 8 - SmartPlant Foundation did not return a next major value for the revision scheme.  This could occur if the revision scheme has run out of major revisions.

  • NoNextMinor = 16 - SmartPlant Foundation did not return a next minor value for the revision scheme.  This could occur if the revision scheme has run out of minor revisions.

GetNextRevisionCode adds together applicable values from eRevisionInformation to create the value in r_eriRevisionInformation, but the values are distinguishable by regarding them as bit flags.

SmartPlant Test Tool.NET's SmartPlant >Non-UI Command > Next Revision Code command allows the user to try GetNextRevisionCode.

Signature

GetNextRevisionCode( _
ByVal p_sRevisionSchemeName As String, _
ByVal p_sStartingMajorRevision As String, _
ByVal p_sStartingMinorRevision As String, _
ByRef r_sNextMajorRevision As String, _
ByRef r_sNextMinorRevision As String, _
Optional ByRef r_eriRevisionInformation As SchemaCompInterfaces.eRevisionInformation _
) As Long

Arguments

Name

Data type

Input/output

Description

p_sRevisionSchemeName

String

Input

Name of revision scheme.

p_sStartingMajorRevision

String

Input

Major revision value to get next

p_sStartingMinorRevision

String

Input

Minor revision value to get next

r_sNextMajorRevision

String

Output

Next major revision value.

r_sNextMinorRevision

String

Output

Next minor revision value.

r_eriRevisionInformation

SchemaCompInterfaces.eRevisionInformation

Optional Output

Information about results, for example, that a returned value is empty.

Return Value

0 on success; a negative number otherwise. Check the LastErrorMessage property on error.