Mapping Rule (MappingRule)

An opening ID is an entry point used to customize business logic. A mapping rule lets you manage the mapping of planes when a reference plane system is replaced and synchronized with another one.

Note: For more information about customization by business rules, see Installation and Setup: Customize: Behavior: Data Setup: Customization by Business Rules.

This page discusses:

General Information

This opening ID is invoked when you replace a reference plane system with another one during synchronization.

This opening ID is used to customize:

  • The comparison between existing planes and new planes.
  • The mapping of planes.

The table below provides you with information related to the definition of the Opening ID.

PLM Opening ID: MappingRule
Customization intent:Execution
Execution context:Client

Input Objects

Input objects must be of the following types:

  • ThisObject: VPMReference
  • Parameters: the context object.

Context Object Parameters

Parameter NameTypeRead/WriteComments
NameString Read/WriteName of the plane.
DistanceLengthReadAbsolute distance from the plane system origin.

Sample

The following sample shows the business rule for mapping the name of the planes.

/*
ThisObject Type = VPMReference
Parameters Type = RuleContext
*/

/* Inputs */
let CurrentPlane(RFGGridFace)
let NewPlaneList(List)

/* Outputs */
let NewPlane(RFGGridFace)

/* Local Usage */
let i(Integer)
let nbPlanes (Integer)

/* Getting input parameters */
set NewPlaneList= Parameters.GetAttributeObject("NewPlaneList")
set CurrentPlane= Parameters.GetAttributeObject("CurrentPlane")

nbPlanes  = NewPlaneList.Size()
i=1
for i while i <= nbPlanes  
{
	set NewPlane= NewPlaneList.GetItem(i)

	if NewPlane.Name == CurrentPlane.Name 
	{
		Parameters.SetAttributeObject("NewPlane", NewPlane)		
		exit
	}	
}

The following sample shows the business rule for mapping the distance between the current plane and a new plane.

/*
ThisObject Type = VPMReference
Parameters Type = RuleContext
*/

/* Inputs */
let CurrentPlane(RFGGridFace)
let NewPlaneList(List)

/* Outputs */
let NewPlane(RFGGridFace)

/* Local Usage */
let i(Integer)
let nbPlanes (Integer)

/* Getting input parameters */
set NewPlaneList= Parameters.GetAttributeObject("NewPlaneList")
set CurrentPlane= Parameters.GetAttributeObject("CurrentPlane")

nbPlanes  = NewPlaneList.Size()
i=1
for i while i <= nbPlanes  
{
	set NewPlane= NewPlaneList.GetItem(i)

	if NewPlane.Distance == CurrentPlane.Distance 
	{		
		Parameters.SetAttributeObject("NewPlane", NewPlane)		
		exit
	}		
}