Compute Physical To Evolve (L2P_ComputePhysicalToEvolve)

An opening ID is an entry point used to customize business logic. The Compute Physical To Evolve opening ID is available in the Logical to Physical Assistant Resources resource set.

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

This page discusses:

General Information

This computation type business rule is invoked when user executes the Replace by New Evolution action for Equipment, Cable, Piping and HVAC parts.

Purpose of this business rule is to:
  • Select Physical item to be evolved for a logical item
  • Compute list of accessories to be evolved from selected physical item
  • Compute list of accessories to be excluded from selected physical item
Definition Description
PLM Opening ID L2P_ComputePhysicalToEvolve
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
ListInputObjects List Read Containing logical items for which replace by new evolution action is performed.
ListCandidateObjects List Read Containing a list of physical items which can be evolved corresponding to the logical items for which replace by new evolution action is performed.
ListPhysicalToEvolve List Write Containing physical items to be evolved corresponding to logical Items in input list.
ListAcessoriesToEvolve List Write Containing accessories / children to be evolved of selected physical items corresponding to logical Items in input list.
ListAcessoriesToExclude List Write Containing accessories / children to be excluded of selected physical items corresponding to logical Items in input list.
ListOutputBoolean List Write Containing boolean (true / false) to indicate if the panel for selection of accessories to evolve is to be displayed.
Note: Optional, if the list is empty or does not have same size as input it is ignored and the panel displays to choose accessories of physical item to evolve.
  • The output lists must have same size as the input list ListInputObjects. If the sizes do not match the output are ignored.
  • Accessories must not be in both the lists, list to be evolved and in list to be excluded, otherwise business rule output are ignored.
  • If the exclude action is computed for an accessory, all its children are excluded irrespective of computed actions for them.
  • Accessories not in any of the list are reused.

Sample

// ThisObject: <Unset>
/* Rule created by CVV 10/28/2024 */ 
let ListItems (List)
let ListCandidates (List)
let ListComputedCandidates (List)
let ListAccessories (List)
let ListDisplayPanel (List)
let index (Integer)
let l2pItem (L2PItem)

set index = 1
set ListItems = Parameters.GetAttributeObject("ListInputObjects")
set ListCandidates = Parameters.GetAttributeObject("ListCandidateObjects")
if(ListItems.Size() == ListCandidates.Size())
{
	for index while index <= ListItems.Size()
	{
		let ListCurrentAccessories (List)
		let listCurrentCandidates (List)
		let occCandidate (ProductOccurrence)
		let bDisplayPanel (Boolean)
		
		set bDisplayPanel = true
		set listCurrentCandidates = ListCandidates.GetItem(index)
		set l2pItem = ListItems.GetItem(index)
		if( (NULL <> l2pItem) and (1 <= listCurrentCandidates.Size()) )
		{
			// NOTE: This is sample rule which relies on reference description of the physical items and its children
			// to identify the candidate and children to evolve
			let currentOcc (ProductOccurrence)
			if(listCurrentCandidates.Size() == 1)
			{
				set occCandidate = listCurrentCandidates.GetItem(1)
			}
			
			for currentOcc inside listCurrentCandidates
			{
				let prdRef (VPMReference)
				set prdRef = currentOcc.Reference
				if(prdRef.V_description == "ToEvolve")
				{
					set occCandidate = currentOcc
					break
				}
			}
			if(NULL <> occCandidate)
			{
				let listChildren (List)
				set listChildren = occCandidate.Query("ProductOccurrence", "")
				for currentOcc inside listChildren
				{
					let prdRef (VPMReference)
					set prdRef = currentOcc.Reference
					if(prdRef.V_description <> "Reusable")
					{
						ListCurrentAccessories.Append(currentOcc)
					}
				}
				// NOTE: In this sample rule, panel is displayed based on number of children in the candidate physical to evolve
				// If number of children is more than 3, then the panel should be displayed
				if(3 >= listChildren.Size())
					set bDisplayPanel = true
			}
		}
		
		ListComputedCandidates.Append(occCandidate)
		ListAccessories.Append(ListCurrentAccessories)
		ListDisplayPanel.Append(bDisplayPanel)
	}
	Parameters.SetAttributeObject("ListPhysicalToEvolve", ListComputedCandidates )
	Parameters.SetAttributeObject("ListAcessoriesToEvolve", ListAccessories )
	Parameters.SetAttributeObject("ListOutputBoolean", ListDisplayPanel )
}
else
{
	Notify("L2P_ComputePhysicalToEvolve: ERROR Invalid input lists")
}