Customization > Automation Interface > Functions > Functions for Collections > AddByType function (automation interface)
AddByType function (automation interface)
Syntax:
AddByType("<object type>", "<association>")
Where:
<object type> is a string that specifies the type of object to create through the association. Tell me more...
<association> is a string that specifies the association type to use to create the object. Identifying associations...
The AddByType function creates an object of a specified type through a specified association and returns the new object.
Examples
To create a Call Behavior Action (Action Node) for an Activity through the ACTIVITYNODE association:
Set objItem = Dictionary.Item("Activity", "Activity1")
Set NewNode = objItem.AddByType("Action Node", "ACTIVITYNODE")
NewNode("NODETYPE") = "Call Behavior Action"
To create an Atomic State (State) for a State Machine through the OWNEDSTATE association:
Set objItem = Dictionary.Item("State Machine", "State Machine1")
Set NewNode = objItem.AddByType("State", "OWNEDSTATE")
NewNode("UMLSTATETYPE") = "Atomic"