Skip to content

Discarding elements in TWC project does not update VIATRA #54

@TheKorpos

Description

@TheKorpos

'Discard Changes' and Discard 'Changed Recursively' can lead to query results sets with elements that got removed in the discard process.

Environment

MD 19.0 but this seems to be the case in CSM 19sp2 as well
V4MD 2.3.0

My testing covered edges (abstraction, dependency, etc..) but it may be the case with other elements as well.

To reproduce this:

  • pick an edge type element like an abstraction that is returned by a query
  • delete the element
  • create another element in its place (meaning that the supplier and the client are the same and it is in the same package, name does not matter)
  • discard the new element (this brings back the old)

The query will return the new element that just got removed.

Minimal working example

I set up an example to test this on TWC (internal)
V4MD-test > v4md-debug
And made a test plugin of the MD Plugin Skeleton
https://github.com/IncQueryLabs/MD_plugin_skeleton/commits/v4md-debug

Usage

The model structure is the following:

image

The Query I use:

pattern edgeTest(edge: Abstraction){
	Abstraction.client.name(edge, "UniqueAbstractionClient");
	Abstraction.supplier.name(edge, "UniqueAbstractionSupplier");
}

To run the query and display name and ids

image

The output of the first run:

[2020.06.02::17:09:33] | -------------------------------------
[2020.06.02::17:09:34] | +++
[2020.06.02::17:09:34] | Name: Edge Under Test
[2020.06.02::17:09:34] | getLocalID: _19_0_175c043b_1591107324833_950275_6
[2020.06.02::17:09:34] | getID: 32e9bd76-e888-4826-9092-3a1e6e44fece
[2020.06.02::17:09:34] | sGetID: 32e9bd76-e888-4826-9092-3a1e6e44fece
[2020.06.02::17:09:34] | +++
[2020.06.02::17:09:34] | -------------------------------------

I delete this abstraction and create a new one with the same endpoints and call it New Abstraction

image

Re-run the action:


[2020.06.02::17:12:19] | -------------------------------------
[2020.06.02::17:12:19] | +++
[2020.06.02::17:12:19] | Name: New Abstraction
[2020.06.02::17:12:19] | getLocalID: _19_0_175c043b_1591110668849_450906_2
[2020.06.02::17:12:19] | getID: b44d438c-9e58-4b38-850d-bec1451ae3e6
[2020.06.02::17:12:19] | sGetID: b44d438c-9e58-4b38-850d-bec1451ae3e6
[2020.06.02::17:12:19] | +++
[2020.06.02::17:12:19] | -------------------------------------

Now I discard changes

image

And run the action again:

[2020.06.02::17:13:46] | -------------------------------------
[2020.06.02::17:13:46] | +++
[2020.06.02::17:13:46] | Name: New Abstraction
[2020.06.02::17:13:46] | getLocalID: _19_0_175c043b_1591110668849_450906_2
[2020.06.02::17:13:46] | getID: b44d438c-9e58-4b38-850d-bec1451ae3e6
[2020.06.02::17:13:46] | sGetID: b44d438c-9e58-4b38-850d-bec1451ae3e6
[2020.06.02::17:13:46] | +++
[2020.06.02::17:13:46] | -------------------------------------

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions