ShowReviseDialog method - Integration - Update 44 - Help - Hexagon

SmartPlant Integration COM 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)

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

The user interface is subject to change. The interface has two panes. The left pane displays selected documents in a tree view, grouped by document type. The right pane contains fields for the following values:

  • Revision Scheme

  • Next Revision to revise to (major, minor)

  • Number of revisions to reserve in SPF. The starting major and minor revision numbers for reserve.

Revision Schemes

The Revision Scheme list is obtained from SmartPlant Foundation, and revisions are based on the number sequences supplied by the revision schemes. The revision numbers supplied by most revision schemes have two parts, major and minor. The revision numbers for document can be just the major or the combination of major and minor. The user is allowed to choose whether the minor is used when the document is revised the first time. If a minor number is not selected in the first revision, it will not be allowed to be selected in the subsequent revisioning.

For new documents the Revision Scheme field is enabled and allows the user to select a revision scheme. Based on the revision scheme selected, the Next Revision field will display the first revision number by default.

For previously revised documents, the Revision Scheme field is read-only and cannot be changed.

The default value in Next Revision field is based on one of the following in the given order.

  1. The ‘current revision number in tool’: As described above, the tool will communicate the current revision number to the SmartPlant Client, to return the ‘correct’ next revision number. The current revision number is validated in SmartPlant Foundation to make sure that there are no later revisions in SmartPlant Foundation. If a later revision is found, the next revision number is based on SmartPlant Foundation’s published revisions. For example, if the current revision number in tool is ‘A’ and the next available number in the reserved pool is ‘B’ and if the published revision in SmartPlant Foundation is ‘C’, the next available number is ‘D’ instead of ‘B’. (Here, it is assumed that the tool has made a mistake in reporting the current revision number).

  2. If the tool does not report the ‘current revision number in tool’, then the next revision number displayed is the next available reserved revision or one that is based on the current revision in SmartPlant Foundation.

  3. If there are no document revisions in SmartPlant Foundation (if the document has not been published yet), then the first number in the reserved pool is displayed.

  4. If there is no reserve pool, then the first revision number available in the revision scheme is displayed.

The Number of Revisions to Reserve field is a numeric text field. It is an optional field that allows reserving revision numbers while revising a document. By default, this field shows the available reserved revision numbers in SmartPlant Foundation. The user can increase this number to reserve more revision numbers in SmartPlant Foundation for that document in the current project or plant. The revision numbers reserved in a project/plant are not used in any other project.

Tool Processing

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.

The document container with the document object and the meta-data container with the DocumentRevision and RevisedDocument relationship are passed to the tool Adapter’s ReviseDocuments method on IEFAdapter3 interface. In the Adapter’s ReviseDocuments method, the tool should get the major and minor revision numbers and persist that into its database.

SPF Processing (reserving revisions)

For new documents, master document objects are created in the SmartPlant Foundation database. Revision objects are created accordingly for the number of revisions to reserve in the user interface with a status of RESERVED.

The revision number selected for revise in the Revise dialog comes from the reserved revisions pool in SmartPlant Foundation. However, if no more reserved revisions are left, and if the document is about to be revised, a reserved revision is created in SmartPlant Foundation.

The status of reserved revisions changes from RESERVED to WORKING when the document is published.

All reserved revisions that have not been published have their status changed from RESERVED to TOOL_SPECIFIC.

Signature

ShowReviseDialog (oDocs as IContainer, oDocRevs as IContainer) As Long

Arguments

Name

Data type

Input/output

Description

oDocs

IContainer

Input

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

oDocRevs

IContainer

Input

Pointer to Schema Component container object with DocumentRevision objects (one for each document object in oDocs container)

Return Value

0 if the method is successful.

1 if the Revise dialog is cancelled.

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