UML Diagram Generator for Microsoft Dynamics 365

UML Diagram Generator for XrmToolBox

The UML Diagram Generator for Microsoft Dynamics 365 is a tool in the XrmToolBox that generates Entity Relationship Diagrams in the form of PlantUML files from metadata in Microsoft Dynamics 365 and the Power Platform Common Data Service.


PlantUML basics

PlantUML is plain text. This means you can version control your models and you can edit the models by manually editing the PlantUML files.

It is possible to generate visual diagrams from PlantUML ‘code’. Supported formats are PNG, SVG, and even Ascii art text files.

Sample model rendered from PlantUML generated from Dynamics 365.
Sample model rendered from PlantUML generated from Dynamics 365. Click to enlarge.

The current version of UML Diagram Generator is not generating the actual visual model, that is handled by the PlantUML service or if you choose to set up your own PlantUML server. There are plans to include the generation, see issue #42 on GitHub.

Using the tool

Start the tool and connect to an environment.

Launching UML Diagram Generator in XrmToolBox

Load entities, and then you can start checking the entities, attributes and relationships you want to include in the model.

UML Diagram Generator for XrmToolBox
UML Diagram Generator for XrmToolBox. Click to enlarge.

Try the Options button, to see how the generated file can be modeled.

UML Diagram Generator options

When you are happy with the selections and options, hit the Generate button to create the PlantUML file.

Getting started with PlantUML

VS Code extension

The easiest way to get started after installing UML Diagram Generator for Microsoft Dynamics 365 is to install an extension to VS Code and view the files from there. My suggestion is to use the extension by jebbs from the Visual Studio Marketplace.

Extension configuration

In VS Code, go to File – Preferences – Settings.
Expand Extensions, and find the PlantUML configuration.

You only need to change/verify two settings: Render and Server:

PlantUML extension for VS Code settings.

The rest of the settings can be left with default values.

Now open the generated PlantUML file, and simply right-click and select Preview Current Diagram.

PlantUML in VS Code
PlantUML in VS Code

You can also export the diagram as rendered visual files, just right-click and select Export Current Diagram.

PlantUML output format

This will now prompt you to select which file format to generate. The prompt is popping up at the top of the VS Code window, if you’re not used to VS Code this is not always super clear.

PlantUML rendered files

The generated file will by default be placed in a folder under the PlantUML file named as the PlantUML file, and the file name will be the name of the @startuml tag, which is the same as the Title defined in the options in the tool.

In the above image:
..\CoolRappRockets\Model is the folder where the tool saved the generated file
Cool2 is the name of the generated file
Cool Rapp Rockets is the Title set in the options.


Online alternatives

There are also online services generating the model from the PlantUML code, try for example planttext.com where you can past the code from your generated file.

Other options

There are lots and lots of options for generating visual models out there, have a look at the PlantUML webpage for a complete list.


Glossary

TermExplanation
UMLUnified Modelling Language (wikipedia)
PlantUMLOpen source initiative standardizing textual representation of UML diagrams (wikipedia)
ERDEntity Relationship Diagram (wikipedia)
D365Microsoft Dynamics 365 (or CRM for previous versions also supported)
CDSCommon Data Service
XrmToolBoxApplication with 150+ open source driven tools for the Microsoft Dynamics 365 / CRM / CDS platforms

4 thoughts on “UML Diagram Generator for Microsoft Dynamics 365

  1. Does not work in XRM toolbox, missing assembly “Rappen.XTB.LCG.UDG.Common, version 1.2020.1.

    1. Hi Yanus,

      I have seen a few occasions where this error shows up after installation of the tool. Did you try restarting XrmToolBox and give it another shot?

      Best Regards,
      Jonas

  2. Hi Jonas.

    I am getting following error for last couple of days.
    Any suggestion?

    Thanks
    Narayan

    ———

    Error: 403 Forbidden

    GET https://www.plantuml.com/plantuml/svg/0/
    at ClientRequest.closeCallback (c:\Users\PCNAME\.vscode\extensions\jebbs.plantuml-2.13.11\out\src\plantuml\renders\httpWrapper.js:77:27)
    at ClientRequest.emit (events.js:203:13)
    at TLSSocket.socketCloseListener (_http_client.js:358:9)
    at TLSSocket.emit (events.js:208:15)
    at net.js:588:12
    at TCP.done (_tls_wrap.js:479:7)

    1. Had a friend with this exact problem the other day, his issue was he was on a VPN connection that didn’t allow him to access the plantuml server. Could that be it?
      Rendering works fine for me.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.