ProductStructureInterfaces Interface CATIPLMProducts

Usage: an implementation of this interface is supplied and you must use it as is. You should not reimplement it.


interface CATIPLMProducts

Interface to navigate and modify the Product Structure model.

Role: It enables to navigate on model in the "Ancestor->Children" direction. It also enables to build and modify a Product Structure by adding one or several Products, removing or replacing Product Instances.
This interface manages either Product Instance or Product Reference. Each method documentation specifies its own product requirement.


Method Index


o AddProduct(CATIPLMProducts*,CATBaseUnknown*&,IID&,CATPrdEditionParameters*)
Adds a Product to a Product Reference.
o AddProducts(CATListValCATBaseUnknown_var&,CATListValCATBaseUnknown_var&,CATPrdEditionParameters*)
Adds a list of Products to a Product Reference.
o Count(int&)
Retrieves the direct children count.
o GetProductByName(CATUnicodeString&,CATIPLMProducts*&)
Retrieves a Product Instance from its name.
o Iterator(CATIPrdIterator*&,IID&,CATBoolean)
Creates an iterator to navigate on direct children.
o RemoveProduct(CATIPLMProducts*,CATPrdEditionParameters*)
Removes a Product Instance.
o RemoveProductByName(CATUnicodeString&,CATPrdEditionParameters*)
Removes a Product Instance from its name.
o ReplaceProduct(CATIPLMProducts*,CATIPLMProducts*,CATBoolean,CATIPLMProducts*&,CATPrdEditionParameters*)
Replaces a given Product Instance with another one.
o VisitChildren(CATIVisitor*)
Visits direct children.

Methods


o AddProduct
public virtual AddProduct( ipReference,
opInstance,
const iIID= IID_CATIPrdObject,
const iParameters= NULL)
Adds a Product to a Product Reference.
Role: This method instanciates the given Product Reference and aggregates the newly created instance under the calling Product (this). PLM Attributes of created instance are initialized using Business Logic "IdentificationInitialization".
This method must be only called on a Product Reference.
Parameters:
ipReference
The Product Reference to be instanciated.
opInstance
[out, CATBaseUnknown#Release] The newly created and aggregated Product Instance.
iIID
The interface IID to query on the returned object.
Legal values: It should be expressed as IID_CATIXX, where CATIXX is the interface to which a pointer is requested (IID_CATIPrdObject by default)
For example :
CATIPLMProducts * ipSubProductRef = ... ;
CATBaseUnknown * pNewInstance = NULL;
if (SUCCEEDED(pRefTarget->AddProduct(ipSubProductRef, pNewInstance, IID_CATIMyInterface )))
{
	CATIMyInterface * pMyInterfaceOnNewInstance = (CATIMyInterface *) pNewInstance;
	...
	pNewInstance->Release(); pNewInstance = NULL;
}
iParameters
Reserved for future use, must be specified as NULL.
Returns:
An HRESULT value.
Legal values:
S_OK
The Product Reference was successfully added and the interface pointer is successfully returned
E_INVALIDARG
Either ipReference or this is not a Product Reference
E_FAIL
The Product Reference was not successfully added
o AddProducts
public virtual AddProducts( ispReferences,
oAddedInstancesList,
const iParameters= NULL)
Adds a list of Products to a Product Reference.
Role: This method instanciates each Product Reference and aggregates these newly created instances under this. PLM Attributes of each created instance are initialized using Business Logic "IdentificationInitialization".
This method must be called on a Product Reference.
Parameters:
ispReferences
The list of Product References to be instanciated.
oAddedInstancesList
The set of newly created and aggregated instances.
iParameters
Reserved for future use, must be specified as NULL.
Returns:
An HRESULT value.
Legal values:
S_OK
The Product References were successfully added
E_INVALIDARG
Either at least one element of ispReferences or this is not a Product Reference
E_FAIL
All Product References were not successfully added
o Count
public virtual Count( oNbChildren)
Retrieves the direct children count.
Role: This method retrieves the direct children count either of a Reference or an Instance Product.
To retrieve these children themselves, use the method.
Parameters:
oNbChildren
The count of direct children.
Returns:
An HRESULT value.
Legal values:
S_OK
The count was successfully retrieved
E_FAIL
Otherwise
o GetProductByName
public virtual GetProductByName( iInstanceName,
opInstance)
Retrieves a Product Instance from its name.
Role: This method performs a search through the direct children of this.
Parameters:
iInstanceName
The name of the Product Instance to retrieve.
This name can be obtained by using the
method.
opInstance
[out, CATBaseUnknown#Release] The searched Product Instance.
Returns:
An HRESULT value.
Legal values:
S_OK
The Product Instance was successfully retrieved
E_FAIL
Otherwise
o Iterator
public virtual Iterator( opIterator,
const iIID= IID_CATIPrdObject,
iOnlyActiveFilter= FALSE)
Creates an iterator to navigate on direct children.
Role: This method creates an iterator which enables to scan direct children.
Do not modify the Product Structure (by removing, replacing or adding children for example) while scanning children with an iterator !
See also:
Parameters:
opIterator
[out, CATBaseUnknown#Release] The created iterator.
iIID
The interface IID to query on the children managed by the iterator.
Legal values: It should be expressed as IID_CATIXX, where CATIXX is the interface to which a pointer is requested (IID_
by default)
For example :
CATIPLMProducts * pMyCurrentProduct = ... ;
CATIPrdIterator * pIterator = NULL;
if (SUCCEEDED(pMyCurrentProduct->Iterator(pIterator, IID_CATIMyInterface )))
{
	CATIMyInterface * pMyInterfaceOnChildren = NULL;
	while (SUCCEEDED(pIterator->Next(pMyInterfaceOnChildren)))
	{
		...
		pMyInterfaceOnChildren->Release(); pMyInterfaceOnChildren = NULL;
	}
	pIterator->Release(); pIterator = NULL;
}
iOnlyActiveFilter
Legal values:
TRUE
To return only activated products
FALSE
To return all products. This is the default value
Returns:
An HRESULT value.
Legal values:
S_OK
The iterator was successfully created
E_FAIL
The iterator creation failed
o RemoveProduct
public virtual RemoveProduct( ipInstanceToRemove,
const iParameters= NULL)
Removes a Product Instance.
Role: This method removes a Product Instance aggregated by this which is a Product Reference.
This method must be called on a Product Reference and ipInstanceToRemove must be one of its first Product Instances.
Parameters:
ipInstanceToRemove
The Product Instance to remove, aggregated by this.
iParameters
Reserved for future use, must be specified as NULL.
Returns:
An HRESULT value.
Legal values:
S_OK
The Product Instance was successfully removed
E_INVALIDARG
Either this is not a Reference Product, or ipInstanceToRemove is not a direct child of this
E_FAIL
The Product Instance was not successfully removed
o RemoveProductByName
public virtual RemoveProductByName( iInstanceName,
const iParameters= NULL)
Removes a Product Instance from its name.
Role: This method removes a Product Instance aggregated by this from its name.
This method must be called on a Product Reference and iInstanceName must be the name of one of its first Product Instances.
Parameters:
iInstanceName
The name of the Product Instance to remove.
This name can be obtained by using
method.
iParameters
Reserved for future use, must be specified as NULL.
Returns:
An HRESULT value.
Legal values:
S_OK
The Product Instance was successfully removed
E_INVALIDARG
this is not a Product Reference
E_FAIL
Either iInstanceName is not the name of a direct child of this, or the Product Instance was not successfully removed
o ReplaceProduct
public virtual ReplaceProduct( ipOldInstance,
ipNewReference,
iAllInstances,
opNewInstance,
const iParameters= NULL)
Replaces a given Product Instance with another one.
Role: This method instanciates a given Product Reference and replaces the given old instance by this newly created Product Instance.
It must be called on a Product Reference.
Parameters:
ipOldInstance
The old Product Instance to be replaced. It must be a direct child of this.
ipNewReference
The replacing Reference Product.
iAllInstances
Legal values:
TRUE
If the Reference Product of ipOldInstance is multi-instanciated, replace is performed on each of all loaded instances
FALSE
Replace is performed on ipOldInstance only
opNewInstance
[out, CATBaseUnknown#Release] The new Product Instance replacing the old one given in argument.
iParameters
Reserved for future use, must be specified as NULL.
Returns:
An HRESULT value.
Legal values:
S_OK
The Product Instance was successfully replaced
E_INVALIDARG
this is not a Product Reference
E_FAIL
Otherwise
o VisitChildren
public virtual VisitChildren( ipVisitor)
Visits direct children.
Role: This method scans all direct children of this with a and performs the Visit method of the given visitor on each of them.
It can be called either on a Product Instance or a Product Reference.
Parameters:
ipVisitor
The children visitor whose Visit method will be applied on children.
Returns:
An HRESULT value.
Legal values:
S_OK
The visit was successfully completed
E_FAIL
Otherwise

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

Copyright © 1999-2014, Dassault Systèmes. All rights reserved.