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

Hey everyone, is this still the only method for instantiating classes/exchange items?

I have a case where I want to show that many configurations of a certain type of tool can be exchanged with my system, and I want to specify which instances of that tool my system needs to be compatible with. This will allow me to design my system to accept these different configurations.

Ideally I would be able to create a “Tool” class and exchange item. Then I would create instances with properties of the different types of “Tool”. For a given application, I would allocate the appropriate instances of tools to my exchange…

For example…

I’d like to create many instances of “Tool”, similar to the following, in a library. These could be added to REC’s.
1 - Name = Tool A, Diameter = 20, Length = 400
2 - Name = Tool B, Diameter = 10, Length = 100
3 - Name = Tool C, Diameter = 50, Length = 250
etc…

Some machines will need to be compatible with Tool A, B, and C, some with A only, some with B and C, and so on. I would handle this by creating RPL’s in different projects for the different machines.

Is this possible? Should I be thinking about this differently?

image

Hi,

did you try to use PVMT add-on as a solution for that ?
this means, the attributes that are configurable, they are not created as a class but as extension for the data exchange