SysMLConnector
GetBinding
retrieve equation(s) corresponding to Binding Connector(s)
Calling Sequence
Parameters
Returns
Options
Description
Examples
GetBinding(t, options)
GetBinding(u, options)
GetBinding(q, options)
t
-
table in JSON format; previously downloaded SysML model element
u
UUID string, or table where u["@id"] is a UUID string
q
string; qualified name with :: as separator(s)
options
(optional) equation(s) of the form keyword=value, where keyword is either 'output' or 'fullname'
If t is a Binding Connector, an equation string=string is returned, unless 'output'='compact' is specificed, in which case the equation is of type symbol=symbol.
If t is a Block, the return value is a list. By default, each list entry is of the form [w, e], where w is a UUID string and e is an equation of the form string=string. If 'output=compact' is specified, then each list entry is an equation of the form symbol=symbol.
Otherwise, the return value is NULL.
Both sides of the equation(s) returned are names, whose format is determined by the fullname option.
'output'='compact' : if specified, only equation(s) of the form symbol=symbol are returned, without UUIDs. The default behaviour, when this option is not specified, is described in the Returns section.
'fullname'=f : determines the form of the names in the output.
If f=true, then fully qualified names is returned, starting from the root element, and separated by the two characters ::.
If f=false (the default), then only the model elements' names are returned.
If f=short, then names of the form a::b are returned, where b is the name of a model element and a is the name of its owner.
For a Binding Connector t, the GetBinding(t) calling sequence converts t to a Maple equation, by default of the form string=string, where both sides represent variable names.
The names on both sides of the equation are determined from the model elements referenced by the role entries of the two connector ends. The format of the two sides of the equation is determined by the output and fullname options.
If t is a Block, then equations as above are computed for all Binding Connectors owned by the Block in bulk. This is more efficient than calling GetBinding individually on each connector in a loop. By default, for each connector both its UUID and the corresponding equation are returned.
Otherwise, if t is neither a Binding Connector nor a Block, the return value is NULL.
The GetBinding(u) calling sequence first downloads the SysML model element specified by the UUID in u, and then proceeds as above. If a model element with the given UUID cannot be found on the server, an error is raised.
The GetBinding(q) calling sequence first looks up, downloads and caches the SysML model element specified by the qualified name q (see QueryModel), and then proceeds as above. If a model element with the given qualified name cannot be found on the server, an error is raised.
If the first argument is a table in JSON format without an "@id" field, then it is assumed to be a valid model element, corresponding to the t calling sequence. If the first argument is a string that is not a syntactically valid UUID, then it is assumed to be a qualified name, corresponding to the q calling sequence.
Model elements that have already been downloaded and cached previously are retrieved from the cache instead of re-downloaded from the server.
Use of this command requires an active server connection, using the Connect command. If such a connection does not exist, an error will be raised.
with⁡SysMLConnector
ClearChangeSet,Commit,Connect,GetBinding,GetChildren,GetConstraint,GetInstances,GetSlots,GetValue,Login,Logout,PrintChangeSet,PrintElement,PutConstraint,PutValue,QualifiedNameOf,QueryModel,Warnlevel
Login⁡https://twc.mycompany.com:8111/,user=alice,password=a%5Wr^Xt0p@2
Connect⁡JMPTWCSysML:
Download the Analysis Block.
Analysis_Block≔QueryModel⁡Model-Turbofan::System Breakdown::System Structure::Analysis Block
Analysis_Block≔01984647-e938-4b84-8484-c5d5a1f47bec,uml:Class,Block,Analysis Block
UUIDs and equations for all Binding Connectors in the Analysis Block, using only simple names.
l≔GetBinding⁡Analysis_Block3:
numelems⁡l
78
map⁡lprint,l1..3:
["06749ab9-3cbb-4293-9e0e-0eaaaf21017c", "Cp" = "Cpair"] ["bb6b19e5-7638-42ec-bbe4-8bcdbb3d8db0", "R" = "R"] ["6f515b95-18fb-4d96-bc16-d322740c7ef5", "Cp" = "Cp_air"]
For the 2nd equation, note that the two sides are actually variables from different packages. This can be seen by getting the equation only for the 2nd connector but with qualified names, as symbols. (This also demonstrates the UUID calling sequence.)
GetBinding⁡bb6b19e5-7638-42ec-bbe4-8bcdbb3d8db0,output=compact,fullname=true
Model-Turbofan::System Breakdown::System Structure::InletConditions::R=Model-Turbofan::Constraints::MachNumber::R
Using the qualified name calling sequence, get equations for all connectors in the analysis block, without UUIDs, and using shorter names of the form a::b.
l≔GetBinding⁡Model-Turbofan::System Breakdown::System Structure::Analysis Block,output=compact,fullname=short:
`InletConditions::Cp` = `High Pressure Axial Compressor::Cpair` `InletConditions::R` = `MachNumber::R` `InletConditions::Cp` = `Combustor::Cp_air`
Logout⁡
See Also
Connect
GetChildren
JSON
QueryModel
Download Help Document