#### <%- data.name %>


<% if (data.specialCharInName) { %>
???+ warning

    Could not display the image because instance name contains one or more of these characters: #[].
<% } %>

![<%- data.name %>](<%- "URL_" + data._id + ".svg" %>)

<% if (data.description) { %>
##### Description

<%- data.description %>
<% } %>


<% if (data.reference && data.reference.length > 0) { %>
##### Reference(s)

    <% data.reference.forEach(reference => { %>
        <% if (reference.name && reference.url) { %>
[<%- reference.name %>](<%- reference.url %>)
        <% } else { %>
[<%- reference.url %>](<%- reference.url %>)
         <% } %>
    <% }) %>
<% } %>


<% if (data.targetSystems && data.targetSystems.length > 0 || data.usageSteps && data.usageSteps.length > 0 || data.actors && data.actors.length > 0 || data.subSystems && data.subSystems.length > 0 || data.logicalComponents && data.logicalComponents.length > 0 || data.omLocations && data.omLocations.length > 0 || data.logicalConnectors && data.logicalConnectors.length > 0  || data.timelines && data.timelines.length > 0 || data.componentMessages && data.componentMessages.length > 0  || data.componentEvents && data.componentEvents.length > 0 || data.logicalNodes && data.logicalNodes.length > 0) { %>
##### Element


<% if (data.targetSystems && data.targetSystems.length > 0) { %>
###### Target System(s)

| Name | Description |
| --- | --- |
<% data.targetSystems.forEach(function(ele){ %> | <%- ele.name %> | <%- ele.description.replace(/>(https?[^<]*)<\/a>/g, '>`$1`</a>') %> |
<% }); %>
<% } %>


<% if (data.usageSteps && data.usageSteps.length > 0) { %>

###### Step List

| Name | Description |
| --- | --- | 
<% data.usageSteps.forEach(function(ele){ %> | <%- ele.name %> | <%- ele.description %> |
<% }); %>
<% } %>


<% if (data.timelines && data.timelines.length > 0) { %>
###### Timeline(s)

| Name | Description |
| --- | --- | 
<% data.timelines.forEach(function(ele){ %> | <%- ele.name %> | <%- ele.description %> |
<% }); %>
    
<% } %>


<% if (data.componentMessages && data.componentMessages.length > 0) { %>
###### Component Message(s)

| Name | Description | Type |
| --- | --- | --- |
<% data.componentMessages.forEach(function(ele){ %> | <%- ele.name %> | <%- ele.description.replace(/>(https?[^<]*)<\/a>/g, '>`$1`</a>') %> | <%- ele.type %> |
<% }); %>
    
<% } %>



<% if (data.actors && data.actors.length > 0) { %>
###### Actor(s)

| Name | Description | Type | GenericGroup |
| --- | --- | --- | --- |
<% data.actors.forEach(function(ele){ %>| <%- ele.name %> | <%- ele.description %> | <%- ele.type %> | <% if (data.genericGroup && data.genericGroup[ele._id]) { %><% data.genericGroup[ele._id].forEach(gg=> { %><div><strong><%- gg.category %>,<%- gg.name %></strong>[<%- gg.type %>]</div><div><%- gg.description %></div><% }) %><% } %> |
<% }); %>
<% } %>


<% if (data.subSystems && data.subSystems.length > 0) { %>
###### Subsystem(s)

| Name | Description | Sub-Diagram |
| --- | --- | --- |
<% data.subSystems.forEach(function(ele){ %>| <%- ele.name %> | <%- ele.description.replace(/>(https?[^<]*)<\/a>/g, '>`$1`</a>') %> | <% if (data.subLink && data.subLink[ele.subDiagramID] && !data.subInfo[ele.subDiagramID].hideSubLink) { %><a href="<%- data.subLink[ele.subDiagramID] %>"><%- ele.subDiagramId %></a><% } else if (data.subInfo && data.subInfo[ele.subDiagramID] && !data.subInfo[ele.subDiagramID].hideSubLink) { %><a href="<%- 'URL_' + ele.subDiagramID %>/"><%- ele.subDiagramId %></a><% } else if(ele.subDiagramId) { %><a href="<%- 'URL_' + ele.subDiagramID %>/"><%- ele.subDiagramId %></a> (Not Exported)<% } %> |
<% }) %>

<% } %>

<% if (data.logicalComponents && data.logicalComponents.length > 0) { %>
###### Logical Component(s)

    <% data.logicalComponents.forEach(function(ele){ %>

<details markdown=1>
<summary markdown="span"><%- ele.name %></summary>

<table>
    <caption></caption>
    <tr>
        <td> <strong>Name</strong> </td>
        <td><%- ele.name %></td>
    </tr><% if (ele.description) { %>
    <tr>
        <td> <strong>Description</strong> </td>
        <td><%- ele.description %></td>
    </tr><% } if (ele.taxonomies && ele.taxonomies.length > 0) { %>
    <tr>
        <td> <strong>Primary Capability</strong> </td>
        <td><% ele.taxonomies.forEach(function(tax){ %><div><%- tax %></div><% }); %></td>
    </tr><% } if (data.logicalComponentList && data.logicalComponentList[ele._id]) { %>  
    <tr>
        <td> <strong>Deployment Unit</strong> </td>
        <td><% data.logicalComponentList[ele._id].forEach(gg=> { %>
                <div><%- gg %></div><% }) %>
        </td>
    </tr><% } if (ele.functionalRequirements && ele.functionalRequirements.length > 0) { %>
    <tr>
        <td> <strong>Functional Requirement</strong> </td>
        <td><% ele.functionalRequirements.forEach(function(fr){ %><div><%- fr.id %> - <%- fr.name %></div><% }); %></td>
    </tr><% } if (ele.architecturalDecisions && ele.architecturalDecisions.length > 0) { %>
    <tr>
        <td> <strong>Architecture Decision</strong> </td>
        <td><% ele.architecturalDecisions.forEach(function(ad){ %><div><%- ad.id%> - <%- ad.name %></div><% }); %></td>
    </tr><% } if (ele.nonFunctionalRequirements && ele.nonFunctionalRequirements.length > 0) { %>
    <tr>
        <td> <strong>Non Functional Requirement</strong> </td>
        <td><% ele.nonFunctionalRequirements.forEach(function(nfr){ %><div><%- nfr.id%> - <%- nfr.name %></div><% }); %></td>
    </tr><% } if (ele.physicalComponents && ele.physicalComponents.length > 0) { %>
    <tr>
        <td> <strong>Implementation</strong> </td>
        <td><% ele.physicalComponents.forEach(function(iml){ %><div><%- iml.name %></div><% }); %></td>
    </tr><% } if (data.genericGroup && data.genericGroup[ele._id]) { %>
    <tr>
        <td> <strong>Generic Group</strong> </td>
        <td><% data.genericGroup[ele._id].forEach(gg=> { %>
                <div><strong><%- gg.category %>,<%- gg.name %></strong>[<%- gg.type %>]</div>
                <div><%- gg.description %></div><% }) %>
        </td>
    </tr><% } if (ele.subDiagramID) { %>
    <tr>
        <td> <strong>Sub-Diagram</strong> </td><% if (data.subLink && data.subLink[ele.subDiagramID] && !data.subInfo[ele.subDiagramID].hideSubLink) { %>            
        <td><a href="<%- data.subLink[ele.subDiagramID] %>"><%- ele.subDiagramId %>
            </a></td><% } else if (data.subInfo && data.subInfo[ele.subDiagramID] && !data.subInfo[ele.subDiagramID].hideSubLink) { %>            
        <td><a href="<%- 'URL_' + ele.subDiagramID %>/"><%- ele.subDiagramId %>
            </a></td><% } else { %>
        <td><a href="<%- 'URL_' + ele.subDiagramID %>/"><%- ele.subDiagramId %>
            </a> (Not Exported)</td><% } %>
    </tr><% } %>
</table>
</details>
    <% }); %>
<% } %>



<% if (data.omLocations && data.omLocations.length > 0) { %>
###### OMLocation(s)

| Name | Description |
| --- | --- | 
<% data.omLocations.forEach(function(ele){ %> | <%- ele.name %> | <%- ele.description.replace(/>(https?[^<]*)<\/a>/g, '>`$1`</a>') %> |
<% }); %>
    
<% } %>


<% if (data.logicalConnectors && data.logicalConnectors.length > 0) { %>
###### Logical Connector(s)

<% if (data.logicalConnectors.length > 0 && data.informativeFlag.logicalConnectors == 1) { %>
| Name | Description |
| --- | --- |
<% data.logicalConnectors.forEach(function(ele){ %> <%if((ele.name != null && ele.name != "") || (ele.description != null && ele.description != "")) { %> | <%- ele.name %> | <%- ele.description.replace(/>(https?[^<]*)<\/a>/g, '>`$1`</a>') %> | <%} %>
<% }); %>
<% } %>

<% if (data.logicalConnectors.length > 0 && data.informativeFlag.logicalConnectors == 2) { %>
| Name | Description |
| --- | --- |
<% data.logicalConnectors.forEach(function(ele){%><%if((ele.name != null && ele.name != "") || (ele.description != null && ele.description != "")){%>|<%- ele.name %> | <%- ele.description.replace(/>(https?[^<]*)<\/a>/g, '>`$1`</a>') %> |
<%}%><% });%>

There are other connectors that have no names and descriptions.
<% } %>

<% if (data.logicalConnectors.length > 0 && data.informativeFlag.logicalConnectors == 3) { %>
All connectors are not named.
<% } %>
    
<% } %>



<% if (data.componentEvents && data.componentEvents.length > 0) { %>
###### Component Event(s)

<% if (data.componentEvents.length > 0 && data.informativeFlag.componentEvents == 1) { %>
| Name | Description | number |
| --- | --- | --- |
<% data.componentEvents.forEach(function(ele){ %> <%if((ele.name != null && ele.name != "") || (ele.description != null && ele.description != "")) { %> | <%- ele.name %> | <%- ele.description.replace(/>(https?[^<]*)<\/a>/g, '>`$1`</a>') %> | <%- ele.number %> | <%} %>
<% }); %>
<% } %>

<% if (data.componentEvents.length > 0 && data.informativeFlag.componentEvents == 2) { %>
| Name | Description | number |
| --- | --- | --- |
<% data.componentEvents.forEach(function(ele){%><%if((ele.name != null && ele.name != "") || (ele.description != null && ele.description != "")){%>|<%- ele.name %> | <%- ele.description.replace(/>(https?[^<]*)<\/a>/g, '>`$1`</a>') %> |
<%}%><% });%>

There are other component events that have no names and descriptions.
<% } %>

<% if (data.componentEvents.length > 0 && data.informativeFlag.componentEvents == 3) { %>
All component events are not named.
<% } %>
    
<% } %>


<% if (data.logicalNodes && data.logicalNodes.length > 0) { %>
###### Logical Node(s)

    <% data.logicalNodes.forEach(function(ele){ %>

<details markdown=1>
<summary markdown="span"><%- ele.name %></summary>

<table>
    <caption></caption>
    <tr>
        <td> <strong>Name</strong> </td>
        <td><%- ele.name %></td>
    </tr><% if (ele.description) { %>
    <tr>
        <td> <strong>Description</strong> </td>
        <td><%- ele.description %></td>
    </tr><% } if (ele.type) { %>
    <tr>
        <td> <strong>Type</strong> </td>
        <td><%- ele.type %></td>
    </tr><% } if (data.logicalNodesList && data.logicalNodesList[ele.name] && data.logicalNodesList[ele.name].taxonomies && data.logicalNodesList[ele.name].taxonomies.length > 0) { %>
    <tr>
        <td> <strong>Primary Capability</strong> </td>
        <td><% if (data.logicalNodesList && data.logicalNodesList[ele.name]) { data.logicalNodesList[ele.name].taxonomies.forEach(gg=> { %>
                <div><%- gg %></div><% }) } %></td>
    </tr><% } if (data.logicalNodesList && data.logicalNodesList[ele.name] && data.logicalNodesList[ele.name].physicalComponents && data.logicalNodesList[ele.name].physicalComponents.length > 0) { %>
    <tr>
        <td> <strong>Implementation</strong> </td>
        <td><% if (data.logicalNodesList && data.logicalNodesList[ele.name]) { data.logicalNodesList[ele.name].physicalComponents.forEach(gg=> { %>
                <div><a href="<%- gg.url %>"><%- gg.name %></a></div><% }) } %></td>
    </tr><% } if (data.logicalNodesList && data.logicalNodesList[ele.name] && data.logicalNodesList[ele.name].architecturalDecisions && data.logicalNodesList[ele.name].architecturalDecisions.length > 0) { %>
    <tr>
        <td> <strong>Architectural Decision</strong> </td>
        <td><% if (data.logicalNodesList && data.logicalNodesList[ele.name]) { data.logicalNodesList[ele.name].architecturalDecisions.forEach(gg=> { %>
                <div><a href="<%- 'URL_' + gg._id %>"><%- gg.name %></a></div><% }) } %></td>
    </tr><% } if (data.logicalNodesList && data.logicalNodesList[ele.name] && data.logicalNodesList[ele.name].nonFunctionalRequirements && data.logicalNodesList[ele.name].nonFunctionalRequirements.length > 0) { %>
    <tr>
        <td> <strong>Non Functional Requirement</strong> </td>
        <td><% if (data.logicalNodesList && data.logicalNodesList[ele.name]) { data.logicalNodesList[ele.name].nonFunctionalRequirements.forEach(gg=> { %>
                <div><a href="<%- 'URL_' + gg._id %>"><%- gg.name %></a></div><% }) } %></td>
    </tr><% } if (data.genericGroup && data.genericGroup[ele._id]) { %>
    <tr>
        <td> <strong>Generic Group</strong> </td>
        <td><% if (data.genericGroup && data.genericGroup[ele._id]) { data.genericGroup[ele._id].forEach(gg=> { %>
                <div><strong><%- gg.category %>,<%- gg.name %></strong>[<%- gg.type %>]</div>
                <div><%- gg.description %></div><% }) } %></td>
    </tr><% } if (data.diagramRelation && data.diagramRelation[ele._id] && data.diagramRelation[ele._id].diagram) { %>
    <tr>
        <td> <strong>Related Diagrams</strong> </td>
        <td><% if (data.diagramRelation && data.diagramRelation[ele._id] && data.diagramRelation[ele._id].diagram) { data.diagramRelation[ele._id].diagram.forEach(gg=> { %>
                <div><a href="<%- 'URL_' + gg.properties._id %>"><%- gg.properties.name %></a><% if (Array.isArray(data.instanceList) && !data.instanceList.includes(gg.properties._id)) { %> (Not Exported)<% } %></div><% }) } %></td>
    </tr><% } if (data.elementRelation && data.elementRelation[ele._id] && (data.elementRelation[ele._id].parentNodes && data.elementRelation[ele._id].parentNodes.length > 0) || (data.elementRelation[ele._id].childNodes && data.elementRelation[ele._id].childNodes.length > 0)) { %>
        <tr>
        <td> <strong>Related Elements</strong> </td>
        <td><% data.elementRelation[ele._id].parentNodes.forEach(gg=> { %>
                <div><%- gg.properties.name %></div><% if (gg.properties._id && data.diagramRelation && data.diagramRelation[gg.properties._id]) { data.diagramRelation[gg.properties._id].diagram.forEach(dia => { %>
                    <li><a href="<%- 'URL_' + dia.properties._id %>"><%- dia.properties.name %></a><% if (Array.isArray(data.instanceList) && !data.instanceList.includes(dia.properties._id)) { %> (Not Exported)<% } %></li><% }); } }); data.elementRelation[ele._id].childNodes.forEach(gg=> { %>
                <div><%- gg.properties.name %></div><% if (gg.properties._id && data.diagramRelation && data.diagramRelation[gg.properties._id]) { data.diagramRelation[gg.properties._id].diagram.forEach(dia => { %>
                    <li><div><a href="<%- 'URL_' + dia.properties._id %>"><%- dia.properties.name %></a><% if (Array.isArray(data.instanceList) && !data.instanceList.includes(dia.properties._id)) { %> (Not Exported)<% } %></div></li><% }); } }); %>
       </td>
    </tr><% } if (ele.subDiagramID) { %>
    <tr>
        <td> <strong>Sub-Diagram</strong> </td><% if (data.subLink && data.subLink[ele.subDiagramID] && !data.subInfo[ele.subDiagramID].hideSubLink) { %>            
        <td><a href="<%- data.subLink[ele.subDiagramID] %>"><%- ele.subDiagramId %>
            </a></td><% } else if (data.subInfo && data.subInfo[ele.subDiagramID] && !data.subInfo[ele.subDiagramID].hideSubLink) { %>
        <td><a href="<%- 'URL_' + ele.subDiagramID %>/"><%- ele.subDiagramId %>
            </a></td><% } else { %>
        <td><a href="<%- 'URL_' + ele.subDiagramID %>/"><%- ele.subDiagramId %>
            </a> (Not Exported)</td><% } %>
    </tr><% } %>
</table>
</details>
    <% }); %>
<% } %>




<% } %>
