Trying to get these attributes following some previous exchanges captured which occurred last year, I tried without success accessing these attributes. E.g. for Access relation, I tried:
attr("accessType")
.getAccessType()
.accessType
Does current version of JArchi support getters for these attributes?
Thanks in advance for your support
Nicolas
It should work. See:
https://github.com/archimatetool/archi-scripting-plugin/wiki/jArchi-Object#accesstype
Thanks for the reply, Phil.
I've the version 0.8 of the jArchi plugin with Archi 4.7 on a Mac.
From a diagram, I extract all the relationships and use a switch on the relation type.
For access-relationship type, I've systematically an "undefined" output in console.log, even if setting the access type before.
$(did).children().filter('relationship').each(function(relation) {
switch (relation.type) {
case "access-relationship":
relation.accessType = "access";
console.log( "access type:"+ relation.accessType );
default:
I think that your filter returns a set of connections from a View. You have to go one stage further to get the referenced relationship in a connection. You need to access the ".concept" field.
So use:
relation.concept
You are right, Phil.
I misinterpreted the type of the children of the view, probably because of their types, i.e. relation.type with relation a child of a view, filtered with the filter 'relationship', and giving the same output than relation.concept.type.
You make my learning by doing quite easier. Thanks a lot.
Yes, it can be misleading because "relation.type" will return "access-relationship" if it is a visual connection as well as if it is a relationship concept.