Sparx Systems Forum

Enterprise Architect => General Board => Topic started by: Modesto Vega on July 17, 2025, 01:41:49 am

Title: What does the Package_ID in t_object represent?
Post by: Modesto Vega on July 17, 2025, 01:41:49 am
I am not sure if this is dumb question, but let's assume I have the following package structure:

A [Package]
-->A100 [Package]
---->A120 [Object]
B [Package]
-->B100 [Package]
---->B110 [Object]

Sparx EA stores the data for the above structure twice on in t_object and again in t_package; nothing new here.

I am interested in 2 columns from t_object, object_id and package_id, and one from t_package, package_id, and their relationships.

Looking, at the results from various queries
> If the object is a package, t_object.package_id is the identifier of the parent package - e.g. for A100 it is the package identifier of package A, but
> If the object is not a package, it is the identifier of the package where the object is located - e.g., for B110 it is identifier of package B100.

Have I misunderstood something? I guess in both cases it is the identifier of the container package.

The reason for the question is that I am trying to understand what the #Package# and #Branch# macros pass as their parameters. The package_id from t_package, the object_id from t_object, or the package_id from t_object.


Title: Re: What does the Package_ID in t_object represent?
Post by: Eve on July 17, 2025, 11:42:12 am
I guess in both cases it is the identifier of the container package.
Yes.

The reason for the question is that I am trying to understand what the #Package# and #Branch# macros pass as their parameters. The package_id from t_package, the object_id from t_object, or the package_id from t_object.
Package_ID = #Package# or Package_ID in (#Branch#)

Only #Branch# has any kind of parameter and it takes the id or guid of the root package when you want that explicitly specified instead of using the currently selected package.

Quote
There are three permutations of this macro:
    in #Branch# - gets the ID of each child Package of the parent Package selected by the user
    in #Branch=<GUID># or #Branch=<ID># - gets the ID of each child Package of the parent Package specified by the GUID or ID
    in #Branch=<ID>,<ID>,<ID># - gets the ID of each child Package under each parent Package specified by its ID
Title: Re: What does the Package_ID in t_object represent?
Post by: Modesto Vega on July 17, 2025, 06:37:45 pm
Thank you Eve, did I understand this correctly?

Package_ID = #Package#

Uses the ID of the current package.

Quote
There are three permutations of this macro:
    in #Branch# - gets the ID of each child Package of the parent Package selected by the user
    in #Branch=<GUID># or #Branch=<ID># - gets the ID of each child Package of the parent Package specified by the GUID or ID
    in #Branch=<ID>,<ID>,<ID># - gets the ID of each child Package under each parent Package specified by its ID
Using the example in the previous post, I would greatly appreciate if could you please define "child Package of the parent Package"?
Title: Re: What does the Package_ID in t_object represent?
Post by: Eve on July 21, 2025, 09:14:09 am
If you have A selected (or specify its id/guid):

Look at any package in your browser:
Title: Re: What does the Package_ID in t_object represent?
Post by: Modesto Vega on July 28, 2025, 10:53:37 pm
Thank you Eve. Just one quick clarification regarding
If you have A selected (or specify its id/guid):
  • t_object.Package_ID = #Package# will give you A100 only
  • t_object.Package_ID in (#Branch#) will give you A100 and A120
Does that behaviour apply irrespective of the object type? Does the same behaviour apply to a child object of a type package or a type class - i.e., does the same behaviour apply irrespective of whether A120 is a package or a class?