specialization=element-type
console.log("----------GET OBJECT NODE FROM MODEL------------");
var nodes = $("node");
console.log(nodes);
console.log("----------GET VIEW------------");
var view = $(".5-Prod").first(); // Get view from its name (pick the first one if multiple views share the same name)
var flowRelationship = $(view).find("flow-relationship"); // Build a collection containing the view, and then get all flow-relationship in this view.
var compositionRelationship = $(view).find("composition-relationship"); // Build a collection containing the composition-relationship, and then get all flow-relationship in this view.
console.log(flowRelationship);
flowRelationship.each(function(flowRelationship) {
console.log("Relation " + flowRelationship.concept.name + ""); // we can still access the name attribute through the visual object
console.log(flowRelationship.prop("port")); // get port of the relation
console.log(flowRelationship.concept.source.id); // get source id of the relation
console.log(flowRelationship.concept.target.id); // get target id of the relation
console.log(flowRelationship.concept.documentation); // get documentation of the relation
console.log("Source"+$("#"+flowRelationship.concept.source.id)); // get source object of the relation
console.log("Target"+$("#"+flowRelationship.concept.target.id)); // get target object of the relation
if ($("#"+flowRelationship.concept.source.id)
[o].type == "technology-interface") { // if source is a technology-interface
compositionRelationship.each(function(compositionRelationship) { // get all composition-relationship
if (compositionRelationship.concept.target.id == $("#"+flowRelationship.concept.source.id)
[o].concept.id) { // if target of the composition-relationship is the source of the flow-relationship
console.log(" Source: " + compositionRelationship.concept.source.id + " Target: " + compositionRelationship.concept.target.id); // get source and target of the composition-relationship
console.log($("#"+compositionRelationship.concept.source.id)
[o].name); // get name of the source of the composition-relationship
}
}
);
}
console.log("\n");
});