Recent posts

#41
jArchi / Collaboration Properties
Last post by blakesha - June 07, 2024, 01:56:56 AM
Hi Team

Is there any way to get at the collaboration properties of the model from script. Specifically, the current branch details?
#42
jArchi / Archi Elements and Relationshi...
Last post by blakesha - June 06, 2024, 13:45:42 PM
Hi All

Just wanted to post this snippet of code for others to use that shows how to inject from Archi into a Gramlin-based Graph Database if anyone else is interested. It adds the properties of both the elements and the relationships to the graph.

console.log("Start");

Java.addToClasspath("C:\\Users\\XXX\\Documents\\Archi\\scripts\\gremlin-driver-3.7.2-shaded.jar");
Java.addToClasspath("C:\\Users\\XXX\\Documents\\Archi\\scripts\\slf4j-api-2.0.9.jar");

var imports = new JavaImporter(java.util, java.util.concurrent, org.apache.tinkerpop.gremlin.driver);

with(imports) {
    var clusterBuilder = Cluster.build();
    clusterBuilder.addContactPoint("localhost");
    clusterBuilder.port(65400);
    clusterBuilder.credentials("/dbs/<database>/colls/<container>", "<passkey>");
    clusterBuilder.enableSsl(false);
    clusterBuilder.serializer("GRAPHSON_V2");
    var cluster = clusterBuilder.create();

    // Connect to the cluster and drop everthing from the graph. Closing will ensure the task completes.
    var client = cluster.connect();
    results = client.submit("g.V().drop()");
    client.close();

    // Reconnect to the cluster and add all vertices and edges for the elements and relationships.
    client = cluster.connect();

    var elements = $("element");
    var query = "";
    var props = "";

    elements.each(function(obj) {
        props = ""
        obj.prop().forEach(property => {
            props += ".property('"+property+"', '"+obj.prop(property)+"')";
        });
        query = "g.addV('"+obj.type+"').property('element_id', '"+obj.id+"').property('name', '"+obj.name+"')"+props;
       
        results = client.submit(query);
    });
 
    var relationships = $("relationship");
    relationships.each(function(obj) {
        props = ""
        obj.prop().forEach(property => {
            props += ".property('"+property+"', '"+obj.prop(property)+"')";
        });
        query = "g.V().has('element_id', '"+obj.source.id+"').addE('"+obj.type+"').property('name', '"+obj.name+"')"+props+".to(g.V().has('element_id', '"+obj.target.id+"'))";
       
        results = client.submit(query);
    })

    // Close and cleanup client and cluster.
    client.close();
    cluster.close();
}

console.log("End");

If you google search for the two jars required they are easily found on the interweb.

Enjoy.
#43
General Archi Discussion / Re: Merge Relationships
Last post by romuald - June 05, 2024, 15:44:02 PM
Maybe a Jarchi script can do this.
You can find a MErge script for elements like : Merge Elements Script

Changing
var el_selection = selection.filter("element");

By
var el_selection = selection;

merge 2 relations if they are same type.
It will not remove duplicate relations in views
#44
General Archi Discussion / How to handle view lifecycle
Last post by nickbrown1968 - June 05, 2024, 11:19:16 AM
How do you recommend managing view lifecycle/versions? I'm currently working on a project that is developing in an agile-ish manner. I captured the system architecture early on in a couple of views. Subsequently the project has tweaked the design so I need to reflect those changes. I could just update the existing views, but then I'd lose the historical design record. I could create a versioning system and keep all versions. Any recommendations?
#45
General Archi Discussion / Merge Relationships
Last post by nickbrown1968 - June 05, 2024, 11:12:03 AM
I occasionally end up with duplicate relationships between elements. What's the best workflow to "merge" them? I currently do something along the lines of:

- Rename the to make them unique/identifiable (if not already)
- Pick a the one that needs to be kept
- Select the one to be deleted, open all views where used
- Recreate the connection in the view, selecting the existing relationship to be kept
- Delete the original connection in the view
- When removed from all views, delete relationship from model

Is there an easier way?
#46
Hi I'm a relative newbie to the modeling language. I've had multiple attempts to model a private cloud platform like VCF in a simple way, attached is my latest attempt. I'm defining VM patterns outside archimate - SBB types.

I'm finding that for some things there isn't a perfect way to model but there is more right. I suspect that we will use a simplified model: matching tech nodes directly to application components for VMs.

Let me know what you think and if any suggestions to improve on it.
#47
General Archi Discussion / Re: How I cope with model of 4...
Last post by Alberto - May 28, 2024, 18:03:27 PM
This is the stuff I've been dreaming about ever since I discovered Archimate.  Of course, in my dreams, every vendor would support Archimate as a native export so that you could have multiple sources and not have to recreate the wheel for every component of the enterprise. Alas, dreams can become reality, I just hope to be in a position again to do this kind of work. Congrats!
#48
Bonus 2: Advanced analysis of the model
Same tooling also lets me perform more advanced analysis of the application.

What if I want to know whether the data processing setup moves data between two AWS regions?

Before explaining how I easily answer questions like this, I need to explain what is in the system's architecture model. The model's elements of "logical type" NiFi Root Processor Group have no direct relation to the AWS region. In the model the processor group is associated with an EC2 instance which the group runs on. In its turn, the EC2 instance gets aggregated by the AWS region.
NiFi Root Processor Groups can be in different relations to different types of external services depending on the kind of those relations in "reality". As the following diagram says about one of the NiFi elements, viewed in isolation, the processor group emits data to the AWS SQS queue in the AWS region. (And the SQS's region is different from the EC2 instance's one.)



So, let's try to find all similar cross-region data paths.

I use archi-powertools-verifier with its interactive mode feature. I make the tool import my model to Neo4j absolutely the same way model verification does. In interactive mode the tool leaves Neo4j to run in the background and enables Neo4j Browser, a tool that allows you to execute CQL queries and visualise the results.

First, I need to enrich the original relationship graph with a new direct relation between NiFi processor groups and their AWS regions. (All that terminology used in the query below, e.g. elements of type Grouping of given specialization, or relations of Aggregation type, came from ArchiMate. MERGE clause of the query makes the query create a new relation in the graph while merging possible duplicates.)

MATCH
  (r:Grouping{specialization:"AWS Region"})-[:Aggregation]->
  (:TechnologyService{specialization:"EC2 Instance"})
  <-[:Association]-(n:ApplicationService{specialization:"NiFi"})
MERGE (n)-[:IN_REGION]->(r)


Another enrichment I want to make is to create a "generic" INTERACT_WITH relation between NiFi processor group and its data source or data sink regardless of type and direction of the original relation. (In my situation all data sources and sinks get represented as ArchiMate elements of type TechnologyService, TechnologyInterface or Artifact.)

MATCH
  (n:ApplicationService{specialization:"NiFi"})--
  (s:TechnologyService|TechnologyInterface|Artifact)
MERGE (n)-[:INTERACTS_WITH]->(s)


After I kind of "normalised" the model by introducing those two new "artificial" types of relations, I can use following fairly simple CQL query to find all NiFi processor groups (n) that INTERACTS_WITH any external service (s) and n's and s's regions are different.

MATCH
  (r1)<-[r_n:IN_REGION]-(n)-[n_s:INTERACTS_WITH]->(s)
  <-[s_r:Aggregation]-(r2:Grouping{specialization:"AWS Region"})
WHERE r1<>r2
RETURN r1, r_n, n, n_s, s, s_r, r2


Neo4j Browser does a beautiful job (in literal sense) of graphically presenting the sub-graph my query returns.
#49
jArchi / Re: Single View 2 Single HTML ...
Last post by JoCriSem - May 27, 2024, 09:40:38 AM
A script I was looking for for a while now.  Thanks.
#50
Hi Phil, thank you very much for your explanations! :)

Thanks to these I was able to solve this problem.