Execute Properties for Cable Synchronize (L2P_ExecuteDuringCableSynchronize)

An opening ID is an entry point used to customize business logic. This business rule revises or invalidates routes automatically, when there is a change in the network impacting the logical to physical synchronization of cables.

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 business rule is invoked during the synchronization of cables in Logical to Physical Assistant . The rule is run before making any modifications to physical cables. It detects the nature of the change impacting the synchronization and does the needful action on the route, such as invalidating all the routes or a few specific routes.

Definition Description
PLM Opening ID L2P_ExecuteDuringCableSynchronize
Customization intent Execution
Execution context Client

Input Objects

Input objects must be of the following types:

  • ThisObject: L2PItem
  • Parameters corresponds to the context object.

Sample

let item (L2PItem)
let item_Cable (L2PItem_Cable)
let index(Integer)

let sExpectedSeg (String)
let sCurrentSeg (String)
let ExpectedFromDevice (L2PItem)
let CurrentFromDevice(L2PItem)
let bEndModified(Boolean)
let bSegModified (Boolean)

let Cable3DOcc(Elec3DCableOccurrence)
let CableRef(Elec3DCable)
Let nbElecRoutes(Integer)
Let ListElecRoute(list)
Let ListElecRouteStatus(list)
Let ElecRoute_Cable(ElecRoute)
let ElecValidationStatus(RouteValidationStatus)

set item=ThisObject
set item_Cable=item
index =1
set bEndModified = false 
set bSegModified = false
if (NULL <> item_Cable)
{
	// This sample rule checks the attributes to be updated during sync and updates the description attribute of cable instance
	set sExpectedSeg = item_Cable.ExpectedSegregation
	set sCurrentSeg = item_Cable.CurrentSegregation
	set ExpectedFromDevice = item_Cable.ExpectedFromDevice
	set CurrentFromDevice = item_Cable.CurrentFromDevice
	 
	if (sExpectedSeg <> sCurrentSeg) 
	{
		set bSegModified = true
	}
	if (ExpectedFromDevice <> CurrentFromDevice)
	{
		set bEndModified = true 
	}
	
	if (bEndModified == true or bSegModified == true)
	{
		set Cable3DOcc= ThisObject.Facet3D	
		if (Cable3DOcc <> NULL)
		{ 
			set CableRef = Cable3DOcc.Reference
			if (NULL <>CableRef)
			{
				set nbElecRoutes = 1
				CableRef.ListOrderedRoutes(ListElecRoute, ListElecRouteStatus)
				set nbElecRoutes = ListElecRoute.Size()
				for  index while index <= nbElecRoutes 
				{
					set ElecRoute_Cable = ListElecRoute.GetItem(index)
					if (NULL <> ElecRoute_Cable)
					{
						set ElecValidationStatus = ElecRoute_Cable.Elec_ValidationStatus

						if ("Not_Validated" == ElecValidationStatus)
						{
							Notify("ThisValidationStatus: Not_Validated")
						}
						else if ("Fully_Validated" == ElecValidationStatus)
						{
							Notify("ThisValidationStatus: Fully_Validated")
						}
						 if (bEndModified == true and index ==1)							 
							ElecRoute_Cable.Revise()
						 else if (bSegModified == true)
							ElecRoute_Cable.InValidate()
	
					}
				}
			}
		}
	}
	else 
	{
		Notify("NO Synchronization Done")
	}
}