using junctionType

Started by blayde64, April 29, 2025, 11:57:13 AM

Previous topic - Next topic

blayde64

Hi there,

I have a little bit of code, and i cannot see why it doesnt work - in specific junctionType returns a result of "undefined". The rest of the code works. the debug statements (log.debug is my own thing) show that the element name is correct, and is triggered only when a junction is found. looking at the wiki i think i am accessing it properly... is there any reason why this wouldnt work? following the wiki, i also tried getJunctionType(), which also didn't work... any thoughts are welcome!

    if (e.specialization==null)
{
if (e.type !="junction")
{
typesList.push(e.type);
}
else
{
log.debug("Its a Junction - type is " + e.junctionType);
log.debug("Its a Junction - name is " + e.name);
var bt=e.junctionType+"-"+e.type;
typesList.push(bt);
}
    }
else
        typesList.push(e.specialization); //it is a specialization so push the specialization name.

 

Phil Beauvoir

It depends what the variable "e" is. If it's a Junction concept then this will work:

type = e.junctionType;
However, if "e" is a Junction diagram object then you need to access the object's underlying concept:

type = e.concept.junctionType
In both cases you can use the latter
If you value and use Archi, please consider making a donation.
Ask your ArchiMate related questions to the ArchiMate Community's Discussion Board.