Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Discarding elements in TWC project does not update VIATRA #54

Open
TheKorpos opened this issue Jun 2, 2020 · 1 comment
Open

Discarding elements in TWC project does not update VIATRA #54

TheKorpos opened this issue Jun 2, 2020 · 1 comment

Comments

@TheKorpos
Copy link
Collaborator

TheKorpos commented Jun 2, 2020

'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] | -------------------------------------
@ujhelyiz
Copy link
Member

ujhelyiz commented Jun 4, 2020

I am afraid this is a case where some notifications are not sent during discarding the changes. To make sure whether this is the case we have to check the notifications being sent during the discarding. For this, we should reuse the test case from a0fa9cf (created for issue #26) and list all events.

If something is missing, then we should try to figure out why it was not sent by Magicdraw; if everything is sent correctly, then we could try to figure out what VIATRA needs to do differently.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants