Context Object Parameters
Parameter Name |
Type |
Read or Write |
Comments |
PhysicalContext |
ProductOccurrence |
Read |
Physical context in which the parent is to be searched or
created newly created 3D product instance |
PhysicalParentName |
String |
Read |
Name of the expected 3D parent, which can be used for object
creation. |
ListOfPhysicalParentType |
List |
Read |
List of names of the types allowed as parent of the item. The
business rule should create or search an object with one of these types. |
PhysicalGrandParentName |
String |
Write |
Name of the grand-parent instance. Instance with the same name
as this output will be searched. If found, it will be considered as grand-parent for
manual creation of parent. |
PhysicalGrandParentProduct |
ProductOccurrence |
Write |
The grand-parent occurrence in which parent is expected. The
usage of this output is explained below:
- If this output is valuated along with the
PhysicalParent
output,the right occurrence of the output parent will be searched inside
PhysicalGrandParentProduct
- If this output is valuated without the
PhysicalParent output,
this output will be considered as grand-parent for manual creation of
parent.
|
PhysicalParent |
VPMInstance |
Write |
Computed or created 3D product instance. This output will be used to set as
“Expected 3D Parent”. |
Sample
let ProductOcc(ProductOccurrence)
let ChildProductOccurrence(ProductOccurrence)
let listChild(LIST)
let nbChild(INTEGER)
let index(INTEGER)
let sMessage(STRING)
let Child(Feature)
let ListParentProductTypeNameValue(List)
let bParentcreated(BOOLEAN)
let ReferenceNameValue(String)
let ownerRef(VPMReference)
let CurrentReference(VPMReference)
let newInst(VPMInstance)
let ParentReferenceNameValue(String)
let GrandParentReferenceNameValue(String)
let ParentProductTypeNameValue(String)
set bParentcreated=false
ProductOcc=Parameters.GetAttributeObject("PhysicalContext")
listChild=ProductOcc.Children
set nbChild=listChild->Size()
set index =1
for index while index <= nbChild
{
set Child=listChild->GetItem(index)
if ((Child <> NULL) and (bParentcreated == false))
{
set ChildProductOccurrence= Child
set CurrentReference = ChildProductOccurrence.Reference
if (ChildProductOccurrence <> NULL and "Cabin_1" == CurrentReference.Name)
{
ParentReferenceNameValue = Parameters.GetAttributeString("PhysicalParentName")
ListParentProductTypeNameValue = Parameters.GetAttributeObject("ListOfPhysicalParentType")
ParentProductTypeNameValue = ListParentProductTypeNameValue->GetItem(1)
newInst=new("VPMInstance",ParentReferenceNameValue +DateFormat("%H%M%S",BuildDate()), ChildProductOccurrence.Reference,new(ParentProductTypeNameValue, ParentReferenceNameValue, NULL))
Parameters.SetAttributeObject("PhysicalGrandParentProduct", ChildProductOccurrence)
Parameters.SetAttributeObject("PhysicalParent", newInst)
bParentcreated = true
}
}
}
if (NULL == newInst)
{
set GrandParentReferenceNameValue="Physical Root"
Parameters.SetAttributeString("PhysicalGrandParentName", GrandParentReferenceNameValue)
}
if (bParentcreated == false)
{
sMessage = "Enitity parent not created"
Parameters.SetAttributeInteger("Severity", 2)
Parameters.SetAttributeString("Message", sMessage)
}