It can sometimes be useful to use an OpaqueExpression to specify the value of a Slot. But if you do this with a value property typed, say, by a Real, you might find the value getting "stuck" on 0.0 in the inline Slot editor for an InstanceSpecification. One way to handle it is:
- Via the InstanceSpecification dialog select the Slot name (under Slots).
- If it does not already have a value you MUST first use the
Create Valuebutton to create one, which if it is a Real will by default create a LiteralReal 0.0.
- Click the small
-button at the bottom right to remove the Slot value row (do NOT use the
- Hold your mouse over the name of the Slot then access Open Specification via the context menu, which brings up the entire Slot specification dialog.
- Select value in the Slot specification dialog then click the small
- Select Opaque Expression from the expanding menu right.
- Enter an OpaqueExpression that refers to names of value properties known to the final context in which the Slot will be used, then click
There is a related tool problem:
MagicDraw/Cameo v19SP3: The display of units can't be disabled on the initialValues compartment for context-specific values, which can lead to inconsistencies when an OpaqueExpression that references value property names is used.
If you are working with SysML Extension for Physical Interaction and Signal Flow Simulation (SysPhS) and Modelica, you might also encounter this: