SysMLConnector
GetChildren
download and cache all children of a given SysML model element
Calling Sequence
Parameters
Returns
Options
Description
Examples
GetChildren(t, options)
GetChildren(u, options)
GetChildren(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 'types' or 'related'
list of lists. Each inner list is of the form [w, l, e], where
w is a UUID string,
l is a list of strings, the first of which corresponds to the UML type, and all remaining ones (if any) correspond to stereotypes, and
e is a named table in JSON format, as described on the QueryModel page.
If e is a Slot, then l is the type information for the defining feature of e (and not for e itself), and the name slot will be used for the table e.
'types'=T : set of strings; only return owned elements whose type (either UML type or at least one of the stereotypes) is contained in T. If t is an Instance Specification, then only return slots for which the UML type or at least one of the stereotypes of their defining feature is in T.
'related'=s : string or set of strings. If this optional argument is given, then for each model element requested, additional model elements corresponding to the feature(s) in s are recursively downloaded and cached as well. These additional elements are not returned, though. The main purpose of this option is to speed up anticipated future access to certain features of the returned elements. A common use case is s="appliedStereotypeInstance", which enables faster future access to the Stereotypes of the returned elements.
The following related features are supported: "appliedStereotypeInstance", "definingFeature", "end", "ownedRule", "type". If s="all" is specified, then model elements corresponding to all of the supported features above will be additionally downloaded in bulk and cached.
The related=s argument is also in active for the recursive calls. To avoid infinite recursion, however, some elements of s may be removed.
If "appliedStereotypeInstance" is one of the related features given, then in addition to the corresponding Instance Specifications, the model elements corresponding to their classifiers will also be downloaded and cached. It is therefore not necessary (and not supported) to include "classifier" in the related features.
The GetChildren(t) calling sequence downloads and caches all children, whose UUIDs are contained in t["ownedElement"], of the SysML model element t in bulk. By default, not only the corresponding model elements but also some additional elements, e.g., related to stereotypes, are downloaded in bulk and cached as well, in order to speed up anticipated future access to these.
If t is an Instance Specification, then all slots, whose UUIDs are contained in t["slot"], are downloaded and cached instead of the owned elements. By default, some additional elements, e.g., related to defining features, are downloaded in bulk and cached as well.
The GetChildren(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 GetChildren(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
Bulk download all owned elements, and also download and cache all their stereotype information.
numelems⁡Analysis_Block3ownedElement
137
Analysis_Block3ownedElement1..3
table⁡@id=5e6c8a5a-8b56-419c-b0fe-dc129970ae5a,table⁡@id=d478980a-4ab8-4693-b4af-c1d136b33423,table⁡@id=06749ab9-3cbb-4293-9e0e-0eaaaf21017c
l≔GetChildren⁡Analysis_Block3:map⁡lprint,l1..3:
["5e6c8a5a-8b56-419c-b0fe-dc129970ae5a", ["uml:Property", "ConstraintProperty"], TtotalT] ["d478980a-4ab8-4693-b4af-c1d136b33423", ["uml:Property", "ValueProperty"], PR_fan] ["06749ab9-3cbb-4293-9e0e-0eaaaf21017c", ["uml:Connector", "BindingConnector"], element]
Get only all Value Properties, using the UUID calling sequence. (In this case, they have already been downloaded by the previous command, so they will just be retrieved from the cache.)
l≔GetChildren⁡Analysis_Block1,types=ValueProperty:numelems⁡l
45
map⁡lprint,l1..3:
["d478980a-4ab8-4693-b4af-c1d136b33423", ["uml:Property", "ValueProperty"], PR_fan] ["0551c1c3-8afc-4655-9fb9-b787261d0657", ["uml:Property", "ValueProperty"], nozzle_area] ["695b099b-3dcf-4a75-b1be-330f6f88638a", ["uml:Property", "ValueProperty"], P04]
Filter out Value Properties with a default value.
l≔remove⁡z↦z3defaultValue=JSON:−null,l:numelems⁡l
29
["d478980a-4ab8-4693-b4af-c1d136b33423", ["uml:Property", "ValueProperty"], PR_fan] ["0551c1c3-8afc-4655-9fb9-b787261d0657", ["uml:Property", "ValueProperty"], nozzle_area] ["e6767b34-5e29-4b91-9db0-cf10e5f37cdf", ["uml:Property", "ValueProperty"], Bvc]
Get only Constraint Properties, using the qualified name, and also download and cache their stereotypes and types.
l≔GetChildren⁡Model-Turbofan::System Breakdown::System Structure::Analysis Block,types=ConstraintProperty,related=type,appliedStereotypeInstance:map⁡lprint,l:
["5e6c8a5a-8b56-419c-b0fe-dc129970ae5a", ["uml:Property", "ConstraintProperty"], TtotalT] ["4fa03b71-e5d6-4543-bc8e-41470c0d833e", ["uml:Property", "ConstraintProperty"], To1] ["5a3b37f1-b346-43f7-a15d-0d7e91b6b656", ["uml:Property", "ConstraintProperty"], TtotalP] ["8d059dad-0996-41f8-a455-e016467cdb6b", ["uml:Property", "ConstraintProperty"], Vin] ["deb9bd28-f204-47d4-973f-7cb5cf635f1d", ["uml:Property", "ConstraintProperty"], tempDiff] ["9663d656-0202-44d3-b84a-45b9600d8c5c", ["uml:Property", "ConstraintProperty"], Mn] ["cd1eb995-6c0f-4e53-b10e-b746762afb5c", ["uml:Property", "ConstraintProperty"], Po1]
Logout⁡
See Also
Connect
GetSlots
JSON
QueryModel
Download Help Document