3D PLM Enterprise Architecture

ENOVIA V5 Integration

Save Process Customization

Customize Enovia Save Process
Use Case

Abstract

 


What You Will Learn With This Use Case

Using the CATIPDMUESaveProcess interface, the Enovia Save process can be customized step by step. We will learn what are the available User-Exits during Save Process from CATIA to ENOVIA, and when and how they can be used. 

First let us have a quick look on the available User-Exits during Enovia save process:

  1. BeforeSaveDialog,

  2. OnOK,

  3. BeforeStartingSave,

  4. OnSaveSucceeded,

  5. OnSaveFailed,

  6. BeforeCommit,

  7. BeforeRollback.

In addition to that Save Process Customization Use Case will internally call another existing CAA API method GetModificationStatus, which returns status of a Document in CATIA session. For details on GetModificationStatus please look for CATIPDMSaveInfo Interface.

[Top]

The Save Process Customization Use Case

The CAAEV5CommitAndRollback is a use case of the CAAProductStructureE5i.edu framework that illustrates how and when different User-Exits of  CATIPDMUESaveProcess allows customer to tailor the “Save in ENOVIA” command with business logic that fits their own needs. 

[Top]

What Does CAAEV5CommitAndRollback Do

The goal of CAAEV5CommitAndRollback is to explain how and when different User-Exits of CATIPDMUESaveProcess are called when user performs "Save in Enovia" command. We will see how outcome of User-Exits affect Save Process, depending on result of every User-Exit next step from Save process is performed.

In this Use Case we are using a static call counter based on which User-exits will SUCCEED or FAIL. In addition to these User-exits, we will see how the Document status changes during "Save in Enovia" process. Document status mentioned here is the same as returned by  GetModificationStatus.

[Top]

How to Launch CAAEV5CommitAndRollback 

To launch CAAEV5CommitAndRollback, you will need to set up the build time environment, then compile CAAEV5CommitAndRollback along with its prerequisites, set up the run time environment, and then execute the use case [1] in the following way:

1.       Set the current directory to InstallRootDirectory/CAAProductStructureE5i.edu

2.       Set up the build time environment and build the following module: CAAEV5CommitAndRollback.m

3.       Edit file InstallRootDirectory/CAAProductStructureE5i.edu/CNext/code/dictionary/CAAProductStructureE5i.edu.dico: uncomment the following line
#CATUEPDMSaveProcess CATIPDMUESaveProcess libCAAEV5CommitAndRollback

4.       Install the run time environment by executing the command mkCreateRuntimeView

5.       Run CNEXT on the command line

[Top]

Where to Find the CAAEV5CommitAndRollback Code

InstallRootDirectory\CAAProductStructureE5i.edu

·          the code implementing CAAEV5CommitAndRollback can be found in CAAE5iUEDocumentName.m\src\CAAEV5CommitAndRollback.cpp

·          the corresponding dictionary entry can be found in CNext\code\dictionary\CAAProductStructureE5i.edu.dico

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

[Top]

Step-by-Step

The Use Case of CAAEV5CommitAndRollback includes the following steps:

#

Step

1 Implement the User Exit.
2 Replay the Use Case scenario.
3 Checks to be performed.

[Top]

Implement the User Exit

The CAAEV5CommitAndRollback.cpp code is a user exit program; I.E. CATIA V5 calls the various User-exits in this  implementation code during "Save in Enovia" process. The call to different User-exits are made depending on how "Save in Enovia" progresses.

To do this, CATIA instanciates a CATObject with late type CATUEPDMSaveProcess and queries it for the interface CATIPDMUESaveProcess.

This is why CAAEV5CommitAndRollback.cpp declares

1.    its late type is CATUEPDMSaveProcess:

CATImplementClass( CAAEV5CommitAndRollback, DataExtension, CATBaseUnknown, CATUEPDMSaveProcess);

2.       it implements CATIPDMUESaveProcess:

#include "TIE_CATIPDMUESaveProcess.h"
 TIEchain_CATIPDMUESaveProcess(CAAE5iUEDocumentName);

Additionally the CAAProductStructureE5i.edu.dico file declares the implementation of CATIPDMUESaveProcess in the following line:

CATUEPDMSaveProcess	CATIPDMUESaveProcess	libCAAEV5CommitAndRollback

[Top]

Replay the Use Case scenario

User-exits implemented in this Use case returns S_OK and E_FAIL based on a statis call counter. What action user wants to perform inside these User-exits is up to the user. Following is the scenario used to demonstrate how this User-exits can be implemented and how "Save in Enovia" process proceeds with the outcome of these User-Exits:

1.       Create Product structure in CATIA as shown below:

2.       Click on “Save in ENOVIA” command.

3.       Implementation of BeforeSaveDialog will be called which return’s E_FAIL based on static call counter value (At this step counter value is 0 hence returned E_FAIL and incremented by 1).

4.       Due to failure of User-exit BeforeSaveDialog following Error message will be shown in reporter panel:

5.       Close the Error Message and again click on “Save in ENOVIA” command.

6.       Implementation of BeforeSaveDialog will return S_OK (At this step counter value is 1).

7.       Save Panel will be displayed, click on OK.

8.       Implementation of OnOK will be called which return’s E_FAIL (At this step counter value is 1 hence returned E_FAIL and incremented by 1). Error message will be shown as earlier.

9.       Save process has been interrupted, again click on “Save in ENOVIA” command.

10.   Implementation of BeforeSaveDialog will return S_OK, click on “OK” from Save Panel.

11.   Implementation of OnOK will return S_OK.

12.   Implementation of BeforeStartingSave will be called which return’s E_FAIL (At this step counter value is 2 hence returned E_FAIL and incremented by 1).

13.   If BeforeStartingSave is failed implementation of OnSaveFailed is called which returns S_OK.

14.   Save process has been interrupted, again click on “Save in ENOVIA” command.

15.   Implementation of BeforeStartingSave will return S_OK, click on “OK” from Save Panel.

16.   Implementation of OnOK, BeforeStartingSave and OnSaveSucceeded will return S_OK.

17.   Implementation of BeforeCommit will be called which returns S_OK (At this step counter value is 3 and incremented by 1).

18.   Created Product structure will be saved to ENOVIA.

19.   Make some modifications on Part geometries, and click on “Save in Enovia”.

20.   Click on “OK” on Save Panel. All other User-exits will return S_OK except for BeforeCommit which returns E_FAIL at this step.

21.   Due to failure of User-exit BeforeRollback will be called and then ENOVIA rollback will be called, Following Error message will be shown in reporter panel:

22.   Close the Error Message and again click on “Save in ENOVIA” command.

23.   At this step all User-exits will return S_OK and hence the modified data will be saved to ENOVIA.

[Top]

Checks to be performed

Check after every User-exit if corresponding Save, Commit and Rollback process have been performed correctly.

Additional check for documents modifications has to be performed. Newly created method GetModificationStatus in API CATIPDMSaveInfo will return status during different User-exits as below:

BeforeSaveDialog – Status will be PDM_New (Documents are new for PDM)

BeforeCommit – Status will be PDM_NotModified (Save process has been completed, commit to be done hence documents are in PDM and NotModified)

Once the Product Structure is saved in DB (After Step 18):

BeforeSaveDialog – Status will be PDM_Modified (Documents are saved in PDM and Modified in CATIA session).

BeforeCommit –Status will be PDM_NotModified (Modifications have been saved in DB, commit is to be performed hence status is PDM_NotModified.

In Short

This use case has demonstrated how various User-exits available with CATIPDMUESaveProcess allows customers to tailor the “Save in ENOVIA” command with business logic that fits their own needs.

[Top]


References

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

History

Version: 1 [Feb 2008] Document created
[Top]

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