General InformationThis rule is invoked during the Generate MBOM and Synchronization manager command. Input ObjectsInputs for the rule must be of the following type: Parameters corresponds to the context object. The Parameter input object has two inputs registered in it: iDesignData - stores the Design object iMfgItemList - stores the list of Manufactured Objects from the Specification tree. It also has two Outputs registered in it: oMfgItemType -type string and stores the Manufactured Item type. oFatherMfgItem - object of type MfgProcessOccurrence stores the parent of the Manufactured Item created. SampleThe following example explains how to define the Manufactured Item type for the input design object and also how to define the Parent for the Manufactured Object to create. /* Creation Rule */ let ListOfMfgItem(List) let ProcOcc(MfgProcessOccurrence) let oFatherProcOcc(MfgProcessOccurrence) let ProcRef(DELFmiFunctionReference) let ProductRef(VPMReference) let ProductOcc(ProductOccurrence) let nbOfMfgItem(Integer) let i(Integer) let j(Integer) let idx(Integer) let sDesc(String) let sName(String) let oMfgItemType(String) let sAttrForType(String) // Get input design data and Mfg Items list set ProductOcc = Parameters.GetAttributeObject("iDesignData") set ListOfMfgItem = Parameters.GetAttributeObject("iMfgItemList") set nbOfMfgItem = ListOfMfgItem.Size() set i=1 set j=1 set sAttrForType = "" set sDesc = "" set oMfgItemType = "" set oFatherProcOcc = NULL if( ProductOcc <> NULL ) { ProductRef = ProductOcc.Reference if(ProductRef <> NULL) { // Get description attribute of input design data sDesc = ProductRef.GetAttributeString("V_description") for j while j<=nbOfMfgItem { idx = -1 ProcOcc = ListOfMfgItem[j] if(ProcOcc <> NULL) { ProcRef = ProcOcc.Reference if(ProcRef <> NULL) { sName = "" sName = ProcRef.V_Name if( sName.Length()>0 and sDesc.Length()>0) { idx = sName.Search(sDesc) // Check description is same with Mfg. Item name if(idx <> -1) { // Set parent Mfg. Item and Mfg Item type as Provided Part oFatherProcOcc = ProcOcc oMfgItemType = "Provide" break } else if(sDesc.Search("MfgKit") <> -1) { // Set empty parent Mfg. Item // Just set Mfg Item type as Manufacturing Kit oFatherProcOcc = NULL oMfgItemType = "CreateKit" } } } } } } } Parameters.SetAttributeObject("oFatherMfgItem", oFatherProcOcc) Parameters.SetAttributeString("oMfgItemType", oMfgItemType) |