<commit_before>---

Copyright 2014 Mentor Graphics Corp.  All Rights Reserved.

---

# Port BridgePoint source models to Generic packages
### xtUML Project Design Note

1. Abstract
-----------
We need to migrate the BridgePoint metamodel to generic packages. This note tracks the required work.

2. Document References
----------------------
[1] Clearquest issue dts0101077921 - Port BridgePoint source models to Generic packages

[2] Issues 2, https://github.com/xtuml/internal/issues/263  

3. Background
-------------
We are migrating BridgePoint to an open source environment. The open source editor is restricted in what it can do with Specific Package models, so we need to port the BridgePoint source models to Generic Package s so that the wider community can edit them.

4. Requirements
---------------
1. MC-Java needs to be changed to work with Generic Package models.
2. The BridgePoint build infrastructure must be changed to work with Generic Package models.

5. Analysis
-----------

5.1 Scope

This work makes the build environment produce a good working copy of BridgePoint from models converted to Generic Packages. If possible, no other changes will be made to the BridgePoint meta-model by this work. It follows from this statement of scope that this work does not remove Specific package support from BridgePoint. All it does is to move the BridgePoint source and build infrastructure to Generic Packages. After this work is complete, the BridgePoint developers are no longer dependent on Specific Package functionality, so Specific Package support can be scheduled for removal.

5.2 Work required

A key meta-model element associated with specific packages is Domain (S_DOM). There are 79 references to it in workspace RSL files (i.e. files with arc and inc extensions). Another key meta-model element is Subsystem (S_SS). There are 50 references to this element in workspace RSL files. Many of these references will require no action because they (for example) hook up context menu entries with the Domain or Subsystem. However every one of the references needs to be assessed to see if it needs to change.


6. Design
---------
6.1 Convert all source models to generic packages
This change is responsible for the bulk of the delta for this job. As was hoped, no other changes other than the package style are required to any of the source models. Test models in specific packages remain as specific packages. Since these models are designed to test specific package behavior, these need to stay in place until support for specific packages is removed. The converted models are:

- bp.als/grammar
- bp.core/context_menu
- bp.core/ooaofooa
- bp.core/ooaofooa_hierarchy
- bp.core.test/consistencyTest
- bp.core.test/DeleteTestModel
- bp.core.test/FormalizeUnformalizeTests
- bp.core.test/FormalizeUnformalizeTestsWithPrefix (? already upgraded ?)
- 

7. Design Comments
------------------

8. Unit Test
------------
All JUnit tests must pass.

End
---

<commit_msg>#263 Check in WIP<commit_after>---

Copyright 2014 Mentor Graphics Corp.  All Rights Reserved.

---

# Port BridgePoint source models to Generic packages
### xtUML Project Design Note

1. Abstract
-----------
We need to migrate the BridgePoint metamodel to generic packages. This note tracks the required work.

2. Document References
----------------------
[1] Clearquest issue dts0101077921 - Port BridgePoint source models to Generic packages

[2] Issues 2, https://github.com/xtuml/internal/issues/263  

3. Background
-------------
We are migrating BridgePoint to an open source environment. The open source editor is restricted in what it can do with Specific Package models, so we need to port the BridgePoint source models to Generic Package s so that the wider community can edit them.

4. Requirements
---------------
1. MC-Java needs to be changed to work with Generic Package models.
2. The BridgePoint build infrastructure must be changed to work with Generic Package models.

5. Analysis
-----------

5.1 Scope

This work makes the build environment produce a good working copy of BridgePoint from models converted to Generic Packages. If possible, no other changes will be made to the BridgePoint meta-model by this work. It follows from this statement of scope that this work does not remove Specific package support from BridgePoint. All it does is to move the BridgePoint source and build infrastructure to Generic Packages. After this work is complete, the BridgePoint developers are no longer dependent on Specific Package functionality, so Specific Package support can be scheduled for removal.

5.2 Work required

A key meta-model element associated with specific packages is Domain (S_DOM). There are 79 references to it in workspace RSL files (i.e. files with arc and inc extensions). Another key meta-model element is Subsystem (S_SS). There are 50 references to this element in workspace RSL files. Many of these references will require no action because they (for example) hook up context menu entries with the Domain or Subsystem. However every one of the references needs to be assessed to see if it needs to change.


6. Design
---------
6.1 Convert all source models to generic packages
This change is responsible for the bulk of the delta for this job. As was hoped, no other changes other than the package style are required to any of the source models. Test models in specific packages remain as specific packages. Since these models are designed to test specific package behavior, these need to stay in place until support for specific packages is removed. The converted models are:

- bp.als/grammar
- bp.core/context_menu
- bp.core/ooaofooa
- bp.core/ooaofooa_hierarchy
- bp.core.test/consistencyTest
- bp.core.test/DeleteTestModel
- bp.core.test/FormalizeUnformalizeTests
- bp.core.test/FormalizeUnformalizeTestsWithPrefix (? already upgraded ?)
- bp.io.core/file_io
- bp.ui.canvas/ooaofgraphics
- bp.ui.tree/UITree

The method used to upgrade was to use a text editor to modify the root model package xtuml file of each project and change the persistence version in the first line of the file from 7.1.6 to 7.1.5. This triggers the automated file upgrade process which then shows a dialog showing the relevant models which require upgrading. Conversion to generic package format is subsequently automatic.

6.2 MC-Java changes
Outside of model data upgrade, the largest set of changes are to the MC-Java BridgePoint production model compiler. Almost all changes are switching from selecting an S_DOM instance to finding the root generic package which replaces it in the upgraded model data. The changes are shown in the order found by the branch compare utility for ease of reference with this document.

6.2.1 arch_utils
- get_domain_name is obsolete and is replaced with get_root_pkg_name.
- notifies_changes is modified to work with packages and packageable elements instead of domains and subsystems.
- check_subsystem_for_notifies_changes has its name changed to check_pkg_for_notifies_changes. Functionality is changed to reflect this.
- get_context_for_statement is changed to work with packages and packageable elements instead of domains and subsystems.
- gen_parameter_list is modified to take a root_pkg_name argument and to recursively pass this to gen_value (see [6.2.2] for why this is needed).
- is_persistent is modified to work with packages and packageable elements instead of subsystems.

6.2.2 java.arc
This is changed to work with  packages and packageable elements instead of domains and subsystems. Calls to translate_all_oal are changed to take the name of the root package being built as a string argument. This value is passed recursively down all oal translation call trees as required. This was done because the alternative would have been to compute the value where it was needed. This is done in so many places that it was felt that computing it would adversely affect build times.

6.2.X build.xml
This is modified to add a dependency on file_io.schema to the generate-with-file_io.java. This dependency is moved from core and simplifies the build process. At the same time, the parameters passed to generate-with-file_io.java are simplified by removing redundant arguments.

6.3 RSL file fallout
As anticipated in the Analysis section. the bulk of the RSL changes are to move frome searching for S_DOM instances to finding the root package of each model.

7. Design Comments
------------------
7.1 Converting source models to generic packages
It was noted that the upgrade process left specialized Datatype packages in the roots of many projects. Since this may well be an artifact of the manual change to the file persistence version, and specialized packages are no longer user visible and will soon be removed entirely, it is suggested that no further action is needed beyond manually deleting the surplus packages.

8. Unit Test
------------
All JUnit tests must pass.

End
---


{'fraction_non_alphanumeric': 0.06051454138702461, 'fraction_numerical': 0.01185682326621924, 'mean_word_length': 3.809575040344271, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 1}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2368115', 'n_tokens_mistral': 2211, 'n_tokens_neox': 2097, 'n_words': 1280}