22from sysmlv2_client import SysMLV2Client , SysMLV2Error , SysMLV2NotFoundError
33from typing import Any , Dict
44
5- minimal_payload = [
6- {
7- "payload" : {
8- "@type" : "Empty" ,
9- "@id" : "8dd9e99d-ec41-44d8-bb18-a1d849d3aff5" ,
10- "elementId" : "8dd9e99d-ec41-44d8-bb18-a1d849d3aff5" ,
11- "qualifiedName" : "" ,
12- "isImpliedIncluded" : True ,
13- "isLibraryElement" : False ,
14- "ownedElement" : [],
15- "ownedRelationship" : []
16- }
17- }
18- ]
195def create_sysml_project (client : SysMLV2Client , name :str , description :str = "project description" ):
206 created_project = None
217 example_project_id = None
@@ -29,11 +15,6 @@ def create_sysml_project(client: SysMLV2Client, name:str, description:str="proje
2915 created_project = client .create_project (new_project_data )
3016 # Store the ID for later use
3117 example_project_id = created_project .get ('@id' )
32- # if not example_project_id:
33- # print("\n*** WARNING: Could not extract project ID ('@id') from response! Subsequent steps might fail. ***")
34- # else:
35- # #create empty commit so we can branch off an empty commit initially
36- # commit_response, commit_id = commit_to_project(client, example_project_id, minimal_payload)
3718 except SysMLV2Error as e :
3819 print (f"Error creating project: { e } " )
3920 return created_project , example_project_id , commit_id
0 commit comments