ALT and LOOP in Exchange Scenarios: conditions and "breaks"

Hello everyone,

I am working on this ES diagram and it happens to fit very well to both the (related) questions I have on SE diagrams:

  1. When using ALT, how do we set the condition for choosing one or the other operand? My conditions are written as white notes on the corners, but there must be a better way to do this… right?
  2. This ALT is included in a LOOP and one of its parts should contain the instruction to break out of the LOOP. Is there a way to set this?

Many thanks

Hi @cherry_picker,
With respect to Question 1:

If you look at the properties tab for the additional ALT operands that you have created then you will see a field called guard. Use this field.

With respect to question 2:

I would put a guard condition on saying how often the loop is repeated. Thus specifying when to break out. Again, do this in the properties tab for the loop operand element.

Semantically, if you want to break the loop then you might need to consider putting the loop inside an ALT fragment, i.e loop until this other condition is true. Or this could be specified within the loop guard. I.e. Loop while x=TRUE.

Hope this helps,

Thanks, Josh

1 Like

Thank you, this is very helpful.
These Guards (as opaque expressions) are always just text and cannot really be evaluated, right?

Glad to hear.

Capella does not have any inbuilt simulation so in a sense, nothing is natively evaluated. However, I presume you mean from external simulation programmes that can interact with the model data… in which case you are right in that it is stored just as text. If you need more rigorous data storage, you could look into using property values which can be allocated to the operands. The external simulation could then access these property values instead.

1 Like

Hi all,
Yes Property value can be a condition to execute and operand. The point I have is that in some case the fixed value attached to the PV where I would like a variable. Then I have only the guard condition to compare an exchange item element to a component property, both being typed by related details, or the same. I use the text connection in the expression, but true at the end it’s text. Referenced names appear in blue only where you write it. When referred the text does not show any link. The way of setting the reference is not easy, and you have to prepare it: avoid short names, decline each name when transitioned or reused elsewhere in the design tree, remember the offered selection narrows while you type the name…
In this text there is no mathematical operator name reserved (and no logical operator either), no syntax: your have to set one and follow it. I don’t transfer to a runnable model, but if you manage to do it, then the syntax shall relate to this tool.

1 Like

how did you get several operand , i can not add one could you tell me please how can i do that .

Create your ALT, PAR etc on the diagram. Then use the Operand element in the palate. Click near the top of the ALT, PAR etc to add it.

Josh

1 Like