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
SampleIn the following sample, the parent item is retrieved from the MBOM structure when creating a new node using the CUMA command.
/* Inputs */ Let iPart(ProductOccurrence) let iFirstUpperScopedMfgItem(MfgProcessOccurrence) let iImplementingMfgItemRef(DELFmiFunctionReference) let iParentMfgItemOccList(List) /* Output */ let oMfgItemOccurence(List) Let MfgItemInstance(DELFmiFunctionInstance) let ParentMfgItemRef(DELFmiFunctionReference) /* intermediate nodes */ let MfgItemOccChild(MfgProcessOccurrence) let listChilds(List) let listChilds2(List) Let PartDescription(String) Let ParentMfgItemName(String) Let PartInstance(VPMInstance) Let MfgItemDescription(String) Let index(Integer) Let index2(Integer) let Validation(Boolean) set Validation = false set PartDescription ="" set ParentMfgItemName ="" let MymfgItemOcc (MfgProcessOccurrence) set iPart = ThisObject if ( NULL <> iPart) { PartInstance = iPart.Instance if (PartInstance <> NULL) { PartDescription = PartInstance->GetAttributeString("V_description") ParentMfgItemName = PartInstance.V_Name } } if (true== Parameters.HasAttribute("UpperScopedMfgItem")) { set iFirstUpperScopedMfgItem = Parameters.GetAttributeObject("UpperScopedMfgItem") } if (true== Parameters.HasAttribute("iParentMfgItemOccList")) { set iParentMfgItemOccList = Parameters.GetAttributeObject("iParentMfgItemOccList") } if (true== Parameters.HasAttribute("ImplementingMfgItemRef")) { set iImplementingMfgItemRef = Parameters.GetAttributeObject("ImplementingMfgItemRef") } set index = 1 if(PartDescription <> "") { for index while index <= iParentMfgItemOccList->Size() { set MfgItemOccChild = iParentMfgItemOccList->GetItem(index) if(NULL <> MfgItemOccChild) { MfgItemDescription = MfgItemOccChild->GetAttributeString("V_description") if(0 <= PartDescription.Search(MfgItemDescription, 0, true)) { oMfgItemOccurence.Append(MfgItemOccChild) Parameters.SetAttributeObject("OutputParentMfgItemOcc", oMfgItemOccurence) Validation=true break } } } } if(PartDescription <> "") { if(false == Validation ) { ParentMfgItemRef = new("CreateAssembly",ParentMfgItemName,NULL) if(NULL <> ParentMfgItemRef) { set MymfgItemOcc = iFirstUpperScopedMfgItem-> InsertPredecessor(ParentMfgItemRef) if(MymfgItemOcc <> NULL) { MfgItemInstance = MymfgItemOcc.Instance if(NULL <> MfgItemInstance) { MfgItemInstance.V_description = PartDescription } oMfgItemOccurence.Append(MymfgItemOcc) Parameters.SetAttributeObject("OutputParentMfgItemOcc", oMfgItemOccurence) Validation=true iParentMfgItemOccList.Append(oMfgItemOccurence) } } } } |