Ejemplo n.º 1
0
 def update_asset_association(self,oldEnvName,oldHeadAsset,oldTailAsset,assoc):
   assocParams = ClassAssociationParameters(
     envName=assoc.theEnvironmentName,
     headName=assoc.theHeadAsset,
     headDim='asset',
     headNav=assoc.theHeadNavigation,
     headType=assoc.theHeadType,
     headMultiplicity=assoc.theHeadMultiplicity,
     headRole=assoc.theHeadRole,
     tailRole=assoc.theTailRole,
     tailMultiplicity=assoc.theTailMultiplicity,
     tailType=assoc.theTailType,
     tailNav=assoc.theTailNavigation,
     tailDim='asset',
     tailName=assoc.theTailAsset,
     rationale=assoc.theRationale)
   try:
     if ((assoc.theEnvironmentName != oldEnvName) or (assoc.theHeadAsset != oldHeadAsset) or (assoc.theTailAsset != oldTailAsset)):
       self.db_proxy.checkAssetAssociation(assoc.theEnvironmentName,assoc.theHeadAsset,assoc.theTailAsset)
     caId = self.db_proxy.getDimensionId(oldEnvName + '/' + oldHeadAsset + '/' + oldTailAsset,'classassociation')
     assocParams.setId(caId)
     self.db_proxy.updateClassAssociation(assocParams)
   except ARMException as ex:
     self.close()
     raise ARMHTTPError(ex)
Ejemplo n.º 2
0
    def update_asset_association(self, oldEnvName, oldHeadAsset, oldTailAsset,
                                 assoc):
        old_assoc = self.get_asset_association(oldEnvName, oldHeadAsset,
                                               oldTailAsset)
        id = old_assoc.theId

        assocParams = ClassAssociationParameters(
            envName=assoc.theEnvironmentName,
            headName=assoc.theHeadAsset,
            headDim=assoc.theHeadDim,
            headNav=assoc.theHeadNavigation,
            headType=assoc.theHeadType,
            headMultiplicity=assoc.theHeadMultiplicity,
            headRole=assoc.theHeadRole,
            tailRole=assoc.theTailRole,
            tailMultiplicity=assoc.theTailMultiplicity,
            tailType=assoc.theTailType,
            tailNav=assoc.theTailNavigation,
            tailDim=assoc.theTailDim,
            tailName=assoc.theTailAsset,
            rationale=assoc.theRationale)
        assocParams.setId(id)
        try:
            self.db_proxy.updateClassAssociation(assocParams)
        except ARMException as ex:
            self.close()
            raise ARMHTTPError(ex)
Ejemplo n.º 3
0
    def update_asset_association(self, assoc):
        old_assoc = self.get_asset_association(assoc.theEnvironmentName, assoc.theHeadAsset, assoc.theTailAsset)
        id = old_assoc.theId

        assocParams = ClassAssociationParameters(
            envName=assoc.theEnvironmentName,
            headName=assoc.theHeadAsset,
            headDim=assoc.theHeadDim,
            headNav=assoc.theHeadNavigation,
            headType=assoc.theHeadType,
            headMultiplicity=assoc.theHeadMultiplicity,
            headRole=assoc.theHeadRole,
            tailRole=assoc.theTailRole,
            tailMultiplicity=assoc.theTailMultiplicity,
            tailType=assoc.theTailType,
            tailNav=assoc.theTailNavigation,
            tailDim=assoc.theTailDim,
            tailName=assoc.theTailAsset,
            rationale=assoc.theRationale,
        )
        assocParams.setId(id)
        try:
            self.db_proxy.updateClassAssociation(assocParams)
        except ARMException as ex:
            self.close()
            raise ARMHTTPError(ex)
Ejemplo n.º 4
0
 def parameters(self):
     parameters = ClassAssociationParameters(
         self.theEnvironmentName, self.theHeadAsset, 'asset',
         self.theHeadNav, self.theHeadType, self.theHeadMultiplicity,
         self.theHeadRole, self.theTailRole, self.theTailMultiplicity,
         self.theTailType, self.theTailNav, 'asset', self.theTailAsset)
     parameters.setId(self.theClassAssociationId)
     return parameters
Ejemplo n.º 5
0
 def update_asset_association(self,oldEnvName,oldHeadAsset,oldTailAsset,assoc):
   assocParams = ClassAssociationParameters(
     envName=assoc.theEnvironmentName,
     headName=assoc.theHeadAsset,
     headDim='asset',
     headNav=assoc.theHeadNavigation,
     headType=assoc.theHeadType,
     headMultiplicity=assoc.theHeadMultiplicity,
     headRole=assoc.theHeadRole,
     tailRole=assoc.theTailRole,
     tailMultiplicity=assoc.theTailMultiplicity,
     tailType=assoc.theTailType,
     tailNav=assoc.theTailNavigation,
     tailDim='asset',
     tailName=assoc.theTailAsset,
     rationale=assoc.theRationale)
   try:
     caId = self.db_proxy.getDimensionId(oldEnvName + '/' + oldHeadAsset + '/' + oldTailAsset,'classassociation')
     assocParams.setId(caId)
     self.db_proxy.updateClassAssociation(assocParams)
   except ARMException as ex:
     self.close()
     raise ARMHTTPError(ex)
Ejemplo n.º 6
0
 def parameters(self):
   parameters = ClassAssociationParameters(self.theEnvironmentName,self.theHeadAsset,'asset',self.theHeadNav,self.theHeadType,self.theHeadMultiplicity,self.theHeadRole,self.theTailRole,self.theTailMultiplicity,self.theTailType,self.theTailNav,'asset',self.theTailAsset)
   parameters.setId(self.theClassAssociationId)
   return parameters