MMEL Authoring Guide

1. Creating a model

1.1. Creating a new model from scratch

A new MMEL model is created within a repository. The model is identified by a namespace that serves as a unique identifier across the system.

1.1.1. Step 1: Create new model in repository

Navigate to the repository and create a new model. Assign a namespace that acts as the model's unique identifier.

The namespace should follow a convention that reflects the source document. For example, for a model of BS 6004, use:

namespace BS6004

1.1.2. Step 2: Fill in model metadata

Enter the model metadata fields to properly identify and describe the model.

The following metadata fields are available:

Field Description
Title The human-readable title of the model
Schema The MMEL schema version used
Edition The edition number of the model
Author The person or organization responsible for the model
Shortname A short identifier for the model
Namespace The unique identifier for the model (e.g., BS6004 )

Example metadata:

model BS6004 <1.0.0> {
  title "Electric cables — Thermoplastic insulated and sheathed cables
         for voltages up to and including 300/500 V"
  shortname "BS 6004"
  author "BSI"
  namespace BS6004
}

1.1.3. Step 3: Add model components

After setting up the metadata, add the various model components that make up the model. These include:

  • Roles -- actors and approvers in the processes
  • References -- citations to external document clauses
  • Data registries -- data storage backed by data classes
  • Data classes -- custom data structures
  • Enumerations -- predefined lists of values
  • Events and processes -- the flow of activities
  • Provisions -- compliance requirements with RFC 2119 modality

Each component type is described in detail in #model-components .

1.2. Converting an existing standard to a model

MMEL supports importing content from existing standards documents to accelerate the modeling process.

1.2.1. Load text using Document Import

Use the Document Import feature to load the text of the source standard. The import process parses the document structure and makes its content available for conversion into model components.

1.2.2. Open the reference document

Once loaded, open the reference document within the editor. The document content is displayed alongside the model editor, allowing side-by-side comparison and selection of text to convert.

1.2.3. Select and convert to components

Select portions of the loaded text and convert them into model components. The editor supports conversion into:

  • Sections -- for structural content (Foreword, Introduction, Scope, etc.)
  • Terms and definitions -- for terminology entries
  • Provisions -- for requirements, recommendations, and permissions
  • References -- for citations to other clauses or documents

1.2.4. Import provisions with auto-detected modality

When importing provisions, the system automatically detects the RFC 2119 modality keyword (SHALL, SHOULD, MAY, CAN, MUST) used in the original text. The modality is assigned to the provision accordingly.

Additionally, the system auto-creates references from detected clause numbers in the source text, linking each provision back to its origin in the standard.

provision P_9_2_1_a {
  text "The organization SHALL conduct internal audits at planned intervals"
  modality SHALL
  reference BS202000_9_2_1
}

2. Model Editor

The Model Editor is the primary interface for viewing and editing MMEL models. It provides a visual diagram canvas along with controls for navigation, display, and model management.

2.1. Model Editor interface

The Model Editor interface consists of the following areas:

Area Description
UI display panel The main canvas for viewing and editing diagrams. Displays the current diagram with all its flow components and connections.
Path display Shows the path of the current diagram within the model hierarchy, indicating which process or subprocess is being viewed.
Menu toolbar Provides access to model-level operations such as saving, importing, and model settings.

2.1.1. Control components

The editor provides the following display controls:

Control Description
Zoom in Increases the magnification of the diagram
Zoom out Decreases the magnification of the diagram
Fit diagram Automatically scales the diagram to fit the viewport
Lock diagram Locks the diagram to prevent accidental edits

2.1.2. Show/Hide options

The editor offers toggle options for controlling the visibility of diagram elements:

Option Description
Show/Hide data components Toggle the display of data-related elements (registries, classes) on the diagram
Show/Hide remove edge button Toggle the display of edge deletion controls on connection lines
Show/Hide element IDs Toggle the display of internal element identifiers on diagram nodes

2.2. Saving the model

The Model Editor provides multiple levels of saving:

2.2.1. Save update to model

Saves the current edits to the model in memory. The changes are preserved within the current editing session but are not yet committed to the repository.

2.2.2. Save model to repository

Commits the model (including all in-memory changes) to the repository for persistent storage. This makes the model available to other users and sessions.

IMPORTANT
Always save to the repository before closing the editor to avoid losing work.

2.2.3. Future: undo/redo support

Undo and redo functionality is planned for a future release. Once implemented, it will allow reverting and reapplying changes within an editing session.

3. Model components

This section describes each type of component that can be defined in an MMEL model.

3.1. Metadata

Model metadata is configured through the Model Editor under Model Settings > Metadata .

The metadata fields identify and describe the model:

Field Description
Title Full title of the model
Schema MMEL schema version
Edition Model edition number
Author Person or organization responsible
Shortname Abbreviated identifier
Namespace Unique identifier for the model

3.2. Sections

Sections represent structural parts of the source document used for document generation. Each section has:

  • An internal ID (unique within the model)
  • A title
  • Text contents

Sections correspond to clauses, subclauses, and annexes in the source standard.

section S_1 {
  id "1"
  title "Scope"
  text "This document specifies requirements for..."
}

3.3. Terms and definitions

Terms and definitions capture the terminology used in the source document.

NOTE
Future integration with Glossarist is planned for enhanced terminology management.

Each term entry includes:

Field Description
ID Unique identifier for the term
Term The preferred term
Admitted terms Alternative accepted terms
Definition The definition text
Notes Explanatory notes accompanying the definition
term T_cable {
  term "cable"
  admitted "cable assembly"
  definition "length of insulated conductor(s)..."
  note "Cables may include one or more conductors."
}

3.4. Roles

Roles represent the actors and approvers involved in the modeled processes. Each role has:

  • A unique Role ID
  • A display name

Roles are referenced by processes (as actors) and by approvals (as approvers).

role Organization {
  display_name "The organization"
}
role TopManagement {
  display_name "Top management"
}

A process references a role via the actor keyword:

process ConductAudit {
  actor Organization
}

An approval references both an actor and an approver:

approval ApproveAuditResults {
  actor Organization
  approver TopManagement
}

3.5. References

References link model elements to specific clauses in external standards or documents. Each reference specifies:

Field Description
Document The source document identifier
Clause The clause number within the document
Title A description of the referenced content

Batch insertion is supported, allowing multiple references to be created at once from a list of clause numbers.

reference BS202000_9_2_1 {
  document "BS 202000"
  clause "9.2.1"
  title "Internal audit"
}

3.6. Data registries

A data registry is a data store identified by an ID and display name. It is backed by a data class that defines its structure.

Each attribute in the registry has:

  • Cardinality -- whether the attribute is singular or multiple (e.g., 1..1, 0..*)
  • Modality -- the RFC 2119 modality if the attribute represents a requirement
  • Type -- the data type of the attribute (see #attribute-types)
data_registry RiskPlan {
  display_name "Risk Plan"
  data_class RiskPlan#data
}

3.7. Attribute types

The following attribute types are available:

Type Description
String Free-form text value
Boolean True/false value
Datetime Date and/or time value
Role A value selected from the defined roles in the model

3.8. Data classes

Data classes define custom data structures. They differ from data registries in a key way:

  • A data registry is a data store that persists data instances.
  • A data class is a structural definition used to define the shape of data.
class RiskPlan#data {
  attribute name : String [1..1]
  attribute description : String [0..1]
  attribute approved : Boolean [1..1]
}

3.9. Enumerations

Enumerations define a drop-down list of possible values. They are used to constrain attribute values to a predefined set.

enum CableType {
  value "Single-core"
  value "Multi-core"
  value "Flexible"
}

3.10. Measurements and view profiles

Measurements define quantitative variables that can be used in process tests and gateway conditions.

For detailed instructions on creating and using measurements, refer to the MMEL Modeling Methodology Guide .

3.11. Tables

Tables serve dual purposes in MMEL:

  • Visual tabular content -- displayed as part of the model documentation
  • Internal database -- used to store structured data that can be queried by measurements

Tables can be viewed in two ways:

  • Table view -- displays the data in a traditional tabular grid
  • Class view -- displays the data structured according to its backing data class

Tables support CSV export and import for data exchange with external tools.

3.12. Multimedia

MMEL supports the following multimedia types:

Type Description
Figure Static images embedded in the model
Video Video content referenced or embedded
3D model Three-dimensional model content

4. Diagram editing

MMEL diagrams are composed of flow components connected by edges. This section describes the available flow components and how to work with them.

4.1. Flow components

There are 7 flow components available for building diagrams:

Component Description
Process An activity or task performed by an actor
Approval A decision point requiring approval from a designated approver
Start event Marks the beginning of a flow (one per diagram)
End event Marks the end of a flow
Timer event Represents a time-based trigger (wait or repeat)
Signal event Captures an external signal to trigger a process
Gateway Provides conditional branching in the flow

4.2. Process

A Process is the primary component for representing activities in a flow.

4.2.1. Quick edit

Processes support inline quick editing for rapid content entry. Click on a process node to edit its label and basic properties directly on the diagram.

4.2.2. Subprocess diagrams

A process can contain a subprocess diagram. This allows hierarchical decomposition where a high-level process is expanded into a detailed sub-flow.

4.2.3. Input/output registry

Processes can reference data registries as input and output:

process ConductAudit {
  actor Organization
  input_registry AuditRecords
  output_registry AuditReport
}

4.2.4. Provisions and notes

Processes can carry provisions (compliance requirements) and notes:

process ConductAudit {
  actor Organization
  validate_provision P_9_2_1_a
  note "Internal audits must be conducted at planned intervals."
}

4.2.5. Measurement tests

Processes can include measurement tests that evaluate quantitative conditions:

process TestCable {
  measurement_test "[tm] <= 0.9 * [tn] - 0.1"
}

4.3. Approval

An Approval component represents a decision point where an actor seeks approval from an approver.

approval ApproveAudit {
  actor Organization
  approver TopManagement
  modality SHALL
}

The approval creates an approval record that documents the decision.

4.4. Start event

The Start event marks the beginning of a flow. Each diagram has exactly one Start event.

  • No editing is required -- the Start event is automatically placed when a diagram is created.
  • It cannot be deleted.

4.5. End event

The End event marks the termination of a flow. It is placed at the end of each path through the diagram.

  • End events are deletable.
  • A diagram may have multiple End events when different paths terminate independently.

4.6. Timer event

A Timer event represents a time-based trigger. Two modes are supported:

Mode Description
WAIT The process waits for a specified time period before proceeding
REPEAT The process repeats at a specified frequency
timer_event PlannedIntervals {
  mode REPEAT
  value "12 months"
}

4.7. Signal event

A Signal event captures an external signal that triggers a process. Signals are used to model event-driven behavior where a process waits for a specific external condition.

4.8. Gateway

Gateways provide conditional branching in the flow. They control which path(s) are taken based on conditions.

4.8.1. Edge descriptions

Edges connected to a gateway can have descriptions that label the path:

edge Gateway1_to_ProcessA {
  description "Conforms to requirements"
}

4.8.2. Conditions using measurement variables

Gateway edges can use measurement variables as conditions:

edge Gateway1_to_ProcessA {
  condition "[sterile] = 'true'"
}

4.8.3. Connecting edges

Edges connect to gateway nodes with the following convention:

  • Top of the gateway node = incoming edge
  • Bottom of the gateway node = outgoing edge(s)

4.8.4. Reusing process components

Processes can be reused across diagrams using the following mechanism:

  • Mark Process -- marks a process component for reuse
  • Bring in marked -- inserts a previously marked process into the current diagram

When a marked process is brought into another diagram, it is referenced (not copied). Any update to the original process is reflected in all diagrams that reference it.

4.8.5. Deleting edges

Edges can be deleted by selecting the edge and using the remove edge control (visible when the "Show remove edge button" option is enabled).

4.9. Process reuse

A single process component can appear in multiple diagrams. This is achieved through referencing -- all instances of the process share the same definition.

IMPORTANT
When a process is updated in one diagram, the change is reflected in all diagrams that contain that process. This ensures consistency across the model.

5. Document Import

Document Import is the process of loading content from an existing standard document into the MMEL model editor. This section describes the workflow and best practices.

5.1. Document import workflow

The document import workflow follows these steps:

  1. Load the source document text into the editor
  2. Review the loaded content and identify sections to convert
  3. Select text elements and convert them to model components
  4. Verify the imported components and adjust as needed

5.2. Loading text from reference documents

To begin, load the text of the reference document (the standard being modeled) into the Document Import interface. The editor parses the document structure, identifying:

  • Clauses and subclauses
  • Paragraphs and lists
  • Tables and figures
  • Terminology sections

The parsed content is presented for selection and conversion.

5.3. Selecting and converting text to model components

Select portions of the loaded text and choose the target component type. The supported conversions include:

Source content Target component
Clause text Section
Terminology entries Terms and definitions
Requirement text Provision
Clause references Reference
Tabulated data Table

5.4. Auto-creating references from clause numbers

When text is imported, any clause numbers detected in the content are automatically converted into references. For example, text containing "as specified in clause 9.2.1" will create a reference to clause 9.2.1 of the source document.

5.5. Importing provisions with auto-detected modality

Provisions are imported with their RFC 2119 modality keyword automatically detected from the source text:

Keyword Modality
SHALL Mandatory requirement
SHOULD Recommendation
MAY Permission
CAN Capability
MUST Absolute requirement

The detected modality is assigned to the provision, and the provision is linked to the corresponding reference in the source document.

5.6. Suggestions for document import

The following practices help ensure accurate and efficient document import:

  • Review each imported component -- auto-detection is helpful but may misinterpret context. Verify that each provision's modality and reference are correct.
  • Import in logical order -- start with structural components (sections, terms), then import provisions. This ensures that references and terms are available when provisions are created.
  • Use batch operations -- when multiple references or terms can be imported at once, use batch insertion to save time.
  • Preserve original wording -- the text of imported provisions should maintain the exact wording from the source document. Do not paraphrase or summarize.
  • Check coverage -- after import, verify that all requirements in the source document have corresponding provisions in the model. The coverage should be 100%.
  • Verify cross-references -- ensure that all clause references detected during import are correctly linked to the appropriate reference entries.