Getting Relation attributes for Access or Influence

Started by nfigay, November 19, 2020, 17:19:52 PM

Previous topic - Next topic

nfigay

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

Phil Beauvoir

If you value and use Archi, please consider making a donation!
Ask your ArchiMate related questions to the ArchiMate Community's Discussion Board.

nfigay

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:

Phil Beauvoir

#3
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

If you value and use Archi, please consider making a donation!
Ask your ArchiMate related questions to the ArchiMate Community's Discussion Board.

nfigay

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.

Phil Beauvoir

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.
If you value and use Archi, please consider making a donation!
Ask your ArchiMate related questions to the ArchiMate Community's Discussion Board.