General InformationThis opening ID is invoked when the ISOGen Attribute mapping table is modified to handle customized attributes. This opening ID is used to customize the attributes. The 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
Sample
ThisObject=ProductOccurrence Parameters=RuleContext */ /* Declaration of Variable */ let ListISOAttributeNames_Attr(String) let ListISOAttributeNames(List) let ListAttributeValues_Attr(String) let ListAttributeValues(List) let ProductRef(VPMReference) let DS_ParamSet(AdvisorParameterSet) let ListParametersName(List) let ListParametersValue(List) let NbParameters(Integer) let ParamAttributeName(String) let index_ISO(Integer) let index_Param(Integer) let ISOAttributeName(String) let NbISOAttributes(Integer) let StrUnset(string) let bAttributeFound(Boolean) let PipingPartObj(Piping_Part_Occurrence) let PipingPipeObj(Piping_Pipe_Occurrence) let PipingSpool(Piping_Spool_Occurrence) /* initialize variable */ set ListAttributeValues_Attr = "ListAttributeValues" set ListISOAttributeNames_Attr = "ListISOAttributeNames" set StrUnset = "UNSET" set NbParameters = 0 set NbISOAttributes = 0 /* Retrieve the Reference Product */ set ProductRef = ThisObject.Reference /* Retrieve Parameters Set and number of Attribute inside*/ DS_ParamSet = ProductRef->Find ("AdvisorParameterSet","x.Name == \"DS_Export_PCF\"",TRUE) if (NULL <> DS_ParamSet) { ListParametersName = DS_ParamSet->ListAttributeNames("", true) NbParameters = ListParametersName.Size() } /* Retrieve the input list of ISO Attribute */ set ListISOAttributeNames = Parameters->GetAttributeObject(ListISOAttributeNames_Attr) NbISOAttributes = ListISOAttributeNames.Size() if (0 < NbISOAttributes) { /* Retrieve the value of parameters */ set ListParametersValue = DS_ParamSet.Parameters /* Loop on all ISO Attributes */ set index_ISO = 1 for index_ISO while index_ISO <= NbISOAttributes { /* Read ISO Attribute Name */ ISOAttributeName = ListISOAttributeNames.GetItem(index_ISO) /* Loop on Parameters */ set bAttributeFound = false set index_Param = 1 for index_Param while index_Param <= NbParameters { ParamAttributeName = ListParametersName.GetItem(index_Param) if (ISOAttributeName == ParamAttributeName) { ListAttributeValues.Append(ListParametersValue.GetItem(index_Param)) bAttributeFound = true break } if ( ("COMPONENT-ATTRIBUTE10" == ISOAttributeName) AND ("ISOCODE" == ParamAttributeName)) { ListAttributeValues.Append(ListParametersValue.GetItem(index_Param)) bAttributeFound = true break } } /* If the ISO attribute is not define in Parameters set */ if (false == bAttributeFound) { /* it can be the CATEGORY attribute */ if ("CATEGORY" == ISOAttributeName) { /* Retrieve the Spool from Piping Object */ set PipingPartObj = ThisObject if (NULL <> PipingPartObj) { PipingSpool = PipingPartObj.GetSpoolObject() } else { set PipingPipeObj = ThisObject if (NULL <> PipingPipeObj) { PipingSpool = PipingPipeObj.GetSpoolObject() } } /* Set the right value */ if (NULL <> PipingSpool) { ListAttributeValues.Append("FABRICATION") } else { ListAttributeValues.Append("ERECTION") } } else { /* it is not CATEGORY attribute, we must add <UNSET> string in output*/ ListAttributeValues.Append(StrUnset) } } } /* Set the result in output */ Parameters -> SetAttributeObject(ListAttributeValues_Attr, ListAttributeValues) } |