Lifecycle Applications

Interoperability

Controling VPMDocumentRevision Saved from an External Application

Implementing ENOVIUESaveFile
Use Case


Abstract

The document is related to the use case CAAVpiENOVIUESaveFile. 
It describes how to implement a user-exit to control the object on which a File/Save
will be performed from an external application,  CATIA V5 for example .

What You Will Learn With This Use Case

This Use-Case will show you how to implement the interface and user-exit called ENOVIUESaveFile .
This User Exit allow you to control the object on which a File/Save is performed by the LCA external application Plug-in whenever a Document (ENOVIDocumentRevision)  is saved into LCA.
This UseCase show you how to limit the number of iterations when we save a document from CATIA V5 to ENOVIA LCA.
This interface may also be used to update or modify the intended saved object.
It allow you more generally, to perform any action of your choice, whenever a Document is saved from an external application into ENOVIA.
This Use Case is especially aimed at helping you to implement your own ENOVIUESaveFile User-Exit.
[Top]

The CAAVpiENOVIUESaveFile Use Case

CAAVpiENOVIUESaveFile is a use case of the CAAVPMInterfaces.edu framework.
[Top]

What Does CAAVpiENOVIUESaveFile Do

This user-exit sample gives the application designer an insight on how to modify the preferred iteration (the one exposed to the user) on a save-file event initiated by an external application.

To do so, the use case goes through the following steps:

The actual implementation of the user-exit is contained in the file CAAVpiENOVIUESaveFile.cpp.
[Top]

How to Launch CAAVpiENOVIUESaveFile

Launch the use case, CAAVpiENOVIUESaveFile, as follows:
[Top]

Where to Find the CAAVpiENOVIUESaveFile Code

The CAAVpiENOVIUESaveFile Use Case is located in the module CAAVpiENOVISaveFile.m of the framework CAAVPMInterfaces.edu.
 
Windows InstallRootDirectory\CAAVPMInterfaces.edu\CAAVpiENOVISaveFile.m\
Unix InstallRootDirectory/CAAVPMInterfaces.edu/CAAVpiENOVISaveFile.m/

Where InstallRootDirectory is the directory where the CAA CD-ROM is installed.

[Top]

Step-by-Step

There are seven main steps in CAAVpiENOVIUESaveFile code:
  1. The User Exit itself extends ENOVIA_VPMDocumentRevision
  2. Set/Read  the cUserExit value
  3. If cUserExit = 0:
    1. Return S_FALSE.
    2. => A new iteration will be created.
  4. If cUserExit = 1 or 2:
    1. Get all iteration of current ENOVIA_VPMDocumentRevision.
    2. Abort (return S_FASE ) if the number of iteration is smaller than 2.
  5. If cUserExit = 1:
    1. Restrict the number of iterations to 2:
    2. Delete all non prefered & return S_FALSE
    3. => A new iteration will be created.
  6. If cUserExit = 2:
    1. Retrieve the first non prefered Iteration.
    2. Set it prefered.
    3. Return it in oObject + S_OK
    4. => the prefered iteration will be overwritten.
We will now comment each of these sections in detail.

The User Exit itself extends ENOVIA_VPMDocumentRevision.

Extending ENOVIA_VPMDocumentRevision with your user exit allow the LCA plugin code
to make your User Exit pointing to the Document Revision currently intended to be saved.

[Top]

Set/Read  the cUserExit value

This allow you to choose the behaviour of the User Exit.

[Top]

cUserExit = 0:

Return S_FALSE:

A new iteration will be created thereafter by Enovia.

[Top]

UserExit = 1 or 2

Get all iterations of current ENOVIA_VPMDocumentRevision.

Abort (return S_FASE ) if the number of iteration is smaller than 2:

[Top]

cUserExit = 1

Restrict the number of iterations to 2: Delete all non preferred & return S_FALSE.

A new iteration will thereafter be created by Enovia.
 

[Top]

cUserExit = 2

Retrieve the first non preferred Iteration.


                        ...

Set it preferred,


and Return it in oObject + S_OK.

As a consequence, this iteration will be exposed to the User In Enovia.
And the initially preferred iteration will be overwritten.
 

[Top]

In Short

This use case demonstrates how the user-exit technique can be used in the Catia Plugin to implement a customized saving-behaviour.
As an example, a user-exit that limit the number of document iterations while saving in ENOVIA is described.
[Top]

References

[1] Building and Launching a CAA V5 Use Case
[Top]

History

Version: 1 [Nov 2003] Document created by BRL
[Top]

Copyright © 2003, Dassault Systèmes. All rights reserved.