Skip to content

Commit 61ebd1d

Browse files
committed
refactor(model-api)!: rename node id property key to #originalRef#
BREAKING CHANGE: The id property has been renamed from #mpsNodeId# to #originalRef# to better describe the contained value. Users should not use this value directly but instead use INode::getOriginalReference().
1 parent 808aff3 commit 61ebd1d

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

model-api/src/commonMain/kotlin/org/modelix/model/api/INode.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,7 @@ interface INode {
211211
* @return the original reference of this node
212212
*/
213213
fun getOriginalReference(): String? = getPropertyValue(IProperty.fromName(NodeData.ID_PROPERTY_KEY))
214+
?: getPropertyValue(IProperty.fromName("#mpsNodeID#")) // for backwards compatibility
214215

215216
// <editor-fold desc="non-string based API">
216217
fun usesRoleIds(): Boolean = false

model-api/src/commonMain/kotlin/org/modelix/model/data/ModelData.kt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,11 @@ data class NodeData(
8686
val references: Map<String, String> = emptyMap(),
8787
) {
8888
companion object {
89-
const val ID_PROPERTY_KEY = "#mpsNodeId#"
89+
90+
/**
91+
* Users should not use this directly. Use [INode.getOriginalReference].
92+
*/
93+
const val ID_PROPERTY_KEY = "#originalRef#"
9094

9195
@Deprecated("Use ID_PROPERTY_KEY", replaceWith = ReplaceWith("ID_PROPERTY_KEY"))
9296
const val idPropertyKey = ID_PROPERTY_KEY

0 commit comments

Comments
 (0)