Context Object Parameters
Parameter Name | Type | Read/Write | Comments |
---|
Mode | String |
Read | Add when a link is created and Remove when a link is deleted. |
ActionList | List | Read | List of content on which Add or Remove are applied on. |
ExistingList | List | Read | List of existing content already linked to help the user defining his business rule. |
Sample
The following sample illustrates how to modify the properties of entities after the creation or the deletion of links between cable/wires and net group/nets.
/* Rule : ELE_ModifyGroupConductor */
/*
ThisObject : #In RFLVPMLogicalInstance
Parameters : #In RuleContext
*/
let sMode (String) /* "Add" or "Remove" modes */
let ActionList (List) /* Ends to validate action on */
let ExistingList (List) /* Existing ends */
let nbActionEnds (Integer)
let nbExistingEnds (Integer)
let ActionEnd (RFLVPMLogicalInstance)
let ExistingEnd (RFLVPMLogicalInstance)
let i (Integer)
let ObjID=""
let description=""
set sMode = Parameters->GetAttributeString("Mode")
set ActionList = Parameters->GetAttributeObject("ActionList")
set ExistingList = Parameters->GetAttributeObject("ExistingList")
nbActionEnds = ActionList->Size()
nbExistingEnds = ExistingList->Size()
set i = 1
if (sMode == "Add")
{
description = "Add: "
for i while i <= nbActionEnds
{
ActionEnd = ActionList.GetItem (i)
if ActionEnd <> NULL
{
ObjID = ActionEnd->GetAttributeString("PLM_ExternalID")
description = description + " -" + ObjID
}
}
ThisObject->SetAttributeString("V_description", description)
}
if (sMode == "Remove")
{
description = "Remove: "
for i while i <= nbActionEnds
{
ActionEnd = ActionList.GetItem (i)
if ActionEnd <> NULL
{
ObjID = ActionEnd->GetAttributeString("PLM_ExternalID")
description = description + " -" + ObjID
}
}
ThisObject->SetAttributeString("V_description", description)
}