Chapter 6: Accessing Variables in medini analyze

To access variables assigned in medini analyze, use the variable name in an M2Doc field, as shown below.

{ m:stringVariable }

During report generation, medini analyze replaces the field with the value of the variable.

Variables represent either strings or objects.

  • Strings are information such as the report title. In medini analyze, strings are listed in the M2Doc configuration in the Note column

  • Objects are medini analyze artifacts. Objects are listed in the Related Artifacts column. When objects are listed there, any text in the Note field is ignored. See the screenshot below.

    Note that variable names are case-sensitive. Brackets or white spaces are not allowed.

Example

This example shows a DOCX template, the report configuration, and the resulting output.

Example 6.1: Sample template

Text: { m:stringVariable }

Requirements: Model { m:objectVariable.name } with { m:objectVariable.requirements->size() } requirements at top level.

Just the object: { m:objectVariable }


Example 6.2: Report configuration in medini analyze

To generate an M2Doc report, you must first configure it in medini analyze. The following image shows how the variables appear in the medini analyze configuration dialog. For more information about configuring and generating reports in medini analyze, see the Ansys medini analyze User Guide.


Example 6.3: Sample output result

Text: This is a string for output in the report.

Requirements: Model Technical Safety Requirements with 3 requirements at top level.

Just the object: de.ikv.analyze.metamodel.safetygoals.impl.SafetyRequirementsModelImpl@b4d2e8a0 (eClass: org.eclipse.emf.ecore.impl.EClassImpl@7799da79 (name: SafetyRequirementsModel) (instanceClassName: null) (abstract: false, interface: false)) (mediniIdentifier: _qdRrgHVYEeSHJr9dJxG-Iw) (name: Technical Safety Requirements, description: , identifier: null)