Querying Diagrams

If you want to retrieve a diagram or diagrams, and to output content like the diagram's image, name or a list of containing diagram elements, etc., read this section to learn the ways to retrieve diagrams.

Querying Diagrams in Project

If you want to output the image or any detail of all the diagrams in project, write a ${DIAGRAM} field in your Word document with LoopInProject specified as diagram source. Here are several examples of such a ${DIAGRAM} field:

${DIAGRAM, "Name of ALL Use Case Diagrams", "UseCaseDiagram", LoopInProject, PROPERTY=name}

${DIAGRAM, "Description of ALL diagrams", , LoopInProject, PROPERTY=description}

${DIAGRAM, "Details of ALL Use Case Diagram and class diagram", "UseCaseDiagram,ClassDiagram", LoopInProject, MyTemplate}

In the first example, the name of all Use Case Diagrams in the project will be output. Note that "Name of ALL Use Case Diagrams" is the field name, which is a required and unique value for identifying this field.

In the second example, the description of all the diagrams in the project will be output.

In the third example, content will be output for each of the Use Case Diagrams and Class Diagrams in the project, based on the template MyTemplate.

Querying Selected Diagrams in Project

The diagrams in your project may be created for different contexts or about different problem domains. When you write a documentation, you may want to focus on a specific context at a time, which requires the insertion of design specification for that specific context. In that case, you will want to query a selected set of diagrams in your project, instead of querying all diagrams.

If you want to output the image or any detail of selected diagrams in project, write a ${DIAGRAM} field in your Word document with Any specified as diagram source. Here are several examples of such a ${DIAGRAM} field:

${DIAGRAM, "Use Case Diagrams (Admin)", "UseCaseDiagram", Any, PROPERTY=name}

${DIAGRAM, "Diagram Images", , Any, IMAGE}

${DIAGRAM, "Diagram Images", , Any, MyTemplate}

In the first example, the name of selected Use Case Diagrams in the project will be output. Note that "Use Case Diagrams (Admin)" is the field name, which is a required and unique value for identifying this field.

In the second example, the image of selected diagrams in the project will be output.

In the third example, content will be output for each of the selected diagrams in the project, based on the template MyTemplate.

When you pick-up a Doc Base with such a ${DIAGRAM} field in it, you can select the diagrams to query in Doc. Composer.

Querying Specific Diagram in Project

Let's say you have created multiple Use Case Diagrams for multiple sub-systems. When you write a documentation for a specific sub-system, you may want to insert the design specification related to that specific sub-system. In that case, you will want to query a specific Use Case Diagram in your project.

If you want to output the image or any detail of a specific diagram in project, write a ${DIAGRAM} field in your Word document with One specified as diagram source. Here are several examples of such a ${DIAGRAM} field:

${DIAGRAM, "ATM Overview", "UseCaseDiagram", One, PROPERTY=description}

${DIAGRAM, "Online Photo Album", , One, IMAGE}

${DIAGRAM, "CS System – Use Cases", , One, Children}

In the first example, the description of selected Use Case Diagram in the project will be output. Note that "ATM Overview" is the field name, which is a required and unique value for identifying this field. 

In the second example, the image of selected diagram in the project will be output.

In the third example, content will be output for the selected diagram in the project, based on the template Children.

When you pick-up a Doc Base with such a ${DIAGRAM} field in it, you can select the diagram to query in Doc. Composer.

Querying Sub-Diagrams from Specific Model Element

Let's say you have created several use cases and, for each use case, there are multiple sub-Business Process Diagrams that describe the business workflow in which the use case might happen. When you write a use case report, you may want to present the details of the Business Process Diagrams of a chosen use case. In that case, you will want to query the sub-diagrams of a selected use case.

If you want to output the image or any detail of sub-diagrams from a specific model element, write a ${DIAGRAM} field in your Word document with LoopInElement specified as diagram source. Here are several examples of such a ${DIAGRAM} field:

${DIAGRAM, "Related Business Workflow", "BusinessProcessDIagram", LoopInElement, PROPERTY=name}

${DIAGRAM, "Images of Sub-Diagrams", , LoopInElement, IMAGE}

${DIAGRAM, "Sub Diagram Details", , LoopInElement, MySubDiagrams}

In the first example, the name of sub-Business Process Diagrams of the selected model element will be output. Note that "Related Business Workflow" is the field name, which is a required and unique value for identifying this field.

In the second example, the image of sub-diagrams of a selected model element will be output.

In the third example, content will be output for each of the sub-diagrams of a selected model element, based on the template MySubDiagrams.

When you pick-up a Doc Base with such a ${DIAGRAM} field in it, you can select the model element to query in Doc. Composer.

Related Resources

The following resources may help you to learn more about the topic discussed in this page.

 
8. Doc Fields in Detail Table of Contents 10. Querying Model Elements
 

Technical Support

Have technical issues or suggestions? Please contact Visual Paradigm Support Team.

Sales Support

Have questions related to registration, licensing or payment? Feel free to contact Visual Paradigm Sales Team.

Discussion Forum

Share your suggestions of opinions at VP Discussion Forum.