!include being added to the end of diagram

0 votes
asked May 19, 2023 in Question / help by rafaelgilardino (120 points)

Hello everyone,

Summary:

I'm currently finding ways to optimize my project documentation and I realized a opportunity to re-use documentation from other elements of my architecture. While doing so I've stumbled into this issue that I'm not quite sure how to solve, hope the community could assist with that.

Problem statement:

When adding the function !include into my second diagram it gets added to the end of the definition however I wanted to have within it's respective section called "eventNotification:"

Files & content:

File1 = ResourceInventoryEvents.puml

@startyaml ResourceInventoryEvents
PublishedEvent:
   ResourceInventoryManagement:
    - resourceCreateEvent
   ResourcePoolManagement:
    - reservationStateChangeNotification
   ProcessFlowManagement:
    - processFlowCreateEvent
    - taskFlowInformationRequiredEvent
SubscribedEvent:
   ResourceCatalogManagement:
    - resourceSpecificationDeleteEvent
   ResourceInventoryManagement:
    - resourceCreateEvent
   PartyRoleManagement:
@endyaml

File2 = ResourceInventory - ComponentImplementation.puml

@startyaml ResourceInventoryComponentImplementation
apiVersion: oda.tmforum.org/v1alpha1
kind: component
metadata:
  labels:
    oda.tmforum.org/componentName: Resource Inventory
    oda.tmforum.org/funtionalBlockName: Production
  name: TAG_REALESE_NAME - Resource Inventory
spec:
  componentKinds:
  - group: core
    kind: Inventory
  coreFunction:
    exposedAPIs:
      - name: ResourceInventoryManagement
        specification: https://raw.githubusercontent.com/tmforum-apis/TMF639_ResourceInventory/master/TMF639-ResourceInventory-v4.0.0.swagger.json
        required: true
        implementation: /{{.Release.Name}}-ResourceInventoryManagement
        path: /{{.Release.Name}}-{{.Values.component.type}}/tmf-api/resourceInventoryManagement/v4/
        developerUI: /{{.Release.Name}}-{{.Values.component.type}}/tmf-api/resourceInventoryManagement/v4/docs
        port: 8080
    dependantAPIs:
      - name: ResourceCatalogManagement
        specification: https://raw.githubusercontent.com/tmforum-apis/TMF634_ResourceCatalog/master/TMF634-ResourceCatalog-v4.0.0.swagger.json
        required: true
        implementation: /{{.Release.Name}}-ResourceCatalogManagement
        path: /{{.Release.Name}}-{{.Values.component.type}}/tmf-api/resourceCatalog/v4/
        developerUI: /{{.Release.Name}}-{{.Values.component.type}}/tmf-api/resourceCatalog/v4/docs
        port: 8080
    managementAPIs:[]
  eventNotification:
        !include ResourceInventoryEvents.puml!ResourceInventoryEvents

  maintainers:
    - email: kamal.maghsoudlou@ericsson.com
      name: Kamal Maghsoudlou
  management: []
  owners:
    - email: kamal.maghsoudlou@ericsson.com
      name: Kamal Maghsoudlou
  security:
    securitySchemes:
      bearerAuth:
        type: http
        scheme: bearer
        bearerFormat: JWT
  selector:
    matchLabels:
      oda.tmforum.org/componentName: Resource Inventory
  type: Resource Inventory
  version: 1.0.0
@endyaml 

Results:

wrong result: https://ibb.co/gMLgLhr

Expected result: https://ibb.co/fpRRk47

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:

[Antispam2 Feature: please please wait 1 or 2 minutes (this message will disappear) before pressing the button otherwise it will fail](--------)
To avoid this verification in future, please log in or register.
...