diff --git a/.gitignore b/.gitignore
index 84011b6..0a4f54e 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,4 +1,3 @@
/gen
/bin
-/data-model-uml
/tasks/generate.xml
diff --git a/.gitmodules b/.gitmodules
new file mode 100644
index 0000000..62d8331
--- /dev/null
+++ b/.gitmodules
@@ -0,0 +1,3 @@
+[submodule "data-model-uml"]
+ path = data-model-uml
+ url = git@github.com:datafoodconsortium/data-model-uml.git
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 7549a31..f969643 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -16,6 +16,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- `getOperationsToImplementOrDeclare`.
### Changed
+- Add `data-model-uml` as a Git submodule (see [Issue
+ #30](https://github.com/datafoodconsortium/connector-codegen/issues/30))
+
TypeScript:
- Ensure the entry point, `src/index.ts`, is always regenerated on fresh builds.
diff --git a/README.md b/README.md
index fee89c6..4b181ff 100644
--- a/README.md
+++ b/README.md
@@ -18,7 +18,7 @@ You should install the Eclipse Modeling Tool, an Eclipse IDE version configured
Once you installed the required plugins, you will need to import this project into your Eclipse workspace. Clone this repo then click on `File > Open project from file system` and select the folder you just cloned.
-In order to generate code, you will need the UML model itself. Clone the repository and import it in your Eclipse installation like you did before.
+Since v1.2.0 of `connector-codegen`, the [UML model](https://github.com/datafoodconsortium/data-model-uml) is included as a Git [submodule](https://git-scm.com/book/en/v2/Git-Tools-Submodules) and will appear as a subdirectory symlink when you clone `connector-codegen`. See below for more details on [data model versioning](#data-model-versioning).
Finally, to launch the generation you will need a launch configuration. To create a new one in Eclipse, click on `Run > Run configurations...` and add a new Acceleo configuration. Like on the following picture:
- select the "connector-codegen" project;
@@ -26,11 +26,11 @@ Finally, to launch the generation you will need a launch configuration. To creat
- provide the UML model;
- and a folder in which to generate.
-
+
In the "Properties Files" tab, pass the `default.properties` file like on the following picture. The content of this file is detailed in the "Properties" section below.
-
+
The configuration is now ready, click on "Apply" and "Run".
@@ -226,4 +226,68 @@ In order to generate, this file MUST be loaded in the launch configuration or pa
| `stereotype` | In the generator we need to get data associated to certain stereotypes like the name of a getter method for instance. This property points to the location of the corresponding stereotype in the UML model. Ex: `stereotypeGetter = datafoodconsortium_connector::getter`. |
| `stereotype_` | In the generator we need to get data associated to certain properties of stereotypes like the name of the mapping property for instance. This property points to the name of the corresponding property in the UML model. Ex: `stereotypeSemantic_map = map`. |
-[model specifications]: https://datafoodconsortium.gitbook.io/dfc-standard-documentation/connector/model-specifications
\ No newline at end of file
+[model specifications]: https://datafoodconsortium.gitbook.io/dfc-standard-documentation/connector/model-specifications
+
+## Data Model Versioning
+
+Since v1.2.0 of `connector-codegen`, the [UML model](https://github.com/datafoodconsortium/data-model-uml) is included as a Git [submodule](https://git-scm.com/book/en/v2/Git-Tools-Submodules) and will appear as a subdirectory symlink when you clone `connector-codegen`. To ensure you have the correct version of the model, you can simply run the following from the root directory of the `connector-codegen` repository:
+
+```sh
+git submodule update
+```
+
+This can be helpful when switching between branches or previous versions, and
+will ensure that every commit of the connector is pegged to one specific commit
+from the data model.
+
+When new versions of the model are available, the connector be updated by changing to the `data-model-uml/` subdirectory and pulling the changes from the model's remote repository. When you change back to the connector's root directory, git will start tracking the commit hash for the model repository as it would a file change. The new version can then be staged and committed. The workflow may look something like this from the terminal:
+
+```sh
+$ cd ~/connector-codegen/
+$ git checkout -b feature/update-model-version
+Switched to a new branch 'feature/update-model-version'
+$ git fetch -v
+POST git-upload-pack (155 bytes)
+From https://github.com/datafoodconsortium/connector-codegen
+ = [up to date] dev -> origin/dev
+ = [up to date] main -> origin/main
+$ cd data-model-uml/
+$ git fetch -v
+From github.com:datafoodconsortium/data-model-uml
+ = [up to date] next -> origin/next
+ = [up to date] main -> origin/main
+$ git checkout next
+Switched to branch 'next'
+Your branch is behind 'origin/next' by 3 commits, and can be fast-forwarded.
+ (use "git pull" to update your local branch)
+$ git pull
+Updating 732bc8e..846b850
+Fast-forward
+ CHANGELOG.md | 4 ++
+ common.uml | 64 ++++++++++++++++++++++
+ product.uml | 410 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ sale.uml | 498 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ 4 files changed, 976 insertions(+)
+$ git status
+On branch next
+Your branch is up to date with 'origin/next'.
+
+nothing to commit, working tree clean
+$ cd ..
+$ git status
+On branch feature/update-model-version
+Changes not staged for commit:
+ (use "git add ..." to update what will be committed)
+ (use "git restore ..." to discard changes in working directory)
+ modified: data-model-uml (new commits)
+$ git diff main data-model-uml/
+diff --git a/data-model-uml b/data-model-uml
+new file mode 160000
+index 0000000..846b850
+--- /dev/null
++++ b/data-model-uml
+@@ -0,0 +1 @@
++Subproject commit 846b85073ad63e12f073f27f6cac13dfe19850b7
+$ git add data-model-uml/
+$ git commit -m "Update to next version of data model UML"
+```
diff --git a/data-model-uml b/data-model-uml
new file mode 160000
index 0000000..732bc8e
--- /dev/null
+++ b/data-model-uml
@@ -0,0 +1 @@
+Subproject commit 732bc8e5cbbf55818ce36330a6c58031d740fefa
diff --git a/img/config.jpg b/img/config.jpg
deleted file mode 100644
index 6b0a194..0000000
Binary files a/img/config.jpg and /dev/null differ
diff --git a/img/config.png b/img/config.png
new file mode 100644
index 0000000..89304a6
Binary files /dev/null and b/img/config.png differ
diff --git a/img/properties.jpg b/img/properties.jpg
deleted file mode 100644
index 5d77a0c..0000000
Binary files a/img/properties.jpg and /dev/null differ
diff --git a/img/properties.png b/img/properties.png
new file mode 100644
index 0000000..5375750
Binary files /dev/null and b/img/properties.png differ