General InformationThis business rule applies when listing the mechanical accessories of a device. It lets you filter the resulting list of mechanical accessories.
Input ObjectsThe input objects must be of the following types:
Context Object Parameters
SampleYou can filter out piping parts, which are considered as mechanical accessories in the data structure. As a result, when listing connected mechanical accessories, piping parts are excluded from the results.
Let InList (List)
Let OutList (List)
Let Size (Integer)
Let i (Integer)
Let AccOcc (ProductOccurrence)
Let ValveOcc (Piping_Part_Occurrence)
Let Kept (Integer)
InList = Parameters->GetAttributeObject("iListofMechanicalAccessories")
Size = 0
Kept = 0
If (InList <> NULL)
{
Size = InList.Size()
i = 1
For i While i <= Size
{
AccOcc = InList->GetItem(i)
Set ValveOcc = AccOcc
If (ValveOcc == NULL)
{
OutList.Append(AccOcc)
Kept = Kept + 1
}
i = i + 1
}
}
Parameters->SetAttributeObject("oListOfFilteredMechanicalAccessories", OutList)
Parameters->SetAttributeString("Message", "Filtered=" + ToString(Kept) + "/" + ToString(Size))
Parameters->SetAttributeInteger("Severity", 0)
| |||||||||||||||||||||||||||||||