SysMLConnector
PrintElement
print the entries of a SysML model element
Calling Sequence
Parameters
Description
Examples
PrintElement(t, n, 'all')
PrintElement(u, n, 'all')
t
-
table in JSON format; previously downloaded SysML model element
u
UUID string, or table where u["@id"] is a UUID string
n
(optional) nonnegint; indentation level; default 0
'all'
(optional) literal keyword; print all entries, including empty ones
The PrintElement(t) calling sequence prints the entries of the SysML model element given by the table t. Each entry is printed in the form ID=value, where ID is a string containing the field name.
If the value is a list, its entries will be enclosed in square brackets [], and printed on separate lines if there is more than one.
If the value is itself a table, its entries will be enclosed in curly braces {}, and printed on separate lines if there is more than one.
By default, entries whose value is JSON:-null, true, false, or an empty list [] will be omitted, unless the optional keyword 'all' is given.
The PrintElement(u) calling sequence first downloads the model element given by the UUID in u and then prints its entries as above. An error is raised if the u does not correspond to a valid UUID, or if the model element cannot be found on the server.
The optional argument n determines the indentation depth, i.e., the number of spaces by which every output line is indented. This is used mainly when PrintElement calls itself recursively.
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:
Query by fully qualified name. The result is a Property with stereotype Value Property.
Velocity_in≔QueryModel⁡Model-Turbofan::System Breakdown::System Structure::Analysis Block::Velocity_in
Velocity_in≔ad42d107-2e10-477c-bb4d-32eed2dac1ba,uml:Property,ValueProperty,Velocity_in
Inspect the non-trivial fields of Velocity_in3.
PrintElement⁡Velocity_in3
"ID" = "_19_0_4_8970276_1622738256599_54261_15" "_namespaceOfMember" = [1 = {"@id" = "01984647-e938-4b84-8484-c5d5a1f47bec"}] "_structuredClassifierOfOwnedAttribute" = {"@id" = "01984647-e938-4b84-8484-c5d5a1f47bec"} "_structuredClassifierOfRole" = [1 = {"@id" = "01984647-e938-4b84-8484-c5d5a1f47bec"}] "aggregation" = "composite" "appliedStereotypeInstance" = {"@id" = "2b7c622b-19a9-4bf1-acc9-792ef726293a"} "defaultValue" = {"@id" = "665e7b57-6b20-47e7-bda1-aeae991ef08b"} "name" = "Velocity_in" "namespace" = [1 = {"@id" = "01984647-e938-4b84-8484-c5d5a1f47bec"}] "ownedElement" = [ 1 = {"@id" = "665e7b57-6b20-47e7-bda1-aeae991ef08b"} 2 = {"@id" = "2b7c622b-19a9-4bf1-acc9-792ef726293a"} ] "owner" = [1 = {"@id" = "01984647-e938-4b84-8484-c5d5a1f47bec"}] "type" = {"@id" = "41421539-c8a9-4ca7-8d86-ea0634f34579"} "visibility" = "public"
Print all entries of Velocity_in3. (This would normally trigger the download of the model element corresponding to the given UUID, but since it has already been downloaded by the QueryModel call above, it will just be retrieved from the internal cache.)
PrintElement⁡ad42d107-2e10-477c-bb4d-32eed2dac1ba,all
Logout⁡
See Also
QueryModel
Download Help Document