General InformationThis business rule is invoked during the synchronization of cables in Logical to
Physical Assistant
Input ObjectsInput objects must be of the following types:
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")
}
}
| |||||||||||||||