GetInstances - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Mozilla Firefox.

Online Help

All Products    Maple    MapleSim


SysMLConnector

  

GetInstances

  

download and cache all instances for a given SysML model element

  

GetSlots

  

download and cache all slots for a given SysML model element

 

Calling Sequence

Parameters

Returns

Description

Examples

Calling Sequence

GetInstances(t)

GetInstances(u)

GetInstances(q)

GetSlots(t)

GetSlots(u)

GetSlots(q)

Parameters

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)

Returns

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.

Description

• 

The GetInstances(t) calling sequence downloads and caches all instance specifications whose classifier is t (and whose UUIDs are contained in t["_instanceSpecificationOfClassifier"]) in bulk. Typically, t is a Block.

• 

The GetSlots(t) calling sequence downloads and caches all slots whose defining feature is t (and whose UUIDs are contained in t["_slotOfDefiningFeature"]) in bulk. Typically, t is a Property.

• 

All calling sequences return the empty list  if no such instance specifications or slots exist.

• 

The GetInstances(u) and GetSlots(u) calling sequences first download the SysML model element specified by the UUID in u, and then proceed as above. If a model element with the given UUID cannot be found on the server, an error is raised.

• 

The GetInstances(q) and GetSlots(q) calling sequences first look up, download and cache the SysML model element specified by the qualified name q (see QueryModel), and then proceed 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.

• 

Both GetChildren and GetSlots can return slots. The difference is that GetSlots returns all slots with the same defining feature, which will usually belong to different instances, while GetChildren returns all slots belonging to the same instance, which will usually have different defining features.

• 

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.

Examples

withSysMLConnector

ClearChangeSet,Commit,Connect,GetBinding,GetChildren,GetConstraint,GetInstances,GetSlots,GetValue,Login,Logout,PrintChangeSet,PrintElement,PutConstraint,PutValue,QualifiedNameOf,QueryModel,Warnlevel

(1)

Loginhttps://twc.mycompany.com:8111/,user=alice,password=a%5Wr^Xt0p@2

ConnectJMPTWCSysML:

Download the Analysis Block.

Analysis_BlockQueryModelModel-Turbofan::System Breakdown::System Structure::Analysis Block

Analysis_Block01984647-e938-4b84-8484-c5d5a1f47bec,uml:Class,Block,Analysis Block

(2)

Bulk download all instances whose classifier is the Analysis Block, using the three different calling sequences.

maplprint,GetInstancesAnalysis_Block3:

["c850aafc-e3f1-4227-ae2a-fc60bc3f0427", ["uml:InstanceSpecification"], `35000ft`]
["15656fe0-d477-4844-a362-745289bae38f", ["uml:InstanceSpecification"], `41000ft`]
["13be3035-198e-418e-8188-760a575369a8", ["uml:InstanceSpecification"], `45000ft`]

maplprint,GetInstancesAnalysis_Block1:

["c850aafc-e3f1-4227-ae2a-fc60bc3f0427", ["uml:InstanceSpecification"], `35000ft`]
["15656fe0-d477-4844-a362-745289bae38f", ["uml:InstanceSpecification"], `41000ft`]
["13be3035-198e-418e-8188-760a575369a8", ["uml:InstanceSpecification"], `45000ft`]

maplprint,GetInstancesModel-Turbofan::System Breakdown::System Structure::Analysis Block:

["c850aafc-e3f1-4227-ae2a-fc60bc3f0427", ["uml:InstanceSpecification"], `35000ft`]
["15656fe0-d477-4844-a362-745289bae38f", ["uml:InstanceSpecification"], `41000ft`]
["13be3035-198e-418e-8188-760a575369a8", ["uml:InstanceSpecification"], `45000ft`]

Download the PR_fan Value Property.

PR_fanQueryModelModel-Turbofan::System Breakdown::System Structure::Analysis Block::PR_fan

PR_fand478980a-4ab8-4693-b4af-c1d136b33423,uml:Property,ValueProperty,PR_fan

(3)

Bulk download all slots whose defining feature is PR_fan is the Analysis Block, using the three different calling sequences.

maplprint,GetSlotsPR_fan3:

["e0e0cc04-bc22-446b-a32e-cefcd8bea08c", ["uml:Slot"], element]
["6c0dfef3-5134-446b-9e3f-3aed6067d7f9", ["uml:Slot"], element]
["4d76d795-6a50-4145-a61b-54853b13d0ba", ["uml:Slot"], element]

maplprint,GetSlotsPR_fan1:

["e0e0cc04-bc22-446b-a32e-cefcd8bea08c", ["uml:Slot"], element]
["6c0dfef3-5134-446b-9e3f-3aed6067d7f9", ["uml:Slot"], element]
["4d76d795-6a50-4145-a61b-54853b13d0ba", ["uml:Slot"], element]

maplprint,GetSlotsModel-Turbofan::System Breakdown::System Structure::Analysis Block::PR_fan:

["e0e0cc04-bc22-446b-a32e-cefcd8bea08c", ["uml:Slot"], element]
["6c0dfef3-5134-446b-9e3f-3aed6067d7f9", ["uml:Slot"], element]
["4d76d795-6a50-4145-a61b-54853b13d0ba", ["uml:Slot"], element]

Logout

See Also

Connect

GetChildren

JSON

QueryModel

SysMLConnector