rest API Call For Smart Packages

MagicDraw OpenAPI, scripting related questions and discussions

Moderator: Moderators

rest API Call For Smart Packages

Postby melpers@strattechnologies.com » Fri May 20, 2022 5:30 pm

I'm making a call to the rest API trying to pull content for a smart package.
I'm able to pull the smart package, but I cannot find any field in the return that would allow me to identify the contents of the package.
And I'm not referring to any owned comments, etc.
I have a requirement in this package and in the MD UI it is listed in both the Additional Elements and Additional Content Calc properties.
But neither of these is listed in the json+ld return.

Further, I also know the element ID of this requirement and cannot find that listed in any fields in the json+ld return either.

If it's helpful, here is the url of the call (I know this is a TWC installation in our facility, but at least you can see which method I'm using): https://teamwork.strattechnologies.com: ... 25a5242224

And the return:
[
{
"ldp:membershipResource": {
"@id": "#80ba04fe-19a3-4279-b860-5125a5242224"
},
"@type": [
"ldp:DirectContainer",
"uml:Package"
],
"ldp:contains": [
{
"@id": "f8ee75a4-f107-436b-b6a6-5664a5fa14b4"
},
{
"@id": "907a1f9f-66bd-47f7-bd0b-b5a71ce890ae"
}
],
"ldp:hasMemberRelation": "kerml:ownedElement",
"@id": "",
"@context": "https://teamwork.strattechnologies.com:8111/osmc/schemas/umlElementContainer"
},
{
"kerml:name": "3.1.4.1 Training Requirements",
"@base": "https://teamwork.strattechnologies.com:8111/osmc/workspaces/17dbf301-0ad8-479d-b708-f893f2db678e/resources/2abd2d83-bf6f-466e-95b7-9e4a5e06bf91/elements",
"kerml:nsURI": "http://www.nomagic.com/magicdraw/UML/2.5.1",
"@type": "uml:Package",
"kerml:owner": {
"@id": "856922e7-3582-41cf-85bb-c80525c7f973"
},
"kerml:revision": "https://teamwork.strattechnologies.com:8111/osmc/resources/2abd2d83-bf6f-466e-95b7-9e4a5e06bf91/revisions/526",
"@context": {
"kerml": "https://teamwork.strattechnologies.com:8111/osmc/schema/kerml/20140325",
"uml:Package": "https://teamwork.strattechnologies.com:8111/osmc/schema/uml/2014345/Package"
},
"kerml:ownedElement": [
{
"@id": "f8ee75a4-f107-436b-b6a6-5664a5fa14b4"
},
{
"@id": "907a1f9f-66bd-47f7-bd0b-b5a71ce890ae"
}
],
"kerml:modifiedTime": "20220519125155EDT",
"kerml:esiData": {
"_classifierOfInheritedMember": [],
"_directedRelationshipOfSource": [],
"_representationText": null,
"ownedRule": [],
"packagedElement": [],
"packageMerge": [],
"ownedTemplateSignature": null,
"_considerIgnoreFragmentOfMessage": [],
"_elementOfSyncElement": [],
"_packageImportOfImportedPackage": [],
"_namespaceOfMember": [
{
"@id": "856922e7-3582-41cf-85bb-c80525c7f973"
}
],
"ID": "_19_0_3_14f203f7_1632157019359_160216_551",
"_relationshipOfRelatedElement": [],
"nameExpression": null,
"owningTemplateParameter": null,
"_manifestationOfUtilizedElement": [],
"_durationObservationOfEvent": [],
"visibility": "public",
"_messageOfSignature": [],
"_templateParameterSubstitutionOfOwnedActual": null,
"_componentOfPackagedElement": null,
"_constraintOfConstrainedElement": [],
"_namespaceOfImportedMember": [],
"clientDependency": [],
"_diagramOfContext": [],
"nestedPackage": [],
"ownedType": [],
"name": "3.1.4.1 Training Requirements",
"_directedRelationshipOfTarget": [],
"elementImport": [],
"_commentOfAnnotatedElement": [
{
"@id": "f8ee75a4-f107-436b-b6a6-5664a5fa14b4"
}
],
"ownedMember": [],
"supplierDependency": [],
"_informationFlowOfInformationTarget": [],
"ownedComment": [
{
"@id": "f8ee75a4-f107-436b-b6a6-5664a5fa14b4"
}
],
"_timeObservationOfEvent": [],
"_packageMergeOfMergedPackage": [],
"_informationFlowOfInformationSource": [],
"URI": "",
"_templateParameterOfOwnedDefault": null,
"templateParameter": null,
"member": [],
"ownedDiagram": [],
"_templateParameterOfDefault": [],
"owner": [
{
"@id": "856922e7-3582-41cf-85bb-c80525c7f973"
}
],
"profileApplication": [],
"ownedElement": [
{
"@id": "907a1f9f-66bd-47f7-bd0b-b5a71ce890ae"
},
{
"@id": "f8ee75a4-f107-436b-b6a6-5664a5fa14b4"
}
],
"visibility__from_PackageableElement": "public",
"packageImport": [],
"syncElement": null,
"_activityPartitionOfRepresents": [],
"_elementValueOfElement": [],
"owningPackage": {
"@id": "856922e7-3582-41cf-85bb-c80525c7f973"
},
"nestingPackage": [],
"templateBinding": [],
"namespace": [
{
"@id": "856922e7-3582-41cf-85bb-c80525c7f973"
}
],
"ownedStereotype": [],
"importedMember": [],
"mdExtensions": [],
"appliedStereotypeInstance": {
"@id": "907a1f9f-66bd-47f7-bd0b-b5a71ce890ae"
},
"_templateParameterSubstitutionOfActual": [],
"_elementImportOfImportedElement": []
},
"kerml:resource": "https://teamwork.strattechnologies.com:8111/osmc/resources/2abd2d83-bf6f-466e-95b7-9e4a5e06bf91",
"kerml:esiID": "80ba04fe-19a3-4279-b860-5125a5242224",
"@id": "#80ba04fe-19a3-4279-b860-5125a5242224"
}
]


The Element Server ID in this smart package is: 742a1ca2-2a2c-4f23-a03b-087761906d90
melpers@strattechnologies.com
Forum Newbie
Forum Newbie
 
Posts: 9
Posts Rating:0
Joined: Fri Apr 23, 2021 7:12 am

Re: rest API Call For Smart Packages

Postby melpers@strattechnologies.com » Fri May 27, 2022 8:30 am

Answering my own question here...
If you pull the smart package, then pull the owned elements of the smart package, one of them will be a slot.
The owned elements of the slot will be the items in the smart package.
melpers@strattechnologies.com
Forum Newbie
Forum Newbie
 
Posts: 9
Posts Rating:0
Joined: Fri Apr 23, 2021 7:12 am


Return to Programmatic Extendibility

Who is online

Users browsing this forum: Google [Bot] and 1 guest