Conversation
rule-trf-prop-flatten-types does not flatten a union whose name matches flattenUnionTypesExcludeRegex (ShapeChange#724), so the properties that have it as value type keep that type. At the end of the rule, however, every class of category union was removed from the model, excluded or not. Removing the class also removes the properties typed by it (GenericModel.remove), without an error or a warning, so an excluded union and every property that referenced it disappeared from the output. The final removal now skips a union that matches the parameter, as it already skips a union that represents a feature type set when rule-trf-prop-flatten-types-ignoreUnionsRepresentingFeatureTypeSets is in effect. Both places decide exclusion with the same method, isExcludedUnionType(ClassInfo). A union that is not excluded is still removed, whether or not a property used it. The parameter documentation in Flattener.adoc now says that excluded unions are also not removed. The new test test_flattenTypes_excludeUnionTypes runs rule-trf-prop-flatten-types on the model of the 'basic' flattener test with IntegerReason excluded, and with CI_CitationReason mapped to CharacterString so that no property uses it. The reference keeps IntegerReason and the two properties typed by it, SourceInfo.prop9 and IntegerMeta.valueOrReason (flattened to prop11.valueOrReason), and does not contain CI_CitationReason. The test fails without this change, and also when every union is kept once the parameter is set. The SCXML-based configuration was created with SCXMLTestResourceConverter from the EA configuration and reads the existing testFlattening.zip, the SCXML already derived from testFlattening.qea. Signed-off-by: jdsika <carlo.van-driesten@vdl.digital>
jdsika
force-pushed
the
fix/flattener-keep-excluded-unions
branch
from
September 26, 2026 11:26
6c191b8 to
de29b1f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Mirror of upstream ShapeChange#798, for use on
feature/asam-pipelineuntil it is merged upstream.