Lifecycle Applications

Engineering Change Management

The Status Interface

Changing the Status of Objects and Exporting
Use Case

Abstract

This article shows how to use the ENOVICWState interface of the ENOVInterfaces framework to change the status of and Export an existing action Change Management object.


What You Will Learn With This Use Case

This use case is intended to change the status of an existing Change Management object, i.e., an Engineering Change Order, Action, or Engineering Change Request. You would use this operation if, for example, a proposed ECO had been approved and its status had changed from Proposed to Pre-Release. You would then want to promote the status of the ECO. An ECO is used here for an example, but the process is the same for the other Actions and ECRs. You also see how to Export the ECO to specified file directory. The ENOVInterfaces framework contains the interface ENOVICWState which allows you to directly change the status of and Export the Change Management objects.

[Top]

The CAAEviState Use Case

CAAEviState is a use case of the CAAENOVInterfaces.edu framework that illustrates how you use the ENOVICWState interface to change the status of and Export an ECO, Action, or ECR.

[Top]

What Does CAAEviState Do?

CAAEviState begins by opening a VPM session and creating a login a session. Then the ECO Manager is retrieved. To set up the demonstration, an ECO is created with the necessary parameters. For more information on how to create an ECO, refer to use case CAAEviEcoManager, and to ECAAEviActionManager for how to create Actions and ECRs. After the necessary objects are created, the ENOVICWState interface is used to change the status of the ECO and then Export.

The ENOVInterfaces interface/methods shown here are:

[Top]

How to Launch CAAEviState

To launch CAAEviState, you will need to set up the build time environment, then compile CAAEviState.cpp along with its prerequisites, set up the run time environment, and then execute the use case. The required interfaces can be found in the ENOVInterfaces, VPMInterfaces, VPMPersistency, and System frameworks. From the directory where the executable file is stored, enter "CAAEviState" to execute the program. [1].

[Top]

Where to Find the CAAEviState Code

The CAAEviState use case is made of a single file located in the CAAEviState.m module of the CAAENOVInterfaces.edu framework:

Windows InstallRootDirectory\CAAENOVInterfaces.edu\CAAEviState.m\
Unix InstallRootDirectory/CAAENOVInterfaces.edu/CAAEviState.m/

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

[Top]

Step-by-Step

For demonstration purposes, the code from the CAAEviState use case is shown here. After the preliminary set up of creating the ECO, there are two logical steps:

[Top]

Change the ECO status

    #include "ENOVICWState.h"
    #include "CATUnicodeString.h"
    

These include statements give access to the interfaces demonstrated here.

//---Promote the ECO

    ENOVICWState_var spState(Eco);
    CATUnicodeString TransitionName("Promote");
    CATUnicodeString Description("Promoting Eco");
    boolean Simulate = FALSE;
    
    spState->ApplyNewStatus(TransitionName, Description, Simulate);
    if ( !SUCCEEDED(rc))
    {
    	cout << "Failed to Promote ECO." << endl;    
    	VPMSession::CloseSession();
    	return 4;
    }
        
    cout << "Changed Status of Engineering Change Order successfully." << endl;
      

 

  1. After the VPM session is opened and the ECO created, you can use the ENOVICWState interface to change the status of the ECO.
  2. Then, the ECO object, Eco, is cast as a ENOVICWState type - spState.
  3. Then, with the arguments TransitionName ("Promote"), Description ("Promoting Eco"), the Simulate boolean (FALSE), spState calls method ApplyNewStatus. TransitionName has to be a valid step in the graph of the type of object for which the status is being changed. If Simulate is set to TRUE, the object will not actually be promoted, but a check is made to see if a change of status is permitted.
  4. The method returns S_OK if successful and the status of the object is changed.

[Top]

Export the ECO

    #include "ENOVICWState.h"
    #include "CATUnicodeString.h"
    

These include statements give access to the interfaces demonstrated here.

//---Export the ECO

    #if defined(_WINDOWS_SOURCE)
    CATUnicodeString outFilename("\tmp\MyEco.tmp");
    #endif
    #if defined(_IRIX_SOURCE)||defined(_AIX_SOURCE)||defined(_HPUX_SOURCE)
       ||defined(_SUNOS_SOURCE)  
    CATUnicodeString outFilename("/tmp/MyEco.tmp");
    #endif
    
    rc = spState->ExportActionObjects(outFilename);
    if ( !SUCCEEDED(rc))
    {
    	cout << "ERROR in Export ECO." << endl;    
    	VPMSession::CloseSession();
    	return 5;
    }
        
    cout << "Exported Engineering Change Order successfully." << endl<< flush;
      

 

  1. The ECO object, Eco, is cast as a ENOVICWState type - spState.
  2. Then, with the argument outFilename set to a directory/filename ("\tmp\MyEco.tmp" for WINDOWS OS, "/tmp/MyEco.tmp" for UNIX OS), spState calls method ExportActionObjects.
  3. The method returns S_OK if successful and the status of the object is exported to the specified directory/file.

[Top]


In Short

Use the ENOVICWState interface available in the ENOVInterfaces framework to change the status of ECO's, Actions, and ECR's and to export to a specified directory/file.

[Top]


References

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

History

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

Copyright © 1994-2002, Dassault Systèmes. All rights reserved.