-
Notifications
You must be signed in to change notification settings - Fork 35
Elements
Note
Attributes and methods described in this section are available only on ArchiMate Elements
.duplicate()
.junctionType
.merge
.specialization
Since 1.8
Duplicate (copy) an element and place the duplicate in the same or a target folder.
// Duplicate element into the same folder
element.duplicate();
// Duplicate element into the target folder
element.duplicate(folder);
Note that the target folder must be of the same type as the element and in the same model.
Example:
// Create a new folder called "Copied" in the "Business" folder
var businessFolder = $("folder.Business").first();
var newFolder = businessFolder.createFolder("Copied");
// Duplicate a given Business element into the new folder
businessElement.duplicate(newFolder);
Applies only to Junctions.
Get/set the type of a Junction.
Allowed types - "and", "or"
// Getters
var type = junction.getJunctionType();
var type = junction.junctionType;
var type = junction.attr("junction-type");
// Setters
junction.setJunctionType("and");
junction.junctionType = "and";
junction.attr("junction-type", "or");
Merge this element and another element.
element.merge(otherElement);
- Existing diagram instances of the other ArchiMate element will be replaced with this element
- Elements have to be of the same type
- Documentation of the other element is appended to this element's documentation
- Properties of the other element are appended to this element's properties
- All source and target relationships of the other element are set to this element
- The other element is not deleted
Get/set the specialization for an element or visual object. The specialization should have been created first. See .createSpecialization()
Example:
var specialization = model.createSpecialization("Oscar", "business-actor", image);
object.specialization = "Oscar";
var specializationName = object.specialization;
Note - a specialization is assigned to a concept by its name, not the Specialization
object.
If you value and use Archi please consider making a donation. Thanks!