Lifecycle Applications

Engineering Change Management

The Links Interface

Creating and Deleting Links between Objects
Use Case

Abstract

This article shows how to use the ENOVICWLinks interface of the ENOVInterfaces framework to add and remove links between existing Change Management objects, i.e., Engineering Change Orders, Actions, and Engineering Change Requests.


What You Will Learn With This Use Case

This use case is intended to show you how to add links between existing ECOs, Actions, and ECRs. You will learn how to add a Design Action, to an existing Engineering Change Order as a deliverable. You would use this operation if for example a certain Action has to be completed to accomplish a project or a product modification. The required action is attached as a deliverable to an ECO which controls the project or modification. The ECO cannot be released until the deliverable is completed, ensuring that all necessary work is accomplished.

You will also learn how to link one ECO to another related ECO. You would use this link to attach a prerequisite ECO, that is, an ECO that must be completed before the linking ECO can be completed. Similarly, a Hierarchy link can be used to attach a whole tree of ECOs that represent the total work that must be completed before the controlling or parent ECO can be completed.

Finally, you will learn how to link two Actions together. The ENOVInterfaces framework contains the interface ENOVICWLinks which allows you to directly add and remove links between an existing Actions and ECOs.

[Top]

The CAAEviLinks Use Case

CAAEviLinks is a use case of the CAAENOVInterfaces.edu framework that illustrates how you use the ENOVICWLinks interface to add and remove links between existing ECOs and Actions.

[Top]

What Does CAAEviLinks Do?

CAAEviLinks begins by opening a VPM session and creating a login a session. Then the ECO and Action Managers are retrieved. To set up the demonstration, two ECOs are created with the necessary parameters as well as a Design Action and a Manufacturing Action. For more information on how to create ECOs and Actions, refer to use cases CAAEviEcoManager and CAAEviActionManager. After the necessary objects are created, the ENOVICWLinks interface is used to add and remove the links between ECOs and Actions.

The ENOVInterfaces interface/methods shown here are:

[Top]

How to Launch CAAEviLinks

To launch CAAEviLinks, you will need to set up the build time environment, then compile CAAEviLinks.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 "CAAEviLinks" to execute the program. [1].

[Top]

Where to Find the CAAEviLinks Code

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

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

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

[Top]

Step-by-Step

For demonstration purposes, the code from the CAAEviLinks use case is shown here. After the preliminary set up of creating the ECOs and Actions, there are five logical steps:

  1. Create a Related EC link between two ECOs
  2. Create a Hierarchy link between two ECOs
  3. Create a deliverable link between an ECO and a Design Action
  4. Create a parent link between a Design Action and a Manufacturing Action
  5. Remove a link

[Top]

Create a Related EC link between two ECOs

    #include "ENOVICWLinks.h"
    #include "CATIVpmAFLLink.h"
    #include "CATUnicodeString.h"
     

These include statements give access to the interfaces demonstrated here.

//--- Create Related EC Link (Prerequisite) from Eco1 to Eco2

    CATUnicodeString RelLinkType("ENOVIA_V506ec_prerequ");
    CATIVpmAFLLink_var RelECLink = NULL_var;
    ENOVICWLinks_var spLink(Eco1);
        
    rc = spLink->CreateRelatedEcLink(RelLinkType, Eco2, RelECLink);
   
    if (RelECLink==NULL_var||!SUCCEEDED(rc))
    {
    	cout << "ERROR in creating Related EC Link." << endl << flush;    
    	VPMSession::CloseSession();
    	return 6;
    }
    cout << "Created Related EC Link successfully." << endl << flush;
      

 

  1. First, the link-to ECO is Eco2. The link type RelLinkType is set to "ENOVIA_V506ec_prerequ".
  2. The ECO object, Eco1, is cast as a ENOVICWLinks type - spLink.
  3. Then, spLink calls method CreateRelatedEcLink.
  4. The method returns S_OK if successful and the link RelECLink is created.

[Top]

Create a Hierarchy link between two ECOs

    #include "ENOVICWLinks.h"
    #include "CATIVpmAFLLink.h"
         

These include statements give access to the interfaces demonstrated here.

  //--- Create Hierarchy Link from Eco1 to Eco2

    CATIVpmAFLLink_var HierLink = NULL_var;
        
    rc = spLink->CreateEcHierarchyLink(Eco2, HierLink);
   
    if (HierLink==NULL_var||!SUCCEEDED(rc))
    {
    	cout << "ERROR in create Hierarchy Link." << endl << flush;    
    	VPMSession::CloseSession();
    	return 7;
    }
    cout << "Created Hierarchy Link successfully." << endl << flush;    
      

 

  1. First, the link-to ECO is Eco2.
  2. The ECO object, Eco1, is cast as a ENOVICWLinks type - spLink.
  3. Then, spLink calls method CreateEcHierarchyLink.
  4. The method returns S_OK if successful and the link HierLink is created.

[Top]

Create a deliverable link between an ECO and a Design Action

#include "ENOVICWLinks.h"
    #include "CATIVpmAFLLink.h"

These include statements give access to the interfaces demonstrated here.

//--- Create a Deliverable Link from Eco1 to the Design Action

    CATIVpmAFLLink_var LinkObj = NULL_var;
    boolean IsPaste = FALSE;
                
    rc = spLink->CreateDeliverableLink(DsgAct, LinkObj, IsPaste);
   
    if (LinkObj==NULL_var||!SUCCEEDED(rc))
    {
    	cout << "ERROR to Add Deliverable Link." << endl << flush;    
    	VPMSession::CloseSession();
    	return 8;
    }
    cout << "Created Deliverable Link successfully." << endl << flush;
      

 

  1. First, the link-to action is the Design Action, DsgAct.
  2. The ECO object, Eco1, is cast as a ENOVICWLinks type - spLink. The boolean IsPaste indicates if the link is being made as a result of a cut and paste.
  3. Then, spLink calls method CreateDeliverableLink.
  4. The method returns S_OK if successful and the link LinkObj is created.

[Top]

Create a Parent link between a Design Action and a Manufacturing Action

    #include "ENOVICWLinks.h"
    #include "CATIVpmAFLLink.h"
    #include "CATUnicodeString.h"
     

These include statements give access to the interfaces demonstrated here.

//--- Create a Parent Link from Design Action to Mfg Action

    CATUnicodeString LinkType("ENOVIA_AFLParent");
    CATIVpmAFLLink_var ActLink = NULL_var;
    ENOVICWLinks_var spLnk(DsgAct);
        
    rc = spLnk->CreateNewLink(LinkType, MfgAct, ActLink);

    if (ActLink==NULL_var||!SUCCEEDED(rc))
    {
    	cout << "ERROR in Create Link from Design Action to Mfg Action." << endl << flush;    
    	VPMSession::CloseSession();
    	return 9;
    }
    cout << "Created Parent Link from Design Action to Mfg Action successfully." << endl; 
      

 

  1. First, the link-to ECO is MfgAct. The link type LinkType is set to "ENOVIA_AFLParent".
  2. The Design Action object, DsgAct, is cast as a ENOVICWLinks type - spLnk.
  3. Then, spLnk calls method CreateNewLink.
  4. The method returns S_OK if successful and the link ActLink is created.

[Top]

Remove a link

    #include "ENOVICWLinks.h"
    #include "CATIVpmAFLLink.h"
         

These include statements give access to the interfaces demonstrated here.

  //--- Remove Parent Link from Design Action to Mfg Action 

    rc = spLnk->RemoveLink(ActLink);
   
    if (!SUCCEEDED(rc))
    {
    	cout << "ERROR in removing Parent Link." << endl << flush;    
    	VPMSession::CloseSession();
    	return 10;
    }
    cout << "Removed Parent Link between Actions successfully." << endl << flush;
    
      

 

  1. With the Design Action, DsgAct, cast as a ENOVICWLinks type - spLnk, a call is made to method RemoveLink passing the link object ActLink as an argument.
  2. The method returns S_OK if successful and the link ActLink is deleted.
  3. The RemoveLink method is used for all types of links on both ECOs and Actions.

[Top]


In Short

Use the ENOVICWLinks interface available in the ENOVInterfaces framework to add and remove links on existing Actions and ECOs.

[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.