Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(model): Add input/output_exchanges to fa.Function #322

Closed
wants to merge 1 commit into from

Conversation

ewuerger
Copy link
Member

To be on par with inputs/outputs on oa.OperationalActivitys these
two properties were added.

To be on par with `inputs/outputs` on `oa.OperationalActivity`s these
two properties were added.
@ewuerger ewuerger self-assigned this Aug 11, 2023
@ewuerger ewuerger added the enhancement New feature or request label Aug 11, 2023
@Wuestengecko
Copy link
Member

We keep adding more and more special cases like this. I think we should rather look at how we could take a more generalized approach, to make it easy for users to express the exact relationships they're interested in.

I see a case to make some generalized filtering and mapping methods on ElementList, which would transform the list by accessing the given attribute on each item. This example could then be written similar to:

my_func = model.search("LogicalFunction")[0]
exc = my_func.inputs._the_mapper_function_("exchanges")
# exc now contains the same as this PR's `my_func.input_exchanges`

Of course the downside is that this cannot be statically type annotated (to the best of my knowledge), so the static type of exc would simply be ElementList[Any].

This is just a rough idea of course, but what do you think? Does it make sense to explore this idea further?

@Wuestengecko
Copy link
Member

Obsolete. capella2polarion has since added support for dotted notation of Capella attributes, which is a more generalized approach than adding the needed attributes to the metamodel.

@Wuestengecko Wuestengecko deleted the add-directional-exchanges branch September 23, 2024 14:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants