Rule to Filter Instantiation Context (Schematic_FilterInstantiationContext)

An opening ID is an entry point used to customize business logic. The Schematic_FilterInstantiationContext opening ID is used to manage the context for instantiation of new or existing components.

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

This page discusses:

General Information

This opening ID is invoked when using one of the following commands:

  • Insert New Logical Component
  • Insert Existing Logical Component
  • Insert From Catalog
  • Insert From Library
  • Manipulate Symbols when the objects are instantiated in the active context.
    Note: When you select the Instantiate or Duplicate options in the Manipulation Options Chooser dialog box, the objects are instantiated in the same context as the selected object. The Schematic_FilterInstantiationContext opening ID is ignored.

The rule is also invoked for all the scenarios where the instantiation context is taken from the Data Information panel like the Insert From Catalog or the Insert From Library. It gives you the information about the current instantiation.

This opening ID is used to control the instantiation context when you insert a new or an existing component.

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

Input Objects

Input objects must be of the following types:

  • ThisObject
  • Parameters corresponds to the context object.

Context Object Parameters

Parameter Name Type Read or Write Comments
Fact object (Input) LogicalOccurrence Read The logical occurrence of the active system.
List_Contexts (Input) List(string) Read List of the PLM Instances of the available contexts under the active root. For the root, the reference is not considered.
List_Bool_IsValidContext (Output) List Write List of Booleans which identifes the input context in the list as valid or not. The list of Boolean must be mapped to the list of PLM instances given as input.

Sample

In the following sample, the rule returns TRUE for root reference and for all instances which do not have DUMMY in their Instance Title attribute, else it returns FALSE for all other cases.

let InputContextList(List)
set InputContextList=Parameters->GetAttributeObject("List_Contexts")
let OutputContextList(List)
Let isize = 0
set isize = InputContextList->Size()
Let j = 1
Notify("Rule Schematic_FilterInstantiationContext executed")
for j while j <= isize
{
	let RootContextRefObject(RFLVPMLogicalReference)
	set RootContextRefObject = InputContextList->GetItem(j)

	if(NULL <>  RootContextRefObject)
	{
		OutputContextList.Append(TRUE)
	}
	else
	{
		let ContextInstObject(RFLVPMLogicalInstance)
		set ContextInstObject = InputContextList->GetItem(j)
		let ContextName(String)
		set ContextName = ContextInstObject.PLM_ExternalID
		if(ContextName like '*DUMMY*' )
		{
			OutputContextList.Append(FALSE)
		}
		else
		{
			OutputContextList.Append(TRUE)
		}
	}
}

Parameters.SetAttributeObject("List_Bool_IsValidContext", OutputContextList)