Skip to content
Phil Beauvoir edited this page Feb 23, 2024 · 4 revisions

Note

Attributes and methods described in this section are available only on ArchiMate Relationships

Contents

.accessType
.associationDirected
.influenceStrength
.merge
.source
.specialization
.target


.accessType

Applies only to Access Relationships.

Get/set the access type of an Access Relationship.

Allowed types - "access", "read", "write", "readwrite"

// Getters
var type = relation.getAccessType();
var type = relation.accessType;
var type = selection.attr("access-type");

// Setters
relation.setAccessType("write");
relation.accessType = "access";
selection.attr("access-type", "readwrite");

.associationDirected

Applies only to Association Relationships.

Get/set the directed attribute of an Association Relationship.

// Getters
var isDirected = relation.isAssociationDirected();
var isDirected = relation.associationDirected;
var isDirected = selection.attr("association-directed");

// Setters
relation.setAssociationDirected(true);
relation.associationDirected = true;
selection.attr("association-directed", true);

.influenceStrength

Applies only to Influence Relationships.

Get/set the strength of an Influence Relationship.

Any string is allowed.

// Getters
var strength = relation.getInfluenceStrength();
var strength = relation.influenceStrength;
var strength = selection.attr("influence-strength");

// Setters
relation.setInfluenceStrength("++");
relation.influenceStrength = "++";
selection.attr("influence-strength", "+++");

.merge()

Merge this relationship and another relationship.

relation.merge(otherRelation);
  • Existing diagram instances of the other ArchiMate relationship will be replaced with this relationship
  • Relationships have to be of the same type
  • Documentation of the other relationship is appended to this relationship's documentation
  • Properties of the other relationship are appended to this relationship's properties
  • All source and target relationships of the other relationship are set to this relationship
  • The other relationship is not deleted

.source

Get/set the source of an ArchiMate Relationship.

relation.source // => return the concept which is the source of the relationship
relation.source = aConcept // => set the source using a Concept

.specialization

Get/set the specialization for an relationship or connection. The specialization should have been created first. See .createSpecialization()

var specialization = model.createSpecialization("Association Specialization", "association-relationship", image);
relation.specialization = "Association Specialization";
var specializationName = relation.specialization;

Note - a specialization is assigned to a concept by its name, not the Specialization object.

.target

Get/set the target of an ArchiMate Relationship.

relation.target // => return the concept which is the target of the relationship
relation.target = aConcept // => set the target using a Concept