I am trying an approach that is alternative to https://r1132100503382-eu1-3dswym.3dexperience.3ds.com/community/swym:prd:R1132100503382:community:4GJPS8QmTuC4wF8BSLitkw?content=swym:prd:R1132100503382:qnaquestion:s7gdTsl9SL-b-W_RgeO-Mg.
The new approach is to define a value property, derived, on a block, and execute something to assign a value to it.
I do not want to assign a constant, however. The most appropriate solution seems to me to create a Constraint inside a Constraint Block (SysML). (I added a parametric block to the diagram to map the Parameters in the Block to the relevant Constraint Parameters.)
Great new! This works perfectly in a simple example (z = x + y) constructed using Built-in Math.
(Critical Note: Each of these values (x, y, z) maps to a Slot value (v1, v2, sum) defined on an Instance Specification of the Block the Value Properties of which map to Constraint Properties.)
In the real world, though, the derived values are much more complex. What I want to do, therefore, is use some version of the Structured Expressions I already developed initially for Custom Columns in tables.
I have not found a way to make this work. Specifically, I have not found a way to pass the Instance Specification Slot values (from the instance in question -- not all the instance values, which is possible to extract by starting with the Constraint Parameter) to a Structured Expression defining the Constraint. Even more, I do not see conceptually how to map the Structured Expression output to a Constraint Property, since there is no assignment option for a Structured Expression.
I suspect this is possible using a script that invokes the MagicDraw API to call an Opaque Behavior, with parameters, that in turn is implemented using a Structured Expression. That seems plausible, but well beyond the level of complexity I was envisioning would be necessary.
Is there some (hopefully reasonable) way to do this?
