Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Papyrus » How to remove an imported package?
How to remove an imported package? [message #1692231] Tue, 14 April 2015 12:32 Go to next message
Tomas Sandkvist is currently offline Tomas SandkvistFriend
Messages: 149
Registered: October 2013
Senior Member
As the heading tells, if I import a package from a user model, how do I remove it from the model in which it is imported?

Perhaps easier than I think, but can't for my life see how to...

Regards,
Tomas Sandkvist
Re: How to remove an imported package? [message #1692253 is a reply to message #1692231] Tue, 14 April 2015 14:21 Go to previous messageGo to next message
Christian Damus is currently offline Christian DamusFriend
Messages: 1270
Registered: July 2009
Location: Canada
Senior Member

Hi, Tomas,

Select the package import in the Model Explorer and delete it.

Of course, it's not so easy to remove all references to elements in the
model that was imported, if that's what you need. Those can be
scattered all over the place ...

HTH,

Christian


On 2015-04-14 12:32:29 +0000, Tomas Sandkvist said:

> As the heading tells, if I import a package from a user model, how do I
> remove it from the model in which it is imported?
> Perhaps easier than I think, but can't for my life see how to...
>
> Regards,
> Tomas Sandkvist
Re: How to remove an imported package? [message #1692308 is a reply to message #1692253] Wed, 15 April 2015 04:19 Go to previous messageGo to next message
Tomas Sandkvist is currently offline Tomas SandkvistFriend
Messages: 149
Registered: October 2013
Senior Member
Hi Christian!

But, the Delete menu item is disabled? And Delete from keyboard doesn't work either?

index.php/fa/21545/0/

Eclipse SR1a and SR2.

Regards,
Tomas
Re: How to remove an imported package? [message #1692388 is a reply to message #1692308] Wed, 15 April 2015 12:35 Go to previous messageGo to next message
Christian Damus is currently offline Christian DamusFriend
Messages: 1270
Registered: July 2009
Location: Canada
Senior Member

Hi, Tomas,

Ah, I see. It looks like the 'Enable Write' action is available, which
suggests that Papyrus thinks the model containing this import is
read-only.

Does the Model Explorer show the element you're trying to delete with a
label having grey italic text? If so, that's a read-only model, which
usually means either that it is a model that is itself imported by
another: Papyrus discourages the editing of imported library models in
the context of the model that imports them, because it's confusing if
the same library model is also accessible by one or more other editors.

HTH,

Christian


On 2015-04-15 04:19:21 +0000, Tomas Sandkvist said:

> Hi Christian!
>
> But, the Delete menu item is disabled? And Delete from keyboard doesn't
> work either?
>
>
>
> Eclipse SR1a and SR2.
>
> Regards,
> Tomas
> <image>
Re: How to remove an imported package? [message #1692396 is a reply to message #1692388] Wed, 15 April 2015 13:10 Go to previous messageGo to next message
Tomas Sandkvist is currently offline Tomas SandkvistFriend
Messages: 149
Registered: October 2013
Senior Member
Hi Christian!

Hmm, perhaps something is wrong with my imports?

This is my principle setup:

I have a base model (BaseCS) that contains the skeleton parts of a crane related control system.

When a customer orders a crane, he might also want some project specific functions. So, I specialize a CustomerCS from BaseCS, at which point a import the BaseCS model into the customer project model, in order to have access to all the elements that I might need to specialize or reconfigure.

There will be multiple customer projects based on the same BaseCS, thus having the BaseCS model imported and specialized.

Now, in the BaseCS model, I get the following list of... what? Projects that references BaseCS? And some applied profiles also (but I don't get where RobotML comes from, haven't applied that by choice)

index.php/fa/21552/0/

None of these can be deleted though. Now. the following is the contents of my CustomerCS project:

index.php/fa/21553/0/

Is this what is to expect?

But in either case can I remove the imported model, so have I misused this function or what has happened? If so, what is the correct way of doing what I want, because I guess it should be allowed to do this kind of "specialization"?

I also tried with a completely empty, fresh project. Delete is disabled, but Unload seems to work.

However, if I import BaseCS I also get a CustomerCS reference as well:

index.php/fa/21554/0/

And, if I try to unload BaseCS, it returns after some 5 seconds. No elements in this model is used is the fresh, clean, empty model.


So, this is weird....?

Best regards,
Tomas

[Updated on: Wed, 15 April 2015 13:21]

Report message to a moderator

Re: How to remove an imported package? [message #1692459 is a reply to message #1692396] Wed, 15 April 2015 23:56 Go to previous messageGo to next message
Christian Damus is currently offline Christian DamusFriend
Messages: 1270
Registered: July 2009
Location: Canada
Senior Member

Hi, Tomas,

From what I can see of your screenshots, there's nothing wrong.

Any model that is not the "main" model that is opened in the editor
(the one that you double-clicked in the Project Explorer to open) is
treated as read-only in the context of that editor. This is because
they are potentially shared with any number of other open editors that
may also have those referenced models loaded. This includes library
models, profiles, other models in the workspace, anything.

When you import BaseCS into CustomerCS, you probably don't really want
to edit BaseCS in that context because what you're editing is
CustomerCS (and any number of other customer models also use BaseCS).
If you need to edit BaseCS, that is best done in an editor explicitly
opened on BaseCS.

But, if you really want to and are comfortable with the potential
consequences, you can right-click on BaseCS in the Model Explorer and
make it writable. Then you can edit it freely in the CustomerCS editor.

I don't know which of the screenshots is the CustomerCS editor and
which is the BaseCS.

However, it does appear that you may have extraneous cross-references
between resources. CustomerCS even appears twice in one of these. And
I don't know why anything from RobotML would appear. The only reason
why models should appear in the explorer is because they were loaded by
proxy resolution, implying that some model in the interconnected graph
of models has a reference to it, traceable all the way back to the
model that you opened originally in the editor. If you need to seek
and destroy those references, the "Make Writable" context-menu action
should help.

HTH,

Christian


On 2015-04-15 13:10:42 +0000, Tomas Sandkvist said:

> Hi Christian!
>
> Hmm, perhaps something is wrong with my imports?
>
> This is my principle setup:
>
> I have a base model (BaseCS) that contains the skeleton parts of a
> crane related control system.
>
> When a customer orders a crane, he might also want some project
> specific functions. So, I specialize a CustomerCS from BaseCS, at which
> point a import the BaseCS model into the customer project model, in
> order to have access to all the elements that I might need to
> specialize or reconfigure.
>
> There will be multiple customer projects based on the same BaseCS, thus
> having the BaseCS model imported and specialized.
>
> Now, in the BaseCS model, I get the following list of... what? Projects
> that references BaseCS? And some applied profiles also (but I don't get
> where RobotML comes from, haven't applied that by choice)
>
>
>
> None of these can be deleted though. Now. the following is the contents
> of my CustomerCS project:
>
>
>
> Is this what is to expect?
>
> But in either case can I remove the imported model, so have I misused
> this function or what has happened? If so, what is the correct way of
> doing what I want, because I guess it should be allowed to do this kind
> of "specialization"?
>
> Best regards,
> Tomas
> <image>
> <image>
Re: How to remove an imported package? [message #1692548 is a reply to message #1692459] Thu, 16 April 2015 12:33 Go to previous messageGo to next message
Charles Rivet is currently offline Charles RivetFriend
Messages: 219
Registered: May 2014
Location: Canada
Senior Member

I'll confirm Christan's analysis in the previous answer.

I had the same problem with an import that would keep coming back after an unload and I managed to track it down to a type defined in the imported model that was used to define an attribute in the importing model. After changing this, I managed to unload the imported package permanently.

Now, it would be nice if there was a report that could be run to find references external to the model where they are made (is there?).


/Charles Rivet

[Updated on: Thu, 16 April 2015 12:35]

Report message to a moderator

Re: How to remove an imported package? [message #1692641 is a reply to message #1692548] Fri, 17 April 2015 07:38 Go to previous messageGo to next message
Tomas Sandkvist is currently offline Tomas SandkvistFriend
Messages: 149
Registered: October 2013
Senior Member
@Charles:

Yes, but that does not say why I can't unload an imported model where no part of it is referenced, it is only imported, nothing more. So, there must be something else/more wrong with my models.

Regards,
Tomas
Re: How to remove an imported package? [message #1692901 is a reply to message #1692641] Mon, 20 April 2015 13:44 Go to previous message
Charles Rivet is currently offline Charles RivetFriend
Messages: 219
Registered: May 2014
Location: Canada
Senior Member

Hi Thomas,

Note that I suspect, although I have not tried it, that this could also happen transitively, e.g., your model imports a model that requires the model you are trying to unload.

If you are certain there are no references in the importing model to an element in the imported model, I would suggest you create a bug to address this. In mind mind, this would be unexpected behaviour.




/Charles Rivet
Previous Topic:Activity Diagram Icon with Plus Sign
Next Topic:Sequence Diagram: syncCall missing from diagrams on image export
Goto Forum:
  


Current Time: Fri Apr 19 07:33:28 GMT 2024

Powered by FUDForum. Page generated in 0.02312 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top