How to instantiate class/exchange item

Hello.
I have created several functional exchanges between functions in my system, and have attributed exchange items to them, to specify what actually flows in those functional exchanges. To do so, I have created classes and then associated the classes with exchange items with the “Exchange Item Element” relation. For example lets say I created a class “Report” which has a property “Status”, which is a uint8, and it flows in Functional Exchange “System Reports”.
This works very well for a generic case since it illustrates how functions exchange reports but now I am creating an Exchange Scenario and I want to model a case in which something fails, and thus the status should take a specific value like Status = ERROR_1. How can I express that in this scenario the status field will be ERROR_1? The only way I’ve been able to do this is with notes, but I think this method is not very easy to maintain in the long run, so I want to be able to do this more smartly.

Thank you in advance!

In an exchange scenario, select an exchange, in the properties view, you have an “Exchange Context” box. Here you can enter the values. Ctrl+Space will give you completion.
Stephane

1 Like

Hello @StephaneLacrampe thank you for your reply but sadly I’m not sure I understand!

While I understood the steps I need to take to add an exchange context, I don’t understand how to correctly used it to specify the value of status.
Using ctrl+space gives me a list of elements, including the “status” field I mentioned, but how am I supposed to give it a value? Should I just write Status = ERROR_1? (By the way, I have defined ERROR_1 as part of an enum and it doesnt show in content assist)

I created a small example model at the SA level. Here is the CDB:


And here is the corresponding expression in the ES:

If you click on each blue part of the text, you will see that it points to the right model element in the project explorer. Attached the example model.
Test.zip (14.3 KB)

Please note that in Capella, these expressions are not formal, but they allow a certain level of consistence.
More on these expressions in the documentation, especially in “Capella Guide->Thematic Highlights-> Focus on constraints and opaque expressions”.

Stephane

1 Like

Thank you for the detailed explanation! That clears it up, I wasn’t sure how to express the contents of the report more formally, but if as you say it isn’t formal then I’ll do it this way. It is for sure better for coherence and maintainability than the notes I was adding! Also now I can see the enum values…don’t know what was wrong earlier, maybe just me :).
Thank you again so much for the time you took to help me and even making a small example project. Have a nice weekend!

1 Like