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 when pins or ports are grouped with a connector port or ungrouped.
/* Rule : ELE_ModifyGroupConnector */
/*
ThisObject : #In RFLVPMLogicalPort
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 nbPort (Integer)
let description=""
set sMode = Parameters->GetAttributeString("Mode")
set ActionList = Parameters->GetAttributeObject("ActionList")
set ExistingList = Parameters->GetAttributeObject("ExistingList")
nbActionEnds = ActionList->Size()
nbExistingEnds = ExistingList->Size()
if (sMode == "Add")
{
set nbPort = nbExistingEnds + nbActionEnds
description = "Nb of pin = " + ToString(nbPort)
ThisObject->SetAttributeString("V_description", description)
}
if (sMode == "Remove")
{
Set nbPort = nbExistingEnds - nbActionEnds
description = "nb of pin = " + ToString(nbPort)
ThisObject->SetAttributeString("V_description", description)
}