fix: allow Aggregation/Composition from Grouping/Location to Junction#1249
fix: allow Aggregation/Composition from Grouping/Location to Junction#1249mvanhorn wants to merge 1 commit into
Conversation
|
Thanks for this PR. Just so I know when I review it, I have to ask if any of the code submitted is AI generated and have you manually tested the changes in Archi? |
|
Hi @Phillipus, thanks for taking a look, and a fair question to ask. Yes, this was written with AI assistance. I reviewed it and understand the change: it targets the Junction homogeneity check in On testing: I added four unit tests to |
|
@mvanhorn Thanks for the clarification. I ask because, ultimately, it's me that has to handle things if a regression or bug arises further down the line (unless the PR provider is prepared to fix it) and I need to understand the code in the PR. One thing I found:
The above works as expected. Now do it this way:
Is that expected behaviour? |
|
Good catch, and no - that's not expected behaviour, it was a bug in this PR. The Grouping composition bypassed the homogeneity check on the way in but still counted toward the Junction's relationship set, so creating it first blocked the ordinary Assignment. Fixed in 6de55f1: the homogeneity check now excludes bypassed Grouping/Location Aggregation/Composition relationships in both directions (shared predicate for both call sites), so your two orderings behave identically. I added a regression test for your exact scenario (Composition first, then Assignment). And to your broader point - yes, I'm prepared to fix issues that arise from this change down the line. |
|
Hi, thanks for the changes. Could you please squash the two commits into one commit and rebase onto the latest |
6de55f1 to
a485ea3
Compare
|
Done - squashed to a single commit (a485ea3) and rebased onto latest master. The rebase was clean and the diff is unchanged from what you reviewed (verified with git patch-id). |
|
Thanks, I'll take a look at it soon... |
Excludes bypassed relationships from the Junction homogeneity check so Aggregation and Composition from Grouping/Location elements are allowed to connect to Junctions. Fixes archimatetool#1229
a485ea3 to
6348fef
Compare

Summary
ArchiMate 3 Appendix B specifies that Grouping and Location may have Aggregation or Composition relationships to any concept, including Junctions. Archi blocked these when the target Junction already participated in other relationship types (e.g., Triggering), due to the Junction homogeneity constraint in
ArchimateModelUtils.isValidRelationship.Why this matters
Users modeling ArchiMate diagrams that include Grouping or Location elements structurally containing a Junction (e.g., grouping a flow pattern) received an incorrect "invalid relationship" error. The tool was non-compliant with the spec for this combination. Reported in #1229.
Changes
ArchimateModelUtils.java: Add a bypass in the target-Junction homogeneity block (lines 94-107). When the source concept isIGroupingorILocationand the relationship type isAggregationRelationshiporCompositionRelationship, skip the Junction type-homogeneity loops and fall through to theRelationshipsMatrixcheck, which already permits these combinations per the ArchiMate 3 matrix.ArchimateModelUtilsTests.java: Add five JUnit tests covering Grouping/Location + Aggregation/Composition to a Junction with existing Triggering relationships (now valid), plus regression cases confirming Junction homogeneity is still enforced for regular elements and Junction-to-Junction relationships.Fixes #1229