@@ -3247,7 +3247,10 @@ def getReferenceSynopsis(self,refName):
32473247 dimName = row [2 ]
32483248 aType = row [3 ]
32493249 aName = row [4 ]
3250- rs = ReferenceSynopsis (rsId ,refName ,synName ,dimName ,aType ,aName )
3250+ synDim = row [5 ]
3251+ gsName = row [6 ]
3252+ goals = self .userGoalSystemGoals (rsId )
3253+ rs = ReferenceSynopsis (rsId ,refName ,synName ,dimName ,aType ,aName ,synDim ,gsName ,goals )
32513254 return rs
32523255
32533256 def getReferenceContribution (self ,charName ,refName ):
@@ -3282,6 +3285,8 @@ def addReferenceSynopsis(self,rs):
32823285 actorName = rs .actor ()
32833286 gSat = rs .satisfaction ()
32843287 self .updateDatabase ('call addReferenceSynopsis(:rsId,:ref,:rs,:dim,:atName,:actName,:gSat)' ,{'rsId' :rsId ,'ref' :refName ,'rs' :rsName ,'dim' :rsDim ,'atName' :atName ,'actName' :actorName ,'gSat' :gSat },'MySQL error adding reference synopsis' )
3288+ for sysGoal in rs .goals ():
3289+ self .addUserSystemGoalLink (rsName ,sysGoal )
32853290 return rsId
32863291
32873292 def updateReferenceSynopsis (self ,rs ):
@@ -3292,7 +3297,10 @@ def updateReferenceSynopsis(self,rs):
32923297 atName = rs .actorType ()
32933298 actorName = rs .actor ()
32943299 gSat = rs .satisfaction ()
3295- self .updateDatabase ('call updateReferenceSynopsis(:rsId,:ref,:rs,:dim,:atName,:actName,:gSat)' ,{'rsId' :rsId ,'ref' :refName ,'rs' :rsName ,'dim' :rsDim ,'atName' :atName ,'actName' :actorName ,'gSat' :gSat },'MySQL error updating reference synopsis' )
3300+ session = self .updateDatabase ('call deleteUserGoalComponents(:id)' ,{'id' :rsId },'MySQL error deleting user goal components' ,None ,False )
3301+ self .updateDatabase ('call updateReferenceSynopsis(:rsId,:ref,:rs,:dim,:atName,:actName,:gSat)' ,{'rsId' :rsId ,'ref' :refName ,'rs' :rsName ,'dim' :rsDim ,'atName' :atName ,'actName' :actorName ,'gSat' :gSat },'MySQL error updating reference synopsis' ,session )
3302+ for sysGoal in rs .goals ():
3303+ self .addUserSystemGoalLink (rsName ,sysGoal )
32963304
32973305 def addCharacteristicSynopsis (self ,cs ):
32983306 cName = cs .reference ()
@@ -3302,6 +3310,8 @@ def addCharacteristicSynopsis(self,cs):
33023310 actorName = cs .actor ()
33033311 gSat = cs .satisfaction ()
33043312 self .updateDatabase ('call addCharacteristicSynopsis(:cName,:csName,:csDim,:atName,:actName,:gSat)' ,{'cName' :cName ,'csName' :csName ,'csDim' :csDim ,'atName' :atName ,'actName' :actorName ,'gSat' :gSat },'MySQL error adding characteristic synopsis' )
3313+ for sysGoal in cs .goals ():
3314+ self .addUserSystemGoalLink (csName ,sysGoal )
33053315
33063316 def updateCharacteristicSynopsis (self ,cs ):
33073317 cName = cs .reference ()
@@ -3310,7 +3320,10 @@ def updateCharacteristicSynopsis(self,cs):
33103320 atName = cs .actorType ()
33113321 actorName = cs .actor ()
33123322 gSat = cs .satisfaction ()
3313- self .updateDatabase ('call updateCharacteristicSynopsis(:cName,:csName,:csDim,:atName,:actName,:gSat)' ,{'cName' :cName ,'csName' :csName ,'csDim' :csDim ,'atName' :atName ,'actName' :actorName ,'gSat' :gSat },'MySQL error updating characteristic synopsis' )
3323+ session = self .updateDatabase ('call deleteUserGoalComponents(:id)' ,{'id' :cs .id ()},'MySQL error deleting user goal components' ,None ,False )
3324+ self .updateDatabase ('call updateCharacteristicSynopsis(:cName,:csName,:csDim,:atName,:actName,:gSat)' ,{'cName' :cName ,'csName' :csName ,'csDim' :csDim ,'atName' :atName ,'actName' :actorName ,'gSat' :gSat },'MySQL error updating characteristic synopsis' ,session )
3325+ for sysGoal in cs .goals ():
3326+ self .addUserSystemGoalLink (csName ,sysGoal )
33143327
33153328 def referenceCharacteristic (self ,refName ): return self .responseList ('call referenceCharacteristic(:ref)' ,{'ref' :refName },'MySQL error getting characteristics associated with reference ' + refName )
33163329
@@ -4864,8 +4877,16 @@ def checkTrace(self,fromObjt,fromName,toObjt,toName):
48644877 def getUserGoals (self ,constraintId = - 1 ):
48654878 rows = self .responseList ('call getUserGoals(:id)' ,{'id' :constraintId },'MySQL error getting user goals' )
48664879 objts = []
4867- for row in rows :
4868- objts .append (ReferenceSynopsis (row [0 ],row [1 ],row [2 ],row [3 ],'persona' ,row [4 ],row [5 ],row [6 ]))
4880+ for row in rows :
4881+ rsId = row [0 ]
4882+ refName = row [1 ]
4883+ synName = row [2 ]
4884+ dimName = row [3 ]
4885+ personaName = row [4 ]
4886+ synDim = row [5 ]
4887+ gsName = row [6 ]
4888+ sysGoals = self .userGoalSystemGoals (rsId )
4889+ objts .append (ReferenceSynopsis (rsId ,refName ,synName ,dimName ,'persona' ,personaName ,synDim ,gsName ,sysGoals ))
48694890 return objts
48704891
48714892 def addUserGoal (self ,objt ):
@@ -4876,6 +4897,8 @@ def addUserGoal(self,objt):
48764897 personaName = objt .actor ()
48774898 gSat = objt .satisfaction ()
48784899 self .updateDatabase ('call addUserGoal(:ugId,:refName,:synName,:dimName,:personaName,:gSat)' ,{'ugId' :ugId ,'refName' :refName ,'synName' :synName ,'dimName' :dimName ,'personaName' :personaName ,'gSat' :gSat },'MySQL error adding user goal' )
4900+ for sysGoal in objt .goals ():
4901+ self .addUserSystemGoalLink (synName ,sysGoal )
48794902
48804903 def updateUserGoal (self ,objt ):
48814904 ugId = objt .id ()
@@ -4884,7 +4907,10 @@ def updateUserGoal(self,objt):
48844907 dimName = objt .dimension ()
48854908 personaName = objt .actor ()
48864909 gSat = objt .satisfaction ()
4887- self .updateDatabase ('call updateUserGoal(:ugId,:refName,:synName,:dimName,:personaName,:gSat)' ,{'ugId' :ugId ,'refName' :refName ,'synName' :synName ,'dimName' :dimName ,'personaName' :personaName ,'gSat' :gSat },'MySQL error updating user goal' )
4910+ session = self .updateDatabase ('call deleteUserGoalComponents(:id)' ,{'id' :ugId },'MySQL error deleting user goal components' ,None ,False )
4911+ self .updateDatabase ('call updateUserGoal(:ugId,:refName,:synName,:dimName,:personaName,:gSat)' ,{'ugId' :ugId ,'refName' :refName ,'synName' :synName ,'dimName' :dimName ,'personaName' :personaName ,'gSat' :gSat },'MySQL error updating user goal' ,session )
4912+ for sysGoal in objt .goals ():
4913+ self .addUserSystemGoalLink (synName ,sysGoal )
48884914
48894915 def deleteUserGoal (self ,ugId = - 1 ):
48904916 self .deleteObject (ugId ,'user_goal' )
@@ -4904,7 +4930,7 @@ def getGoalContributionsTable(self,sourceId = -1, targetId = -1):
49044930 return objts
49054931
49064932 def deleteGoalContribution (self ,src ,tgt ):
4907- self .updateDatabase (' call deleteGoalContribution(:src,:tgt)' ,{'src' :src ,'tgt' :tgt },'MySQL error deleting goal contribution' )
4933+ self .updateDatabase ('call deleteGoalContribution(:src,:tgt)' ,{'src' :src ,'tgt' :tgt },'MySQL error deleting goal contribution' )
49084934
49094935 def taskContributions (self ,taskName ,envName ):
49104936 rows = self .responseList ('call getTaskContributions(:taskName,:envName)' ,{'taskName' :taskName ,'envName' :envName },'MySQL error getting task contributions' )
@@ -4918,3 +4944,9 @@ def conflictingPersonaCharacteristics(self,pName,ugName):
49184944 if (len (objts ) == 1 and objts [0 ] == '' ):
49194945 objts = []
49204946 return objts
4947+
4948+ def addUserSystemGoalLink (self ,ugName ,sgName ):
4949+ self .updateDatabase ('call addUserSystemGoalLink(:ugName,:sgName)' ,{'ugName' :ugName ,'sgName' :sgName },'MySQL error adding user/system goal link' )
4950+
4951+ def userGoalSystemGoals (self ,ugId ):
4952+ return self .responseList ('call userGoalSystemGoals(:ugId)' ,{'ugId' :ugId },'MySQL error getting user goal system goals' )
0 commit comments