General InformationThe table below provides you with information related to the definition of the opening ID.
Input ObjectsInput objects must be of the following types:
Context Object Parameters
SampleThe following sample determines if a product or part is MAKE, BUY, or UDEF (undefined).
Let ObjectName(String)
Let ObjectID(String)
Let BUYSubStringToFind(String)
Let MAKESubStringToFind(String)
Let MakeOrBuy(String)
Let sCreateScope(String)
Let This_Reference(VPMReference)
Let Liste_Children(List)
/* new parameter to hold Parent product*/
Let iParentInstance(VPMInstance)
set ObjectName = ""
set ObjectID = ""
set BUYSubStringToFind = "BUY"
set MAKESubStringToFind = "MAKE"
set MakeOrBuy = "UDEF"
set sCreateScope="NO"
set This_Reference = ThisObject
if (true== Parameters.HasAttribute("ParentProductOcc"))
{
set iParentInstance = Parameters.GetAttributeObject("ParentProductOcc")
}
/* if the Parent Product is not implemented and its not UDEF, then the Parent Product is NULL */
if(iParentInstance == NULL)
{
if ( NULL == This_Reference)
{
Liste_Children = ThisObject.Children
if (Liste_Children->Size() > 0)
{
This_Reference = Liste_Children->GetItem(1)
}
}
if ( NULL == This_Reference)
{
ObjectName = ThisObject->GetAttributeString("V_Name") /* Used in RACE env */
ObjectID = ThisObject.PLM_ExternalID /* Used in Non-RACE env */
}
else
{
ObjectName = This_Reference->GetAttributeString("V_Name") /* Used in RACE env */
ObjectID = This_Reference.PLM_ExternalID /* Used in Non-RACE env */
}
if ( 0 <= ObjectName->Search(BUYSubStringToFind) OR 0 <= ObjectID->Search(BUYSubStringToFind))
{
set MakeOrBuy = "BUY"
}
else if ( 0 <= ObjectName->Search(MAKESubStringToFind) OR 0 <= ObjectID->Search(MAKESubStringToFind))
{
set MakeOrBuy = "MAKE"
set sCreateScope = "NO"
}
else
{
set MakeOrBuy = "UDEF"
}
}
else
{
/* if the Parent Product is already implemented and its UDEF, then Parent Product is not NULL and the children of its should not be implemented. */
/* So MakeorBuy is mentioned as Parent UDEF and children will not be implemented */
set MakeOrBuy = "PARENT-UDEF"
}
Parameters.SetAttributeString ("Make_or_Buy", MakeOrBuy)
Parameters.SetAttributeString ("CreateScope", sCreateScope)
| |||||||||||||||||||||||||||||