Book a Demo

Author Topic: Document Generation - Connector target is a diagram  (Read 23489 times)

andrew.francis

  • EA Novice
  • *
  • Posts: 6
  • Karma: +0/-0
    • View Profile
Document Generation - Connector target is a diagram
« on: December 03, 2025, 09:35:07 pm »
Hi, I'm hoping I have missed an easy option and there is a quick solution to this problem.

I have a package full of Use Cases, and each Use Case has an associated Sequence Diagram or State Diagram in another package. I want to generate a document where I show a Use Case followed by it's associated (linked via Trace) Diagram, but I cannot work out how to do it as the Element >> Connector >> Target doesn't have an option to include a diagram.

Temporarily I have just put the Use Cases in individual Packages, so that I can drop the Use Case package on followed by the Diagram package, but this is not ideal.

Any help greatly appreciated!

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13495
  • Karma: +572/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Document Generation - Connector target is a diagram
« Reply #1 on: December 03, 2025, 11:03:43 pm »
There's no easy way to do that in a single template.

The easiest way is to create a virtual document with model documents that point to
- the use case
- the Interaction/State Machine that owns the diagram.

There are ways of making template fragments that use code to fetch the correct diagram, but is rather complicated.

Geert

andrew.francis

  • EA Novice
  • *
  • Posts: 6
  • Karma: +0/-0
    • View Profile
Re: Document Generation - Connector target is a diagram
« Reply #2 on: December 04, 2025, 01:12:36 am »
Hi Geert, thanks for the reply.

I am currently using a virtual document (document artifact) and a number of model document elements with different templates for heading levels etc. - I think this is what you are recommending.

Currently I am pointing the model document at each individual Use Case (which is in it's own package), and then at the Diagram (which is also in it's own package).
- I would like to be able to move the use cases into a single package.
- I don't mind whether I keep the diagrams in their own packages.

I wasn't sure whether I would be able to use a fragment, as I don't know if I can point fragments at packages while the main template loops through the Elements?
and I wasn't sure how to point the template at the Interaction/State Machine - how would you go about this?

Thanks again!

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13495
  • Karma: +572/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Document Generation - Connector target is a diagram
« Reply #3 on: December 04, 2025, 05:39:35 pm »
and I wasn't sure how to point the template at the Interaction/State Machine - how would you go about this?
I use a search that returns an element based on it's guid.

Geert

PDC

  • EA User
  • **
  • Posts: 118
  • Karma: +5/-0
  • Systems Engineer
    • View Profile
Re: Document Generation - Connector target is a diagram
« Reply #4 on: December 05, 2025, 07:30:31 pm »
Just asking the obvious question (because this is what I would ask to our team of architects if we had this issue): do the diagrams HAVE to exist in a different Package to the UCs? If there is a strongly-defined relationship between the UC and a Sequence Diagram, would it not be appropriate to store the Interaction/SD within the UC in the Package structure (similar for the State Machines)? I think this would let you pull the diagrams in much more easily within a fragment.

As ever, it's just a suggestion and I'm keen to learn if this is not an appropriate solution :)
Phil

andrew.francis

  • EA Novice
  • *
  • Posts: 6
  • Karma: +0/-0
    • View Profile
Re: Document Generation - Connector target is a diagram
« Reply #5 on: December 06, 2025, 01:22:47 am »
I think this would give me the same issue whereby I would struggle to get the document to generate with a Use Case followed by it's diagrams. I don't think there is a way to point fragments at diagrams ?? as they are just called within a template which is associated to a Model Document element.

If I can point a fragment at a package that would fix my issue.

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13495
  • Karma: +572/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Document Generation - Connector target is a diagram
« Reply #6 on: December 06, 2025, 01:49:11 am »
I think this would give me the same issue whereby I would struggle to get the document to generate with a Use Case followed by it's diagrams. I don't think there is a way to point fragments at diagrams ?? as they are just called within a template which is associated to a Model Document element.

If I can point a fragment at a package that would fix my issue.
The fragment will always point to the package/element is was called upon.
With different model documents however you can use one model document that points to the use case, and the next that points to the Interaction.
Or you can put them in different packages and let the model document point to the package by dragging the package onto the model document.

Geert

andrew.francis

  • EA Novice
  • *
  • Posts: 6
  • Karma: +0/-0
    • View Profile
Re: Document Generation - Connector target is a diagram
« Reply #7 on: December 09, 2025, 08:40:47 pm »
With different model documents however you can use one model document that points to the use case, and the next that points to the Interaction.

Hi Geert, thanks for the reply again, I appreciate that I could do this if all the Use Cases are in individual packages, but how could I do this when the Use Cases are in a single package? I'd be pointing the Model Document at the Package and using a template that is specifically pointing at the single use case? Via a GUID or something like that?

If that's the case I would need 100+ individual templates to point at each use case...

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13495
  • Karma: +572/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Document Generation - Connector target is a diagram
« Reply #8 on: December 09, 2025, 08:51:27 pm »
You don't use the template to point to a single element, but the model document.

And yes, if you have 50 use cases in a single package, you would have 100 model documents (one for each use case, and one for each interaction)
That's why I usually automate the creation of the virtual document with a script.

I have an article on my website that explains this in more detail: https://bellekens.com/2015/11/12/tutorial-generate-complex-documents-from-enterprise-architect-with-a-two-step-semi-automated-approach/

Geert