aboutsummaryrefslogtreecommitdiffstats
path: root/catalog-be/src/main/java/org
diff options
context:
space:
mode:
authorpriyanshu <pagarwal@amdocs.com>2018-10-22 17:54:45 +0530
committerAvi Gaffa <avi.gaffa@amdocs.com>2018-10-23 07:44:25 +0000
commit2dadfcd572cc081644f74a0c03dbc4dbd4a339b9 (patch)
tree13c3a9d070631c99a7a8403ab3c7f1acc97c8dcb /catalog-be/src/main/java/org
parent2aaf531724c4c1f1525e96d851697991cad62231 (diff)
Workflow duplicate artifacts in CSAR
Old workflow artifacts still packed in csar even if another workflow is assigned to same operation Change-Id: Iee956903222d1fc1e8c898b4989b2198501554bb Issue-ID: SDC-1862 Signed-off-by: priyanshu <pagarwal@amdocs.com>
Diffstat (limited to 'catalog-be/src/main/java/org')
-rw-r--r--catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ArtifactsBusinessLogic.java10
1 files changed, 10 insertions, 0 deletions
diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ArtifactsBusinessLogic.java b/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ArtifactsBusinessLogic.java
index 03ffdd5fa6..65260c10a2 100644
--- a/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ArtifactsBusinessLogic.java
+++ b/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ArtifactsBusinessLogic.java
@@ -3162,6 +3162,16 @@ public class ArtifactsBusinessLogic extends BaseBusinessLogic {
}
String uniqueId = implementationArtifact.getUniqueId();
+ Either<Long, CassandraOperationStatus> artifactCount = artifactCassandraDao.getCountOfArtifactById(uniqueId);
+ if(artifactCount.isLeft()){
+ CassandraOperationStatus cassandraOperationStatus = artifactCassandraDao.deleteArtifact(uniqueId);
+ if(cassandraOperationStatus != CassandraOperationStatus.OK){
+ log.debug("Failed to persist operation {} artifact, error is {}",operation.getName(),cassandraOperationStatus);
+ StorageOperationStatus storageStatus = DaoStatusConverter.convertCassandraStatusToStorageStatus(cassandraOperationStatus);
+ ActionStatus convertedFromStorageResponse = componentsUtils.convertFromStorageResponse(storageStatus);
+ return Either.right(componentsUtils.getResponseFormat(convertedFromStorageResponse));
+ }
+ }
artifactData.setId(uniqueId);
CassandraOperationStatus cassandraOperationStatus = artifactCassandraDao.saveArtifact(artifactData);
if(cassandraOperationStatus != CassandraOperationStatus.OK){