Rule to Filter Logical Ports Allowed to Be Connected (Schematic_FilterLogicalPortsToConnect)

An opening ID is an entry point used to customize business logic. The Schematic_FilterLogicalPortsToConnect opening ID is used to define the ports that can be connected to a routable.

Note: For more information about customization by business rules, see Customization by Business Rules.

This page discusses:

General Information

This opening ID is invoked during the routing process while selecting a port or a component.

Definition Description
PLM Opening ID Schematic_FilterLogicalPortsToExpose
Customization intent Computation
Execution context Client

Input Objects

Input objects must be of the following types:

  • ThisObject: Source Object Reference
  • Parameters corresponds to the context object.

Context Object Parameters

Parameter Name Type Read or Write Comments
Source_Object_Occ (Input) Logical Occurrence Read Occurrence of the source if available, else NULL (route). This is the routable occurrence which is used for routing. It is sent only when the route is already instantiated, else NULL.
Source_Father_Occ (Input) Logical Occurrence Read Occurrence of the father of the source object, where the object may be already created or will be created
Target_Object_Occ (Input) Logical Occurrence Read Occurrence of the target component. This is the occurrence of component which is selected while routing).
PortList_Target (Input) List Read List of the ports of the target component. This is the filtered list of the ports of the equipment after doing basic compatibility checks for schematics.
List_Boolean_Ports (Output) List Write List of Boolean indicating if the port to is allowed to be exposed or not.

It must be mapped with PortList_Target.

Note: The opening ID can be define to exclude some type of ports If the opening ID is not attached to the Rule to Filter Logical Ports to Be Exposed resource, all ports are exposed by default. If the opening ID is defined but fails, no ports are exposed.

Exposing Ports

The folllowing rule checks whether the routable and component are from same system (internal connection) or from a different system (external connection).

If it is an external connection, the Boolean is set as TRUE (in output list) only for the ports with name External_Port, else the Boolean is set as FALSE.

Similarly, for an internal connection, the Boolean is set as FALSE (in output list) for all the ports with name External_Port else, the Boolean is set as TRUE.

This means for internal connection that all the ports with External_Port as a name as are not valid.

//Get father occurrence of source object as input
let SourceFatherOccObject (LogicalOccurrence)
set SourceFatherOccObject = Parameters.GetAttributeObject ("Source_Father_Occ")

//Compute father reference of source object
let SourceFatherRefObject(RFLVPMLogicalReference)
set SourceFatherRefObject = SourceFatherOccObject.Reference

//Get occurrence of target object as input
let TargetOccObject(LogicalOccurrence)
set TargetOccObject = Parameters.GetAttributeObject ("Target_Object_Occ")

//Compute father occurrence of target object
let TargetFatherOccObject(LogicalOccurrence)
set TargetFatherOccObject = TargetOccObject.Owner

//Compute father reference of target object
let TargetFatherRefObject(RFLVPMLogicalReference)
set TargetFatherRefObject = TargetFatherOccObject.Reference

//Get list of ports of target object as input. This is the filtered list of ports of target object after doing basic compatibility checks for schematics
let PortListOfTarget(LIST)
set PortListOfTarget = Parameters.GetAttributeObject ("PortList_Target")

Let isize = 0
set isize = PortListOfTarget->Size()
Let j = 1

let OutputBooleanPortList(List)

//Loop over list of ports of target object
for j while j <= isize
{
                let PortObject(RFLVPMLogicalPort)
                set PortObject = PortListOfTarget->GetItem(j)
                
                let PortName(String)
                
                //Get attribute V_Name of the port
                set PortName = PortObject.PLM_ExternalID
                
                //Check if source and target are in same system
                if (TargetFatherRefObject == SourceFatherRefObject) //Same system
                {
                                //If V_Name matches with string “External_Port” Its an external port
                                if(PortName like '*External_Port*' )
                                {
                                                OutputBooleanPortList.Append(FALSE)
                                }
                                //Its an internal port
                                else
                                {
                                                OutputBooleanPortList.Append(TRUE)
                                }               
                }
                //different system
                else
                {
                                //Its an external port
                                if(PortName like '*External_Port*')
                                {
                                                OutputBooleanPortList.Append(TRUE)
                                }
                                //Its an internal port
                                else
                                {
                                                OutputBooleanPortList.Append(FALSE)
                                }               
                }
}

Parameters.SetAttributeObject("List_Boolean_Ports", OutputBooleanPortList)

Authorized Port for the Connection with Nozzle

The following example shows how to filter the ports of a component that is allowed to be connected to a nozzle.

Notify("Filter Ports rule start")

let SourceFatherOccObject (LogicalOccurrence)
set SourceFatherOccObject = Parameters.GetAttributeObject ("Source_Father_Occ")

//Compute father reference of source object
let SourceFatherRefObject(RFLVPMLogicalReference)
set SourceFatherRefObject = SourceFatherOccObject.Reference

//Get occurrence of target object as input
let TargetOccObject(LogicalOccurrence)
set TargetOccObject = Parameters.GetAttributeObject ("Target_Object_Occ")

//Compute father occurrence of target object
let TargetFatherOccObject(LogicalOccurrence)
set TargetFatherOccObject = TargetOccObject.Owner

//Compute father reference of target object
let TargetFatherRefObject(RFLVPMLogicalReference)
set TargetFatherRefObject = TargetFatherOccObject.Reference

let SourceNozzleRef(Piping_Logical_Nozzle)
set SourceNozzleRef = ThisObject

let TargetReference(EnsLogicalEquipment)
set TargetReference = TargetOccObject.Reference

if (NULL <> SourceNozzleRef) AND (NULL <> TargetReference)
{
// Use business logic for filtering ports while nozzle placement.
// We have strictly checked here if nozzle is being placed on equipment

//Get list of ports of target object as input. This is the filtered list of ports of target object after doing basic compatibility checks for schematics
let PortListOfTarget(LIST)
set PortListOfTarget = Parameters.GetAttributeObject ("PortList_Target")

Let isize = 0
set isize = PortListOfTarget->Size()
Let j = 1
let OutputBooleanPortList(List)

//Loop over list of ports of target object
for j while j <= isize
{
	let PortObject(RFLVPMLogicalPort)
	set PortObject = PortListOfTarget->GetItem(j)
                
	let PortName(String)
                
	//Get attribute V_Name of the port
	set PortName = PortObject.PLM_ExternalID

	let returnedIndex(integer)
	returnedIndex = PortName.Search("PortForNozzle",0,true)

	if(returnedIndex <> -1)
	{
		OutputBooleanPortList.Append(TRUE)
	}
	else
	{
		OutputBooleanPortList.Append(FALSE)
	}			
}

Notify("Nozzle placement logic")
Parameters.SetAttributeObject("List_Boolean_Ports", OutputBooleanPortList)
}
else
{
	// Use business logic for fitering ports while routing.
	Notify("Routing logic")
}
Notify("Filter Ports rule end")

In the sample rule above, the following logic is applied:

  • Check if the target component port has a PortForNozzle string and identify it as allowed for connection to a nozzle.
  • From the PortList_Target (Input) list which has a one to one mapping with the List_Boolean_Ports (Output) list, the first allowed port is always considered for connection.