Skip to content

Commit

Permalink
Merge pull request #8608 from mandy-chessell/oak2025
Browse files Browse the repository at this point in the history
Add mermaid graphs for information supply chain, soluton blueprints and solution roles
  • Loading branch information
mandy-chessell authored Jan 30, 2025
2 parents 9886f7f + ab9a54e commit b59a1e1
Show file tree
Hide file tree
Showing 57 changed files with 3,865 additions and 251 deletions.
2 changes: 1 addition & 1 deletion EgeriaContentPacksGUIDMap.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion content-packs/APIsContentPack.omarchive

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion content-packs/ApacheAtlasContentPack.omarchive

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion content-packs/ApacheKafkaContentPack.omarchive

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion content-packs/CocoBusinessSystemsArchive.omarchive

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion content-packs/CocoClinicalTrialsTemplatesArchive.omarchive

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion content-packs/CocoComboArchive.omarchive

Large diffs are not rendered by default.

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion content-packs/CocoGovernanceProgramArchive.omarchive

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion content-packs/CocoOrganizationArchive.omarchive

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion content-packs/CocoSustainabilityArchive.omarchive

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion content-packs/CocoTypesArchive.omarchive

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion content-packs/CoreContentPack.omarchive

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion content-packs/ObservabilityContentPack.omarchive

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion content-packs/OpenMetadataTypes.omarchive

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion content-packs/PostgresContentPack.omarchive

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion content-packs/UnityCatalogContentPack.omarchive

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ distributions {
{ include 'Egeria*.http' }
from { "$rootProject.projectDir/open-metadata-implementation/view-services/reference-data" }
{ include 'Egeria*.http' }
from { "$rootProject.projectDir/open-metadata-implementation/view-services/solutin-architect" }
from { "$rootProject.projectDir/open-metadata-implementation/view-services/solution-architect" }
{ include 'Egeria*.http' }
from { "$rootProject.projectDir/open-metadata-implementation/view-services/runtime-manager" }
{ include 'Egeria*.http' }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,15 @@ public enum DigitalArchitectureAuditCode implements AuditLogMessageSet
"Event {0} could not be published due to {1} exception with message: {2}",
"The system is unable to publish the event to the Digital Architecture OMAS's OutTopic.",
"Verify the topic configuration and that the event broker is running."),

/**
* OMAS-DIGITAL-ARCHITECTURE-0015 - The Digital Architecture OMAS has received an unexpected {0} exception while formatting a response during method {1}. The message was: {2}
*/
UNEXPECTED_CONVERTER_EXCEPTION("OMAS-DIGITAL-ARCHITECTURE-0015",
AuditLogRecordSeverityLevel.EXCEPTION,
"The Digital Architecture OMAS has received an unexpected {0} exception while formatting a response during method {1}. The message was: {2}",
"The request returns all of the information that it was able to receive.",
"Review the stack trace to identify where the error occurred and work to resolve the cause."),
;

private final String logMessageId;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ dependencies {
implementation project(':open-metadata-implementation:frameworks:open-integration-framework')
implementation project(':open-metadata-implementation:frameworks:governance-action-framework')
implementation project(':open-metadata-implementation:common-services:ffdc-services')
implementation project(':open-metadata-implementation:common-services:mermaid-services')
implementation 'org.springframework:spring-core'
compileOnly 'com.fasterxml.jackson.core:jackson-annotations'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
package org.odpi.openmetadata.accessservices.digitalarchitecture.client;

import org.odpi.openmetadata.accessservices.digitalarchitecture.client.rest.DigitalArchitectureRESTClient;
import org.odpi.openmetadata.adminservices.configuration.registration.AccessServiceDescription;
import org.odpi.openmetadata.commonservices.ffdc.InvalidParameterHandler;
import org.odpi.openmetadata.commonservices.ffdc.rest.NullRequestBody;
import org.odpi.openmetadata.frameworks.auditlog.AuditLog;
Expand All @@ -18,6 +19,8 @@
*/
abstract class DigitalArchitectureClientBase
{
final protected String serviceName = AccessServiceDescription.DIGITAL_ARCHITECTURE_OMAS.getAccessServiceFullName();

DigitalArchitectureRESTClient restClient; /* Initialized in constructor */

String serverName; /* Initialized in constructor */
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public enum OMAGConnectorAuditCode implements AuditLogMessageSet
* EGERIA-CONNECTOR-0001 - The {0} Egeria Connector received an unexpected exception {1} during method {2}; the error message was: {3}
*/
UNEXPECTED_EXCEPTION("OMAG-CONNECTORS-0001",
AuditLogRecordSeverityLevel.EXCEPTION,
AuditLogRecordSeverityLevel.ERROR,
"The {0} Egeria Connector received an unexpected exception {1} during method {2}; the error message was: {3}",
"The connector is unable to connector the the OMAG Infrastructure.",
"Use the details from the error message to determine the cause of the error and retry the request once it is resolved."),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,10 +156,10 @@ public void start() throws ConnectorCheckedException
{
if (auditLog != null)
{
auditLog.logException(methodName, OMAGConnectorAuditCode.UNEXPECTED_EXCEPTION.getMessageDefinition(connectorName,
error.getClass().getName(),
methodName,
error.getMessage()), error);
auditLog.logMessage(methodName, OMAGConnectorAuditCode.UNEXPECTED_EXCEPTION.getMessageDefinition(connectorName,
error.getClass().getName(),
methodName,
error.getMessage()));
}
throw new ConnectorCheckedException(OMAGConnectorErrorCode.UNEXPECTED_EXCEPTION.getMessageDefinition(connectorName,
error.getClass().getName(),
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
/* SPDX-License-Identifier: Apache-2.0 */
/* Copyright Contributors to the ODPi Egeria project. */

package org.odpi.openmetadata.commonservices.mermaid;

/**
* Colour helps to capture the colours we are using in the mermaid graphs.
*/
public enum Colour
{
BLACK ("#000000"),
WHITE ("#FFFFFF"),
CERISE ("#AA00FF"),
EGERIA_BLUE ("#39add1"),
DARK_BLUE ("#3079ab"),
BLUE_SKY ("#A8C2FF"),
PINKY ("#E1D5E7"),
MAUVE ("#EFEFFF"),
RED ("#e15258"),
ORANGE ("#f9845b"),
LAVENDER ("#838cc7"),
PURPLE ("#7d669e"),
TEAL ("#53bbb4"),
GREEN ("#51b46d"),
MUSTARD ("#e0ab18"),
PINK ("#f092b0"),
LIGHT_GRAY ("#b7c0c7"),
DARK_GRAY ("#637a91"),
SLATE ("#004563"),
SAND ("#F9F7ED")
;

private final String colourNumber;


/**
* Construct each of the colours.
*
* @param colourNumber string
*/
Colour(String colourNumber)
{
this.colourNumber = colourNumber;
}


/**
* Return the colour number.
*
* @return string
*/
public String getColourNumber()
{
return colourNumber;
}


/**
* JSON-style toString
*
* @return return string containing the property names and values
*/
@Override
public String toString()
{
return "Colour{" +
"colourNumber='" + colourNumber + '\'' +
"} ";
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
/* SPDX-License-Identifier: Apache-2.0 */
/* Copyright Contributors to the ODPi Egeria project. */

package org.odpi.openmetadata.commonservices.mermaid;

import org.odpi.openmetadata.frameworks.openmetadata.metadataelements.*;
import org.odpi.openmetadata.frameworks.openmetadata.types.OpenMetadataType;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;


/**
* Creates a mermaid graph rendering of the Open Metadata Framework's information supply chain graph.
*/
public class InformationSupplyChainMermaidGraphBuilder extends MermaidGraphBuilderBase
{
/**
* Construct a mermaid markdown graph.
*
* @param informationSupplyChainElement content
*/
public InformationSupplyChainMermaidGraphBuilder(InformationSupplyChainElement informationSupplyChainElement)
{
mermaidGraph.append("---\n");
mermaidGraph.append("title: Information Supply Chain - ");
mermaidGraph.append(informationSupplyChainElement.getProperties().getDisplayName());
mermaidGraph.append(" [");
mermaidGraph.append(informationSupplyChainElement.getElementHeader().getGUID());
mermaidGraph.append("]\n---\nflowchart TD\n%%{init: {\"flowchart\": {\"htmlLabels\": false}} }%%\n\n");

String currentNodeName = informationSupplyChainElement.getElementHeader().getGUID();
String currentDisplayName = informationSupplyChainElement.getProperties().getDisplayName();

appendNewMermaidNode(currentNodeName,
currentDisplayName,
informationSupplyChainElement.getElementHeader().getType().getTypeName(),
VisualStyle.INFORMATION_SUPPLY_CHAIN);

if (informationSupplyChainElement.getSegments() != null)
{
for (InformationSupplyChainSegmentElement node : informationSupplyChainElement.getSegments())
{
if (node != null)
{
currentNodeName = node.getElementHeader().getGUID();
currentDisplayName = node.getProperties().getDisplayName();
if (currentDisplayName == null)
{
currentDisplayName = node.getProperties().getQualifiedName();
}

appendNewMermaidNode(currentNodeName,
currentDisplayName,
node.getElementHeader().getType().getTypeName(),
VisualStyle.INFORMATION_SUPPLY_CHAIN_SEG);

if (node.getLinks() != null)
{
for (InformationSupplyChainLink link : node.getLinks())
{
if (link != null)
{
super.appendMermaidLine(link.getEnd1Element().getGUID(),
this.getListLabel(Collections.singletonList(super.addSpacesToTypeName(link.getElementHeader().getType().getTypeName()))),
link.getEnd2Element().getGUID());
}
}
}
}
}

List<String> solutionLinkingWireGUIDs = new ArrayList<>();

for (InformationSupplyChainSegmentElement node : informationSupplyChainElement.getSegments())
{
if (node != null)
{
if (node.getImplementedByList() != null)
{
for (ImplementedByRelationship implementedByRelationship : node.getImplementedByList())
{
if (implementedByRelationship != null)
{
appendNewMermaidNode(implementedByRelationship.getEnd1Element().getGUID(),
implementedByRelationship.getEnd1Element().getUniqueName(),
implementedByRelationship.getEnd1Element().getType().getTypeName(),
VisualStyle.SOLUTION_COMPONENT);

appendNewMermaidNode(implementedByRelationship.getEnd2Element().getGUID(),
implementedByRelationship.getEnd2Element().getUniqueName(),
implementedByRelationship.getEnd2Element().getType().getTypeName(),
VisualStyle.SOLUTION_COMPONENT);
}
}
}

if (node.getSolutionLinkingWires() != null)
{
for (SolutionLinkingWireRelationship relationship : node.getSolutionLinkingWires())
{
if (relationship != null)
{
appendNewMermaidNode(relationship.getEnd1Element().getGUID(),
relationship.getEnd1Element().getUniqueName(),
relationship.getEnd1Element().getType().getTypeName(),
VisualStyle.SOLUTION_COMPONENT);

appendNewMermaidNode(relationship.getEnd2Element().getGUID(),
relationship.getEnd2Element().getUniqueName(),
relationship.getEnd2Element().getType().getTypeName(),
VisualStyle.SOLUTION_COMPONENT);

if (! solutionLinkingWireGUIDs.contains(relationship.getElementHeader().getGUID()))
{
super.appendMermaidLine(relationship.getEnd1Element().getGUID(),
this.getListLabel(Collections.singletonList(super.addSpacesToTypeName(relationship.getElementHeader().getType().getTypeName()))),
relationship.getEnd2Element().getGUID());

solutionLinkingWireGUIDs.add(relationship.getElementHeader().getGUID());
}
}
}
}
}
}
}
}
}
Loading

0 comments on commit b59a1e1

Please sign in to comment.