General InformationThis rule is invoked during Generate Operations by Catalog command. Input ObjectsInputs for the rule must be of the following type: Object of type MfgProcessOccurrence Input of type List which holds a list of Operations occurrence. Parameters corresponds to the context object. The Parameter input object has one output registered in it: ohOperationOcc, which stores the Operation occurrence.
SampleThe following example explains how to define the type of Operation based on the name entered in the Description attribute of the input Manufactured Item. /* Operation Rule */ let hProcessRef(DELFmiFunctionReference) let hOperationOcc(ProdSystemOccurrence) let hOperationRef(PLMOperation) let sDescription(String) let nbOfOperations(Integer) let ii(Integer) let sOperationTitle(String) let idx(Integer) if(ihProcessOcc <> NULL) { set hProcessRef = ihProcessOcc.Reference if(hProcessRef <> NULL) { set sDescription = hProcessRef->GetAttributeString("V_description") set nbOfOperations = iListOfOperations.Size() set ii = 1 for ii while ii <= nbOfOperations { set hOperationOcc = iListOfOperations.GetItem(ii) if(hOperationOcc <> NULL) { set hOperationRef = hOperationOcc.Reference set sOperationTitle = hOperationRef->GetAttributeString("V_Name") if( sOperationTitle.Length()>0 and sDescription.Length()>0) { idx = sDescription.Search(sOperationTitle) if(idx <> -1) { Parameters.SetAttributeObject("ohOperationOcc", hOperationOcc) set ii = nbOfOperations } } } } } } |