Book a Demo

Author Topic: Get Latest vs LoadControlledPackage?  (Read 4337 times)

ChrisM

  • EA Novice
  • *
  • Posts: 16
  • Karma: +0/-0
    • View Profile
Get Latest vs LoadControlledPackage?
« on: July 08, 2009, 09:11:41 pm »
Is there something extra that the GUI Get Latest command does that LoadControlledPackage doesn't?
I have a project containing two version controlled models. The models each have diagrams containing elements that are located in the other model.
I have a plugin that calls LoadControlledPackage to update each of the models in turn so they load the latest packages from the version controlled files. When I do this, some of the diagram objects and links are lost in the first model to be updated.
If I use Get Latest on the packages of the model with the lost items, the diagram objects and links reappear.
Is there anyway to fully simulate a Get Latest command in the automation interface?
I was told the Get Latest command is being included as a feature of the automation interface in the future but no date was given .

DanG83616

  • EA User
  • **
  • Posts: 180
  • Karma: +0/-0
    • View Profile
Re: Get Latest vs LoadControlledPackage?
« Reply #1 on: July 14, 2009, 07:05:53 am »
Did you try reloading the first package a second time from your add-in? That might have the same effect of running the add-in as-is and then using the GUI.

I recall some threads discussing difficulties when packages refer to each other. The gist of those threads was to avoid that in the first place.

For the wrong reasons, it enforces the "avoid circular references" design principle. If components reference each other then consider making a third component that is the composition of the two and show the interactions in that scope.

Please let us know if LoadControlledPackage on the first package a second time resolves things correctly.

ChrisM

  • EA Novice
  • *
  • Posts: 16
  • Karma: +0/-0
    • View Profile
Re: Get Latest vs LoadControlledPackage?
« Reply #2 on: July 14, 2009, 07:43:45 pm »
Thanks for the response. I am testing running multiple models in a single project and yes, we will not have avoid circular references in the real project.
Loading the first model a second time simply makes things disappear from second model!

But even in a situation where the referencing is one way, I would have to know which model to perform the load controlled package on first.
I wanted the plugin to iterate through the whole project without having to set a specific order. I know the Get Latest command works regardless of the order I choose, so it must be doing something different. I just don't know what. I can but hope a new version is released soon with support for Get Latest in the Automation interface.

DanG83616

  • EA User
  • **
  • Posts: 180
  • Karma: +0/-0
    • View Profile
Re: Get Latest vs LoadControlledPackage?
« Reply #3 on: July 15, 2009, 03:43:23 am »
What follows is just some more thinking about the consequences of relationships and multiple models. Just sharing thoughts...

What about the SysML Containment relationship? The containment relationship is maintained in the contained element and references the container. I'm bugged that a resused element will have more than one Containment relationship if it is used in more than one configuration. If I load a reused package, containing packages in other models will be stubbed. If I mod the package and check it back in, will the unresolved containment links be lost?

I guess Containment should be constrained to allow only one element on the "contains" end. Elements would refer to their parent package only. That package can then be Imported to more than one package for reuse.

Dan

lubos

  • EA User
  • **
  • Posts: 101
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Re: Get Latest vs LoadControlledPackage?
« Reply #4 on: August 06, 2009, 07:51:07 pm »
>I guess Containment should be constrained to allow only one element on the "contains" end. Elements would refer to their parent package only. >That package can then be Imported to more than one package for reuse

I agree,
but I can't fit an aggregation (composite) asociation to this methodology principle. How to use this relation between packages where one depends on another?
I have solved it by forbiding using this relation in these situations.