コード例 #1
0
    def update_goal_association(self,
                                assoc,
                                environment_name,
                                goal_name,
                                subgoal_name,
                                pathValues=[]):
        if (assoc.theGoal == assoc.theSubGoal):
            raise CairisHTTPError(status_code=http.client.BAD_REQUEST,
                                  status="Self-refinement error",
                                  message='Cannot self-refine ' +
                                  assoc.theGoal)

        old_assoc = self.get_goal_association(environment_name, goal_name,
                                              subgoal_name, False)
        assocId = old_assoc.theId

        assocParams = GoalAssociationParameters(
            envName=assoc.theEnvironmentName,
            goalName=assoc.theGoal,
            goalDimName=assoc.theGoalDimension,
            aType=assoc.theAssociationType,
            subGoalName=assoc.theSubGoal,
            subGoalDimName=assoc.theSubGoalDimension,
            alternativeId=assoc.theAlternativeId,
            rationale=assoc.theRationale)
        assocParams.setId(assocId)
        try:
            self.db_proxy.updateGoalAssociation(assocParams)
        except ARMException as ex:
            self.close()
            raise ARMHTTPError(ex)
コード例 #2
0
 def parameters(self):
     parameters = GoalAssociationParameters(
         self.theEnvironmentName, self.theGoal, self.theGoalDimension,
         self.theGoalAssociationType, self.theSubGoal,
         self.theSubGoalDimension, self.theAlternativeFlag,
         self.theRationale)
     parameters.setId(self.theGoalAssociationId)
     return parameters
コード例 #3
0
 def parameters(self):
     parameters = GoalAssociationParameters(
         self.theEnvironmentName,
         self.theGoal,
         self.theGoalDimension,
         self.theGoalAssociationType,
         self.theSubGoal,
         self.theSubGoalDimension,
         self.theAlternativeFlag,
         self.theRationale,
     )
     parameters.setId(self.theGoalAssociationId)
     return parameters
コード例 #4
0
 def update_goal_association(self,assoc):
   old_assoc = self.get_goal_association(assoc.theEnvironmentName,assoc.theGoal,assoc.theSubGoal)
   id = old_assoc.theId
   assocParams = GoalAssociationParameters(
     envName=assoc.theEnvironmentName,
     goalName=assoc.theGoal,
     goalDimName=assoc.theGoalDimension,
     aType=assoc.theAssociationType,
     subGoalName=assoc.theSubGoal,
     subGoalDimName=assoc.theSubGoalDimension,
     alternativeId=assoc.theAlternativeId,
     rationale=assoc.theRationale)
   assocParams.setId(id)
   try:
     self.db_proxy.updateGoalAssociation(assocParams)
   except ARMException as ex:
     self.close()
     raise ARMHTTPError(ex)
コード例 #5
0
ファイル: GoalAssociationDAO.py プロジェクト: llewelld/cairis
 def update_goal_association(self, assoc):
     old_assoc = self.get_goal_association(assoc.theEnvironmentName,
                                           assoc.theGoal, assoc.theSubGoal)
     id = old_assoc.theId
     assocParams = GoalAssociationParameters(
         envName=assoc.theEnvironmentName,
         goalName=assoc.theGoal,
         goalDimName=assoc.theGoalDimension,
         aType=assoc.theAssociationType,
         subGoalName=assoc.theSubGoal,
         subGoalDimName=assoc.theSubGoalDimension,
         alternativeId=assoc.theAlternativeId,
         rationale=assoc.theRationale)
     assocParams.setId(id)
     try:
         self.db_proxy.updateGoalAssociation(assocParams)
     except ARMException as ex:
         self.close()
         raise ARMHTTPError(ex)