All Categories  Class Hierarchy  This Category  Previous  Next  Indexes

Product Class CATDMUsrInstance

CATDMUsrInstance
 


public class CATDMUsrInstance

BOM instance management class.
Role: this class is used to manage BOM instances (e.g. parts and representations, assembly links, etc.). Any access to an instance requires a valid connection to the environment it belongs to, using the CATDMUsrEnvironment API. Security checks are performed whenever required, as in standard VPM interactive functions. Data persistency is not managed by this class; it must be handled separately through the CATDMUsrConnection API.

See also:
CATVpmUsrLogin, CATDMUsrConnection, CATDMUsrEnvironment


Constructor and Destructor Index


o CATDMUsrInstance()
Default constructor.
o CATDMUsrInstance(CATDMUsrInstance&)
Copy constructor.
o CATDMUsrInstance(char [ 9],char [19],char [17],char[17])
Constructor.
o CATDMUsrInstance(char [ 9],char [19],double,double)
Constructor.
o ~CATDMUsrInstance()
Destructor.

Method Index


o AddChild(CATDMUsrInstance&,double [12],CATDMUsrInstance&,char*)
Creates an new assembly link between two instances.
o AddChild(CATDMUsrInstance&,double*,double*,int,int)
Creates an new assembly link between two instances.
o AddModifToChild(CATDMUsrInstance&,CATDMUsrInstance&,char*)
Add a Modification effectivity to an assembly link between two instances.
o CheckDataAccess(char*,char*,char*)
Checks the data access to a process.
o CheckIn()
Checks-in an instance.
o CheckOut(CATDMUsrInstance::LockType,char*,char*,int)
Checks-out an object.
o ComputeRevision(CATUnicodeString&)
Compute next revision number.
o CreateCSBProduct()
Create CSB Product

Role: Use this method to create a CSB product.

o CreateNewRevision(CATDMUsrInstance&,int)
Creates a new revision of the instance.
o CreateNewRevision(char*,CATDMUsrInstance&)
Creates a new revision of the instance.
o CreateNewVersionDPN(int,char**,char**,CATDMUsrInstance&)
Creates a new version different part number of the instance.
o CreatePart(char*,int,char**,char**,CATDMUsrInstance&)
Creates a new part instance.
o CreateRepresentation(CATDMUsrInstance&,CATDMUsrInstance::RepresentationSource,char*,char*,int,char**,char**,char*,CATDMUsrInstance&,int)
Creates a representation instance.
o Delete(int)
Deletes an instance.
o DeleteCSBProduct()
Delete CSB Product

Role: Use this method to delete a CSB product.

o DeleteChild(int)
Delete link objects from $EXT table.
o Demote()
Demotes an instance.
o Duplicate(int,char**,char**,CATDMUsrInstance::DuplicationType,CATDMUsrInstance&)
Duplicates the instance.
o ExtractLFIntoFile(CATUnicodeString&,CATUnicodeString&,int,int)
Extracts a long field into a file.
o GetAttributes(CATLISTV(CATUnicodeString)&,CATLISTV(CATUnicodeString)&,CATUnicodeString&,CATLISTV(CATUnicodeString)*)
List attributes.
o GetCaenv(char[9])
Gets the instance environment.
o GetCatab(char[19])
Gets the instance table.
o GetChildren(int&,CATDMUsrInstance*&)
Get instance children.
o GetChildren(int&,CATDMUsrInstance*&,CATDMUsrInstance*&)
Get instance children.
o GetCoid(char[17])
Gets the instance $COID.
o GetCoid(double&)
Gets the instance $COID.
o GetCompid(char[17])
Gets the instance $COMPID.
o GetCompid(double&)
Gets the instance $COMPID.
o GetInWorkRevision(CATDMUsrInstance&,int)
Gets the in-work revision of the instance.
o GetLastRevision(CATDMUsrInstance&,int)
Gets the last revision of the instance.
o GetLocks(int,CATUnicodeString&,CATListValCATDMUsrInstance*,int)
Get locks

Role: Use this method to get locks.

o GetMaturity(char*&,int*)
Gets the instance maturity.
o GetName(char*&)
Gets the instance name.
o GetObjID(ObjID&)
Gets the instance structure definition.
o GetParents(int&,CATDMUsrInstance*&)
Get instance parents.
o GetPreviousVersion(CATDMUsrInstance&)
Return the previous version of an instance.
o GetRepresentations(CATLISTV(CATDMUsrInstance)&)
Get Representations

Role: Use this method to get the list of representations under the instance.

o GetRevision(char*&)
Gets the instance revision number.
o GetUUID(char[50])
Gets the instance UUID.
o GetValue(char* const,char*&)
Gets the value of an attribute.
o GetValues(CATLISTV(CATUnicodeString)&,CATLISTV(CATUnicodeString)&)
Get attributes values.
o GetValues(int&,char**&,char**&)
Get the value of all attributes.
o InsertLock(CATLISTV(CATUnicodeString)&,CATLISTV(CATUnicodeString)&)
Lock insertion.
o IsACSBProduct()
Check CSB Product

Role: Use this method to see if the instance is a CSB product.

o Promote()
Promotes the instance.
o Query(char*,char*,char*,int&,CATDMUsrInstance*&)
Query instances.
o RemoveChild(CATDMUsrInstance&,char*,int)
Deletes all assembly link(s) between two instances.
o RemoveLink(CATDMUsrInstance&,char*,int)
Deletes an assembly link between two instances.
o RemoveLink(CATDMUsrInstance*&,int,char*,int)
Deletes assembly link between two instances.
o RemoveLocks(CATUnicodeString&,int,int)
Lock removal.
o ReplaceChild(CATDMUsrInstance&,CATDMUsrInstance&,char*,int)
Replaces an instance child.
o ReplaceChild(double,CATDMUsrInstance&,char*,int)
Replaces an instance child.
o SetMaturity(char* const)
Sets the instance maturity.
o SetMaturity(int,int)
o TransferLock(CATUnicodeString&,CATUnicodeString&,int)
Transfert lock

Role: Use this method to transfert a lock of an instance you own.

o UpdateAttributes(CATLISTV(CATUnicodeString)&,CATLISTV(CATUnicodeString)&,int)
Attributes update.
o UpdateRelation(double*,int,int)
Relation update.
o UpdateValues(CATLISTV(CATUnicodeString)&,CATLISTV(CATUnicodeString)&)
Update Values

Role: Use this method to update the attributes of the instance.

o WritePart(CATUnicodeString&,CATListOfCATUnicodeString&,CATListOfCATUnicodeString&,double*,double*,int,int)
Prepare a new part instance.
o WriteRepresentation(CATUnicodeString&,CATUnicodeString&,CATUnicodeString&,CATListOfCATUnicodeString&,CATListOfCATUnicodeString&,int&,int&,double*,double*,int,int)
Write a new object instance.
o operator!=(CATDMUsrInstance&)
Inequality operator.
o operator=(CATDMUsrInstance&)
Assignment operator.
o operator==(CATDMUsrInstance&)
Equality operator.

Enumerated Type Index


o DuplicationType
o LockType
o RepresentationSource

Constructor and Destructor


o CATDMUsrInstance
public CATDMUsrInstance()
Default constructor.

Role: Creates an empty, unset instance.

o CATDMUsrInstance
public CATDMUsrInstance( const CATDMUsrInstance& iInstance)
Copy constructor.

Role: Create an object instance that is the exact copy of another one.

Parameters:
iInstance
Object instance to copy.
o CATDMUsrInstance
public CATDMUsrInstance( const char [ 9] iCaenv,
const char [19] iCatab,
const char [17] iCoid,
const char[17] iCompid)
Constructor.

Role: Create an object instance belonging to a given environment and table, and with given identifier attributes.

Parameters:
iCaenv
Database environment.
iCatab
Database table.
iCoid
Object $COID identifier, in hexadecimal format.
iCompid
Object $COMPID identifier, in hexadecimal format.
o CATDMUsrInstance
public CATDMUsrInstance( const char [ 9] iCaenv,
const char [19] iCatab,
const double iCoid,
const double iCompid)
Constructor.

Role: Create an object instance belonging to a given environment and table, and with given identifier attributes.

Parameters:
iCaenv
Database environment.
iCatab
Database table.
iCoid
Object $COID identifier, in decimal format.
iCompid
Object $COMPID identifier, in decimal format.
o ~CATDMUsrInstance
public virtual ~CATDMUsrInstance()
Destructor.

Methods


o AddChild
public Error AddChild( const CATDMUsrInstance& iChild,
const double [12] iPosition,
CATDMUsrInstance& oLink,
const char* iModification=NULL)
Creates an new assembly link between two instances.

Role: Use this method to create a new assembly link between the current instance and another one.

Parameters:
iChild
Child instance.
iPosition
Positioning matrix.
oLink
New assembly link instance.
iModification
Configurable modification name.
Returns:
Error structure. The short and long messages are valuated, their de-allocation (using the delete[] operator) is the responsibility of the calling method.
See also:
CATDMUsrMethod
o AddChild
public Error AddChild( const CATDMUsrInstance& iChild,
const double* xmat=NULL,
double* ioCompidLink=NULL,
const int iCallUserExit=1 ,
const int iCheckSecurity=1 )
Creates an new assembly link between two instances.

Role: Use this method to create a new assembly link between the current instance and another one.

Parameters:
iCallUserExit
iCheckSecurity
iChild
Child instance.
xmat
Positioning matrix.
ioCompidLink
New assembly link instance.
Returns:
Error structure. The short and long messages are valuated, their de-allocation (using the delete[] operator) is the responsibility of the calling method.
See also:
CATDMUsrMethod
o AddModifToChild
public Error AddModifToChild( const CATDMUsrInstance& iChild,
const CATDMUsrInstance& iLink,
const char* iModification)
Add a Modification effectivity to an assembly link between two instances.

Role: Use this method to add a Modification effectivity to a particular existing assembly link defined between the current instance and a given child.

Parameters:
iLink
Assembly link instance.
See also:
GetChildren
iModification
Effectivity Modification name (from Action).

Returns:
Error structure. The short and long messages are valuated, their de-allocation (using the delete[] operator) is the responsibility of the calling method.
See also:
CATDMUsrMethod
o CheckDataAccess
public Error CheckDataAccess( const char* iApplication,
const char* iFunction,
const char* iCommand)
Checks the data access to a process.

Role: Use this method to check the access to a particular security process on data belonging to a given user, organization or site responsible.

Parameters:
iApplication
Security process application name.
iFunction
Security process function name.
iCommand
Security process command name.
Returns:
Error.Ier = 0 if access is granted, else access is not granted (Error.ShortMsg, Error.LongMsg explains the causes)
o CheckIn
public Error CheckIn()
Checks-in an instance.

Role: Use this method to delete existing locks created on the instance by the current user.

Returns:
Error structure. The short and long messages are valuated, their de-allocation (using the delete[] operator) is the responsibility of the calling method.
See also:
CATDMUsrMethod
o CheckOut
public Error CheckOut( const CATDMUsrInstance::LockType iLockType,
const char* iDuration=NULL,
const char* iComments=NULL,
const int iForce=0 )
Checks-out an object.

Role: Use this method to creates an exclusive or shared lock on the instance.

Parameters:
iLockType
Type of the lock to create, whether shared (simply locks the instance, making it impossible for anyone to modify it) or exclusive (making it possible for the current user - only - to modify the instance).
iDuration
Lock duration.
iComments
Comments.
iForce
Force exclusive check-out when other shared locks already exist; if force is not set when shared locks exist, an error is raised.
Returns:
Error structure. The short and long messages are valuated, their de-allocation (using the delete[] operator) is the responsibility of the calling method.
See also:
CATDMUsrMethod
o ComputeRevision
public Error ComputeRevision(CATUnicodeString& oNewRevision) const
Compute next revision number.

Role: Use this method to retrieve the revision number (or version number, for part objects) of the instace.

Parameters:
oRevision
Output next revision number.
Returns:
Error structure. The short and long messages are valuated, their de-allocation (using the delete[] operator) is the responsibility of the calling method.
See also:
CATDMUsrMethod
o CreateCSBProduct
public Error CreateCSBProduct()
Create CSB Product

Role: Use this method to create a CSB product.

Returns:
Error structure. The short and long messages are valuated, their de-allocation (using the delete[] operator) is the responsibility of the calling method.
See also:
CATDMUsrMethod
o CreateNewRevision
public Error CreateNewRevision(CATDMUsrInstance& oNewRevision,
const int iPartialCommit=0 )const
Creates a new revision of the instance.

Role: Use this method to create a new revison, or new version with same part number, for part objects, of the instance.

Parameters:
iPartialCommit
oNewRevision
Output revision instance.
Returns:
Error structure. The short and long messages are valuated, their de-allocation (using the delete[] operator) is the responsibility of the calling method.
See also:
CATDMUsrMethod
o CreateNewRevision
public Error CreateNewRevision( const char* iNewRevisionNumber,
CATDMUsrInstance& oNewRevision)const
Creates a new revision of the instance.

Role: Use this method to create a new revison, or new version with same part number, for part objects, of the instance.

Parameters:
iNewRevisionNumber
Revision number of the new object, which must respect the characters and increment policy declared for the application.. When not provided (empty string), the next valid revision number is automatically computed.
oNewRevision
Output revision instance.
Returns:
Error structure. The short and long messages are valuated, their de-allocation (using the delete[] operator) is the responsibility of the calling method.
See also:
CATDMUsrMethod
o CreateNewVersionDPN
public Error CreateNewVersionDPN( const int iNbAttribute,
const char** iAttributes,
const char** iValues,
CATDMUsrInstance& oNewVersion) const
Creates a new version different part number of the instance.

Role: Use this method to create a new version with different part number, for part objects, of the instance.

Parameters:
iNewRevisionNumber
oNewRevision
Output revision instance.
Returns:
Error structure. The short and long messages are valuated, their de-allocation (using the delete[] operator) is the responsibility of the calling method.
See also:
CATDMUsrMethod
o CreatePart
public static Error CreatePart( const char* iCaenv,
const int iNbAttribute,
const char** iAttributes,
const char** iValues,
CATDMUsrInstance& oPart)
Creates a new part instance.
Warning: attributes and valus used with this API must be compliant with your current profile. It means:
   - Attributes must be declared in $INSERTS variable,
   - Values must be compliant with authorized values if any.
 
Parameters:
iCaenv
Database environment.
iNbAttribute
Number of attributes (and values).
iAttributes
Attribute names.
iValues
Values.
oPart
Output part instance. Its de-allocation (using the delete operator) is the responsibility of the calling method.
Returns:
Error structure. The short and long messages are valuated, their de-allocation (using the delete[] operator) is the responsibility of the calling method.
See also:
CATDMUsrMethod
o CreateRepresentation
public static Error CreateRepresentation( const CATDMUsrInstance& iPart,
const CATDMUsrInstance::RepresentationSource iSource,
const char* iPath,
const char* iCatab,
const int iNbAttribute,
const char** iAttributes,
const char** iValues,
const char* iRepository,
CATDMUsrInstance& oRepresentation,
const int iOverwrite=0)
Creates a representation instance.

Role: Use this method to create a new representation instance. WARNING the representation should not be a V5 document To import V5 document in VPM, refer to the documentation

Parameters:
iPart
Parent part instance, which must already exist.
iSource
Representation source (cf.
RepresentationSource enumeration type).
iPath
Representation source path (for File source only).
iCatab
Representation table.
iNbAttribute
Number of attributes (and values).
iAttributes
Attribute names.
iValues
Values.
iRepository
Storage repository.
oRepresentation
Output representation instance. Its de-allocation (using the delete operator) is the responsibility of the calling method.
iOverwrite
Overwrite the representation if already existing in DB.
Returns:
Error structure. The short and long messages are valuated, their de-allocation (using the delete[] operator) is the responsibility of the calling method.
See also:
CATDMUsrMethod
o Delete
public Error Delete( const int iCallUserExit=1)
Deletes an instance.

Role: Use this method to delete an existing instance.

Parameters:
iCallUserExit
If true, method first invokes user-exit CATDMUsrMethod::AuthorizedCut() (for link objects from $EXT table) or CATDMUsrMethod::AuthorizedDelete() (other objects).
Returns:
Error structure. The short and long messages are valuated, their de-allocation (using the delete[] operator) is the responsibility of the calling method.
See also:
CATDMUsrMethod
o DeleteCSBProduct
public Error DeleteCSBProduct()
Delete CSB Product

Role: Use this method to delete a CSB product.

Returns:
Error structure. The short and long messages are valuated, their de-allocation (using the delete[] operator) is the responsibility of the calling method.
See also:
CATDMUsrMethod
o DeleteChild
public Error DeleteChild( const int iCallUserExit=1)
Delete link objects from $EXT table.
Parameters:
iCallUserExit
If true, method will invoke user-exit : CATDMUsrMethod::AuthorizedDelete().
Returns:
Error structure. The short and long messages are valuated, their de-allocation (using the delete[] operator) is the responsibility of the calling method.
See also:
CATDMUsrMethod
o Demote
public Error Demote()
Demotes an instance.

Role: Use this method to set the maturity of the instance to the next lower value in the authorized maturity list.

Returns:
Error structure. The short and long messages are valuated, their de-allocation (using the delete[] operator) is the responsibility of the calling method.
See also:
CATDMUsrMethod
o Duplicate
public Error Duplicate( const int iNbAttribute,
const char** iAttributes,
const char** iValues,
const CATDMUsrInstance::DuplicationType iType,
CATDMUsrInstance& oPart)const
Duplicates the instance.

Role: Use this method to duplicate a part instance.

Parameters:
iNbAttribute
Number of attributes (and values).
iAttributes
Attribute names.
iValues
Values.
iType
Duplication type, indicating if all associated data, including representations, or only assembly relations, should be copied to the new part (see: DuplicationType enumeration type).
oPart
Output part object.
Returns:
Error structure. The short and long messages are valuated, their de-allocation (using the delete[] operator) is the responsibility of the calling method.
See also:
CATDMUsrMethod
o ExtractLFIntoFile
public Error ExtractLFIntoFile( const CATUnicodeString& iFileName,
CATUnicodeString& oFileName,
const int iOverwrite=0,
const int iCheckSecurity= 1) const
Extracts a long field into a file. Role: Use this method to extract the long field associated to a representation, to a file.
Parameters:
iFileName
Full file name (path + name, without extension).
oFileName
Result file name (iFileName [+ extension])
iOverwrite
0 : if iFileName already exists, an error is returned.
1 : the model is always written, even when iFileName already exists 2 : extracts the twin model.
iCheckSecu
0 : Security is not checked
1 : Security is checked
Returns:
Error structure. The short and long messages are valuated, their de-allocation (using the delete[] operator) is the responsibility of the calling method.
See also:
CATDMUsrMethod
o GetAttributes
public Error GetAttributes(CATLISTV(CATUnicodeString)& oAttributes,
CATLISTV(CATUnicodeString)& oValues,
CATUnicodeString& oRepository,
CATLISTV(CATUnicodeString)* iExtraAttributes=NULL)
List attributes.

Method provides the list of the mandatory attributes for an insert operation.

Parameters:
oAttributes
Ouput list of attributes.
oValues
Values of the attributes.
oRepository
Value of attribute C_LAST_REPOSITORY
iExtraAttributes
Extra attributes to get
Returns:
Error structure. The short and long messages are valuated, their de-allocation (using the delete[] operator) is the responsibility of the calling method.
See also:
CATDMUsrMethod
o GetCaenv
public Error GetCaenv(char[9] oCaenv) const
Gets the instance environment.

Role: Use this method to retrieve the environment the instance belongs to.

Parameters:
oCaenv
Output environment name.
Returns:
Error structure. The short and long messages are valuated, their de-allocation (using the delete[] operator) is the responsibility of the calling method.
See also:
CATDMUsrMethod
o GetCatab
public Error GetCatab(char[19] oCatab) const
Gets the instance table.

Role: Use this method to retrieve the table of the instance.

Parameters:
oCatab
Output table name.
Returns:
Error structure. The short and long messages are valuated, their de-allocation (using the delete[] operator) is the responsibility of the calling method.
See also:
CATDMUsrMethod
o GetChildren
public Error GetChildren(int& oNbChild,
CATDMUsrInstance*& oChildren) const
Get instance children. Role: Use this method to retrieve instances pointed to by assembly links.
Parameters:
oNbChild
Number of children instances.
oChildren
Children instances. Its de-allocation (using the delete[] operator) is the responsibility of the calling method.
Returns:
Error structure. The short and long messages are valuated, their de-allocation (using the delete[] operator) is the responsibility of the calling method.
See also:
CATDMUsrMethod
o GetChildren
public Error GetChildren(int& oNbChild,
CATDMUsrInstance*& oChildren,
CATDMUsrInstance*& oLinks)const
Get instance children. Role: Use this method to retrieve instances pointed to by assembly links, as well as the assembly link instances themselves.
Parameters:
oNbChild
Number of children instances.
oChildren
Children instances. Its de-allocation (using the delete[] operator) is the responsibility of the calling method.
oLinks
Assembly link instances pointing to the children. Its de-allocation (using the delete[] operator) is the responsibility of the calling method.
Returns:
Error structure. The short and long messages are valuated, their de-allocation (using the delete[] operator) is the responsibility of the calling method.
See also:
CATDMUsrMethod
o GetCoid
public Error GetCoid(char[17] oCoid) const
Gets the instance $COID.

Role: Use this method to retrieve the internal $COID identifier of the instance, in hexa-decimal format.

Parameters:
oCoid
Output $COID.
Returns:
Error structure. The short and long messages are valuated, their de-allocation (using the delete[] operator) is the responsibility of the calling method.
See also:
CATDMUsrMethod
o GetCoid
public Error GetCoid(double& oCoid) const
Gets the instance $COID.

Role: Use this method to retrieve the internal $COID identifier of the instance, in raw (decimal) format.

Parameters:
oCoid
Output $COID.
Returns:
Error structure. The short and long messages are valuated, their de-allocation (using the delete[] operator) is the responsibility of the calling method.
See also:
CATDMUsrMethod
o GetCompid
public Error GetCompid(char[17] oCoid) const
Gets the instance $COMPID.

Role: Use this method to retrieve the internal $COID identifier of the instance, in hexa-decimal format.

Parameters:
oCompid
Output $COMPID.
Returns:
Error structure. The short and long messages are valuated, their de-allocation (using the delete[] operator) is the responsibility of the calling method.
See also:
CATDMUsrMethod
o GetCompid
public Error GetCompid(double& oCoid) const
Gets the instance $COMPID.

Role: Use this method to retrieve the internal $COID identifier of the instance, in raw (decimal) format.

Parameters:
oCompid
Output $COMPID.
Returns:
Error structure. The short and long messages are valuated, their de-allocation (using the delete[] operator) is the responsibility of the calling method.
See also:
CATDMUsrMethod
o GetInWorkRevision
public Error GetInWorkRevision(CATDMUsrInstance& oInWorkRevision,
const int iInSamePart=0) const
Gets the in-work revision of the instance.

Role: Use this method to retrieve the in-work revision (or version, for part objects) of the instance, e.g. the only revision or version that can be modified (older ones being locked by the application).

Parameters:
oInWorkRevision
Output in-work revision instance.
iInSamePart
When querying representation objects, tells whether the search should be local to the current parent part version, or global to all part versions (which is the default).
Returns:
Error structure. The short and long messages are valuated, their de-allocation (using the delete[] operator) is the responsibility of the calling method.
See also:
CATDMUsrMethod
o GetLastRevision
public Error GetLastRevision(CATDMUsrInstance& oLastRevision,
const int iInSamePart=0) const
Gets the last revision of the instance.

Role: Use this method to retrieve the last revision (or version, for part objects) of the instance. The resulting instance, though the lastest available, may not modifiable, depending on the mechanism (suite or reset) used to manage the revisions or versions.

Parameters:
oLastRevision
Output last revision instance.
iInSamePart
When querying representation objects, tells whether the search should be local to the current parent part version, or global to all part versions (which is the default).
Returns:
Error structure. The short and long messages are valuated, their de-allocation (using the delete[] operator) is the responsibility of the calling method.
See also:
CATDMUsrMethod
o GetLocks
public Error GetLocks( const int iUserLockOnly,
const CATUnicodeString& iView,
CATListValCATDMUsrInstance* oLocks,
const int iGetAllAttributes=0)
Get locks

Role: Use this method to get locks.

Parameters:
iUserLockOnly
If true, method will only seek locks inserted by the current VPM user.
iView
SQL view that should be used when querying the database ("", "S", "U", "D" or "I").
oLocks
Output locks list.
iGetAllAttributes
If true, method will retrieve the values of all existing attributes.
Returns:
Error structure. The short and long messages are valuated, their de-allocation (using the delete[] operator) is the responsibility of the calling method.
See also:
CATDMUsrMethod
o GetMaturity
public Error GetMaturity(char*& oMaturity,
int* oIsLocked=NULL) const
Gets the instance maturity.

Role: Use this method to retrieve the maturity of the instance.

Parameters:
oMaturity
Output maturity string. Its de-allocation (using the delete[] operator) is the responsibility of the calling method.
oIsLocked
If not null, contains the lock status of the object
Returns:
Error structure. The short and long messages are valuated, their de-allocation (using the delete[] operator) is the responsibility of the calling method.
See also:
CATDMUsrMethod
o GetName
public Error GetName(char*& oName) const
Gets the instance name.

Role: Use this method to retrieve the name of the instance, as defined by the $LIST_NAVIG profile variable.

Parameters:
oName
Output name. Its de-allocation (using the delete[] operator) is the responsibility of the calling method.
Returns:
Error structure. The short and long messages are valuated, their de-allocation (using the delete[] operator) is the responsibility of the calling method.
See also:
CATDMUsrMethod
o GetObjID
public Error GetObjID(ObjID& oObjectID) const
Gets the instance structure definition.

Role: Use this method to retrieve the instance structure definition (object ID), containing its environment, table and $COID/$COMPID identifiers.

See also:
CATDMUsrMethod
Parameters:
oObjectId
Output object ID.
Returns:
Error structure. The short and long messages are valuated, their de-allocation (using the delete[] operator) is the responsibility of the calling method.
See also:
CATDMUsrMethod
o GetParents
public Error GetParents(int& oNbParent,
CATDMUsrInstance*& oParents)const
Get instance parents.

Role: Use this method to retrieve the instances pointing on the current instance by assembly links.

Parameters:
oNbParent
Number of parent instances.
oParents
Parent instances. Its de-allocation (using the delete[] operator) is the responsibility of the calling method.
Returns:
Error structure. The short and long messages are valuated, their de-allocation (using the delete[] operator) is the responsibility of the calling method.
See also:
CATDMUsrMethod
o GetPreviousVersion
public Error GetPreviousVersion(CATDMUsrInstance& oPreviousInstances) const
Return the previous version of an instance.

Role: Use this method to retrieve the previous version of an instance.

Returns:
Error structure. The short and long messages are valuated, their de-allocation (using the delete[] operator) is the responsibility of the calling method.
See also:
CATDMUsrMethod
o GetRepresentations
public Error GetRepresentations(CATLISTV(CATDMUsrInstance)& oListRepresentations)
Get Representations

Role: Use this method to get the list of representations under the instance.

Returns:
Error structure. The short and long messages are valuated, their de-allocation (using the delete[] operator) is the responsibility of the calling method.
See also:
CATDMUsrMethod
o GetRevision
public Error GetRevision(char*& oRevision) const
Gets the instance revision number.

Role: Use this method to retrieve the revision number (or version number, for part objects) of the instace.

Parameters:
oRevision
Output revision number. Its de-allocation (using the delete[] operator) is the responsibility of the calling method.
Returns:
Error structure. The short and long messages are valuated, their de-allocation (using the delete[] operator) is the responsibility of the calling method.
See also:
CATDMUsrMethod
o GetUUID
public Error GetUUID(char[50] oUUID) const
Gets the instance UUID.

Role: Use this method to retrieve the instance UUID, structured as follows:

   Db name ( 8 characters)
   Caenv   ( 8           )
   Catab   (18           )
   $COID   ( 8           )
   $COMPID ( 8           )
 
Parameters:
oUUID
Output UUID.
Returns:
Error structure. The short and long messages are valuated, their de-allocation (using the delete[] operator) is the responsibility of the calling method.
See also:
CATDMUsrMethod
o GetValue
public Error GetValue( const char* const iAttribute,
char*& oValue)const
Gets the value of an attribute.

Role: Use this method to retrieve the value of a given attribute. The value may already be stored in memory, in the internal cache of the instance; otherwise, a database query is performed.

Parameters:
iAttribute
Attribute name.
oValue
Output value. Its de-allocation (using the delete[] operator) is the responsibility of the calling method.
Returns:
Error structure. The short and long messages are valuated, their de-allocation (using the delete[] operator) is the responsibility of the calling method.
See also:
CATDMUsrMethod
o GetValues
public Error GetValues(CATLISTV(CATUnicodeString)& ioAttributes,
CATLISTV(CATUnicodeString)& oValues)
Get attributes values.
Parameters:
ioAttributes
List of attributes to look for ; output list contains attributes that could be found.
oValues
Values of the attributes.
Returns:
Error structure. The short and long messages are valuated, their de-allocation (using the delete[] operator) is the responsibility of the calling method.
See also:
CATDMUsrMethod
o GetValues
public Error GetValues(int& oNbValue,
char**& oAttributes,
char**& oValues)const
Get the value of all attributes.

Role: Use this method to retrieve the value of all the attribute of the instance. The values may already be stored in memory, in the internal cache of the instance; otherwise, a database query is performed.

Parameters:
oNbValue
Number of values.
oAttributes
Output attribute names. Its de-allocation (using the delete[] operator, for the array and each of ite items) is the responsibility of the calling method.
oValues
Output values. Its de-allocation (using the delete[] operator, for the array and each of ite items) is the responsibility of the calling method.
Returns:
Error structure. The short and long messages are valuated, their de-allocation (using the delete[] operator) is the responsibility of the calling method.
See also:
CATDMUsrMethod
o InsertLock
public Error InsertLock( const CATLISTV(CATUnicodeString)& iAttributes,
const CATLISTV(CATUnicodeString)& iValues)
Lock insertion.

Role: Use this method to insert a lock.

Parameters:
iAttributes
Lock table ($LOCK) attributes to be inserted
iValues
Values matching above attributes
Returns:
Error structure. The short and long messages are valuated, their de-allocation (using the delete[] operator) is the responsibility of the calling method.
See also:
CATDMUsrMethod
o IsACSBProduct
public int IsACSBProduct()
Check CSB Product

Role: Use this method to see if the instance is a CSB product.

Returns:
1 if instance is a csb product, 0 otherwise.
o Promote
public Error Promote()
Promotes the instance.

Role: Use this method to set the maturity of the instance to the next higher value in the authorized maturity list.

Returns:
Error structure. The short and long messages are valuated, their de-allocation (using the delete[] operator) is the responsibility of the calling method.
See also:
CATDMUsrMethod
o Query
public static Error Query( const char* iCaenv,
const char* iCatab,
const char* iWhereClause,
int& oNbInstance,
CATDMUsrInstance*& oInstances)
Query instances.

Role: Use this method to query instances from the database.

Parameters:
iCaenv
Database environment.
iTable
Database table.
iWhereClause
Search where clause.
oNbInstance
Number of output instance(s).
oInstances
Output instance object(s). Its de-allocation (using the delete[] operator) is the responsibility of the calling method.
Returns:
Error structure. The short and long messages are valuated, their de-allocation (using the delete[] operator) is the responsibility of the calling method.
See also:
CATDMUsrMethod
o RemoveChild
public Error RemoveChild( const CATDMUsrInstance& iChild,
const char* iModification=NULL,
const int iKeepSameEffectivity=0 )
Deletes all assembly link(s) between two instances.

Role: Use this method to delete all existing assembly links defined between the current instance and a given child.

Parameters:
iChild
Child instance.
iModification
Configurable modification name.
iKeepSameEffectivity
Same effectivity will be used for configurable remove.
Returns:
Error structure. The short and long messages are valuated, their de-allocation (using the delete[] operator) is the responsibility of the calling method.
See also:
CATDMUsrMethod
o RemoveLink
public Error RemoveLink( const CATDMUsrInstance& iLink,
const char* iModification=NULL,
const int iKeepSameEffectivity=0 )
Deletes an assembly link between two instances.

Role: Use this method to delete a particular existing assembly link defined between the current instance and a given child.

Parameters:
iLink
Assembly link instance.
See also:
GetChildren
iModification
Configurable modification name.
iKeepSameEffectivity
Same effectivity will be used for configurable remove.

Returns:
Error structure. The short and long messages are valuated, their de-allocation (using the delete[] operator) is the responsibility of the calling method.
See also:
CATDMUsrMethod
o RemoveLink
public Error RemoveLink( const CATDMUsrInstance*& iLinks,
const int iNbLink,
const char* iModification=NULL,
const int iKeepSameEffectivity=0 )
Deletes assembly link between two instances.

Role: Use this method to delete a particular set of existing assembly link defined between the current instance and a given child.

Parameters:
iLinks
Array of assembly link instances
iNbLink
Number of links to remove
iModification
Configurable modification name.
iKeepSameEffectivity
Same effectivity will be used for configurable remove.

Returns:
Error structure. The short and long messages are valuated, their de-allocation (using the delete[] operator) is the responsibility of the calling method.
See also:
CATDMUsrMethod
o RemoveLocks
public Error RemoveLocks( const CATUnicodeString& iView="D",
const int iCallUserExit=1 ,
const int iUserLockOnly=0 )
Lock removal.

Role: Use this method to remove locks.

Parameters:
iView
SQL view that should be used when querying the database ("", "S", "U", "D" or "I").
iCallUserExit
If true, method will first invoke user-exit CATDMUsrMethod::AuthorizedCheckIn().
iUserLockOnly
If true, method only removes locks inserted by the current VPM user.
Returns:
Error structure. The short and long messages are valuated, their de-allocation (using the delete[] operator) is the responsibility of the calling method.
See also:
CATDMUsrMethod
o ReplaceChild
public Error ReplaceChild( const CATDMUsrInstance& iOldChild,
const CATDMUsrInstance& iNewChild,
const char* iModification=NULL,
const int iKeepSameEffectivity=0 )
Replaces an instance child.

Role: Use this method to update all existing assembly links pointing between the current instance and a given child, with another part instance.

Parameters:
iOldChild
Old child instance, to be replaced with new one.
iNewChild
New child instance, to replace old one.
iModification
Configurable modification name.
iKeepSameEffectivity
Copy effectivities from old to new link.
Returns:
Error structure. The short and long messages are valuated, their de-allocation (using the delete[] operator) is the responsibility of the calling method.
See also:
CATDMUsrMethod
o ReplaceChild
public Error ReplaceChild( const double iLinkCompid,
const CATDMUsrInstance& iNewChild,
const char* iModification=NULL,
const int iKeepSameEffectivity=0 )
Replaces an instance child.

Role: Use this method to update a particular, existing assembly link between the current instance and a given child, with another part instance.

Parameters:
iLinkCompid
$COMPID of the assembly link to update.
See also:
GetChildren
iNewChild
New child instance, to replace old one.
iModification
Configurable modification name.
iKeepSameEffectivity
Copy effectivities from old to new link.
Returns:
Error structure. The short and long messages are valuated, their de-allocation (using the delete[] operator) is the responsibility of the calling method.
See also:
CATDMUsrMethod
o SetMaturity
public Error SetMaturity( const char* const iMaturity)
Sets the instance maturity.

Role: Use this method to set the maturity of the instance to a new value, whether upwards (promotion) or downwards (demotion).

Parameters:
iMaturity
New maturity. string. This value must belong to the list of authorized maturity, as listed in the profile in use.
Returns:
Error structure. The short and long messages are valuated, their de-allocation (using the delete[] operator) is the responsibility of the calling method.
See also:
CATDMUsrMethod
o SetMaturity
public Error SetMaturity( const int iMaturity=0,
const int iConfirm=0)
o TransferLock
public Error TransferLock( const CATUnicodeString& iUser,
const CATUnicodeString& iOrganization,
const int iCheckSecurity= 1)
Transfert lock

Role: Use this method to transfert a lock of an instance you own.

Returns:
Error structure. The short and long messages are valuated, their de-allocation (using the delete[] operator) is the responsibility of the calling method.
See also:
CATDMUsrMethod Note that TransfertLock commit (or rollback if any error was raised) all modifications in database
o UpdateAttributes
public Error UpdateAttributes(CATLISTV(CATUnicodeString)& ioAttributes,
const CATLISTV(CATUnicodeString)& iValues,
const int iCallUserExit=1)
Attributes update.
Parameters:
ioAttributes
As an input, attributes to be updated ; as an output, attributes that could be updated.
iValues
Values with which attributes are to be updated.
iCallUserExit
If true, method will invoke user-exit : CATDMUsrMethod::AuthorizedUpdate().
Returns:
Error code.
o UpdateRelation
public Error UpdateRelation( const double* xmat=NULL,
const int iCallUserExit=1 ,
const int iCheckSecurity=1 )
Relation update.
Parameters:
xmat
Positionning matrix When xmat==NULL, identity matrix is used.
iCallUserExit
If true, method will invoke user-exit : CATDMUsrMethod::AuthorizedUpdate().
iCheckSecurity
If true, security check is performed ; only applicable when iCallUserExit is true.
Returns:
Error code.
o UpdateValues
public Error UpdateValues( const CATLISTV(CATUnicodeString)& iAttributes,
const CATLISTV(CATUnicodeString)& iValues)
Update Values

Role: Use this method to update the attributes of the instance.

Returns:
Error structure. The short and long messages are valuated, their de-allocation (using the delete[] operator) is the responsibility of the calling method.
See also:
CATDMUsrMethod
o WritePart
public static Error WritePart( const CATUnicodeString& iCaenv,
const CATListOfCATUnicodeString& iAttributes,
const CATListOfCATUnicodeString& iValues,
double* oCoid,
double* oCompid,
int iCheckCalls=1,
int iUpdate= 0)
Prepare a new part instance.
Warning: attributes and valus used with this API must be compliant with your current profile. It means:
   - Attributes must be declared in $INSERTS variable,
   - Values must be compliant with authorized values if any.
 
Parameters:
iCaenv
Database environment.
iNbAttribute
Number of attributes (and values).
iAttributes
Attribute names.
iValues
Values.
iCheckCalls
oCoid
Output coid instance.
oCompid
Output oCompid instance.
Returns:
Error structure. The short and long messages are valuated, their de-allocation (using the delete[] operator) is the responsibility of the calling method.
See also:
CATDMUsrMethod
o WriteRepresentation
public static Error WriteRepresentation( const CATUnicodeString& iCaenv,
const CATUnicodeString& iTableObject,
const CATUnicodeString& iFilename,
const CATListOfCATUnicodeString& iAttributes,
const CATListOfCATUnicodeString& iValues,
const int& iNbAttPart,
const int& iNbAttObject,
double* oCoid,
double* oCompid,
int iUpdate=0,
int iCheckCalls=1)
Write a new object instance.
Warning: attributes and valus used with this API must be compliant with your current profile. It means:
   - Attributes must be declared in $INSERTS variable,
   - Values must be compliant with authorized values if any.
 
Parameters:
iCaenv
Database environment.
iTableObject
Representation table
iFilename
Representation source path (for File source only).
iAttributes
Attribute names (att of part first, then att of object
iValues
Values. (val of part first, then val of object
iNbAttPart
Number of attributes of part (and values).
iNbAttObject
Number of attributes of object (and values).
iUpdate
<0> to upate
iCheckCalls
oCoid
Output coid instance.
oCompid
Output oCompid instance.
Returns:
Error structure. The short and long messages are valuated, their de-allocation (using the delete[] operator) is the responsibility of the calling method.
See also:
CATDMUsrMethod
o operator!=
public int operator!=( const CATDMUsrInstance& iInstance) const
Inequality operator.

Role: Compares an object instance with another one, according to their internal identifiers.

Parameters:
iInstance
Object instance to compare with.
Returns:
1 if the two objects are identical, 0 otherwise.
o operator=
public CATDMUsrInstance& operator=( const CATDMUsrInstance& iInstance)
Assignment operator.

Role: Assigns an instance object to another one.

Parameters:
iInstance
Object instance to copy.
Returns:
Assigned (current) object.
o operator==
public int operator==( const CATDMUsrInstance& iInstance) const
Equality operator.

Role: Compares an object instance with another one, according to their identifiers.

Parameters:
iInstance
Object instance to compare with.
Returns:
1 if the two objects are identical, 0 otherwise.

Enumerated Types


o DuplicationType
enum DuplicationType {
  Assembly,
  All
}
Parameters:
Assembly
All
o LockType
enum LockType {
  Exclusive,
  Shared
}
Parameters:
Exclusive
Shared
o RepresentationSource
enum RepresentationSource {
  Startup,
  File
}
Parameters:
Startup
File

This object is included in the file: CATDMUsrInstance.h
If needed, your Imakefile.mk should include the module: LV003DBA

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