Introduction
Usage : Propagate Composite Attributes to Containee attribute when associating contanee to Composite
Datasetup Resource Set :
- Diagram Resource
Datasetup Resource : Rule to manage Containee Attribute during its association to a Composite
Rule Example 1
Description
The following sample define the V_Description attribute of the containee according to the value of the attribute for the parent composite
Rule
/* Rule to get Composite Name ( Schematic_ManageComposite ) */
/* This Object Type= LogicalOccurrence */
// The following sample define the V_Description attribute of the containee according to the value of the attribute for the parent composite
Let FatherInstance(RFLVPMLogicalInstance)
Let ChildInstance(RFLVPMLogicalInstance)
Let FatherName(String)
Let FatherOccurence(LogicalOccurrence)
Set ChildInstance = ThisObject.Instance
Set FatherOccurence = Parameters->GetAttributeObject("Father")
Set FatherInstance = FatherOccurence.Instance
if(NULL <> ChildInstance and NULL <> FatherInstance)
{
//ChildInstance.SetAttributeString("V_description", FatherInstance.Name)
ChildInstance.SetAttributeString("V_Ref_IntegratedIn", FatherInstance.Name)
}3DXML
Rule Exemple 2
Description
The following sample define the V_Ref_IntegratedIn & instance Name attributes of the containee according to the value of the attribute from the parent composite
Rule
/* Rule to get Composite Name ( Schematic_ManageComposite ) */
/* This Object Type= LogicalOccurrence */
// The following sample define the V_Ref_IntegratedIn & instance Name attributes of the containee according to the value of the attribute for the parent composite
Let FatherInstance(RFLVPMLogicalInstance)
Let ChildInstance(RFLVPMLogicalInstance)
let FatherInstName (string)
Let FatherOccurence(LogicalOccurrence)
let IDNumber(String)
let TagNb(string)
// GET Container information
Set ChildInstance = ThisObject.Instance
Set FatherOccurence = Parameters->GetAttributeObject("Father")
Set FatherInstance = FatherOccurence.Instance
// DEFINE SEQUENCE NUMBER
// In context of the name of the Parent.
set FatherInstName=FatherInstance.Name
//Set IDNumber
IDNumber = GetUniqueKeyFromString(FatherInstName)
set TagNb= FatherInstName+"-" + IDNumber
// SET ATTRIBUTES
if(NULL <> ChildInstance and NULL <> FatherInstance)
{
//ChildInstance.SetAttributeString("V_description", FatherInstance.Name)
ChildInstance.SetAttributeString("V_Ref_IntegratedIn", FatherInstance.Name)
ChildInstance.SetAttributeString("PLM_ExternalID", TagNb)
}3DXML
