diff options
author | xuegao <xg353y@intl.att.com> | 2020-09-04 15:29:15 +0200 |
---|---|---|
committer | Sébastien Determe <sebastien.determe@intl.att.com> | 2020-09-07 13:27:32 +0000 |
commit | 84a51513bca9c41c8757db017eb45b2d801da195 (patch) | |
tree | d8919801c30d8831e2e4ba55102f35fc95d05ea4 | |
parent | 44c6c0d23504e8d1353cd449541f95bc2033cddb (diff) |
Use meaningful workflow name
When generate csar, use meaningful workflow name instead of null.
Issue-ID: SDC-3230
Signed-off-by: xuegao <xg353y@intl.att.com>
Change-Id: I250e2f928aa33b2da86a7c458c098713c43a5074
5 files changed, 41 insertions, 4 deletions
diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/InterfaceOperationBusinessLogic.java b/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/InterfaceOperationBusinessLogic.java index 7bbe24d8e8..3aabe82db5 100644 --- a/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/InterfaceOperationBusinessLogic.java +++ b/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/InterfaceOperationBusinessLogic.java @@ -526,26 +526,27 @@ public class InterfaceOperationBusinessLogic extends BaseBusinessLogic { private void addOperationToInterface(InterfaceDefinition interfaceDefinition, Operation interfaceOperation) { interfaceOperation.setUniqueId(UUID.randomUUID().toString()); - interfaceOperation.setImplementation(createArtifactDefinition(UUID.randomUUID().toString(), interfaceOperation.getName())); + interfaceOperation.setImplementation(createArtifactDefinition(UUID.randomUUID().toString(), interfaceOperation)); interfaceDefinition.getOperations() .put(interfaceOperation.getUniqueId(), new OperationDataDefinition(interfaceOperation)); } private void updateOperationOnInterface(InterfaceDefinition interfaceDefinition, Operation interfaceOperation, String artifactUuId) { - interfaceOperation.setImplementation(createArtifactDefinition(artifactUuId, interfaceOperation.getName())); + interfaceOperation.setImplementation(createArtifactDefinition(artifactUuId, interfaceOperation)); interfaceDefinition.getOperations() .put(interfaceOperation.getUniqueId(), new OperationDataDefinition(interfaceOperation)); } - private ArtifactDefinition createArtifactDefinition(String artifactUuId, String operationName) { + private ArtifactDefinition createArtifactDefinition(String artifactUuId, Operation operation) { ArtifactDefinition artifactDefinition = new ArtifactDefinition(); artifactDefinition.setArtifactUUID(artifactUuId); artifactDefinition.setUniqueId(artifactUuId); artifactDefinition.setEsId(artifactUuId); artifactDefinition.setArtifactType(ArtifactTypeEnum.WORKFLOW.getType()); artifactDefinition.setArtifactGroupType(ArtifactGroupTypeEnum.DEPLOYMENT); - artifactDefinition.setArtifactLabel(operationName + ".workflowArtifact"); + artifactDefinition.setArtifactLabel(operation.getName() + ".workflowArtifact"); + artifactDefinition.setArtifactName(operation.getWorkflowName() + "_" + operation.getWorkflowVersion()); return artifactDefinition; } diff --git a/catalog-ui/src/app/models/operation.ts b/catalog-ui/src/app/models/operation.ts index 30095b92ef..3d4917fd45 100644 --- a/catalog-ui/src/app/models/operation.ts +++ b/catalog-ui/src/app/models/operation.ts @@ -42,6 +42,8 @@ export class BEOperationModel { workflowAssociationType: string; workflowId: string; workflowVersionId: string; + workflowName: string; + workflowVersion: string; implementation?: { artifactName: string; @@ -60,6 +62,8 @@ export class BEOperationModel { this.workflowAssociationType = operation.workflowAssociationType; this.workflowId = operation.workflowId; this.workflowVersionId = operation.workflowVersionId; + this.workflowName = operation.workflowName; + this.workflowVersion = operation.workflowVersion; this.implementation = operation.implementation || {}; } } @@ -94,6 +98,8 @@ export class OperationModel extends BEOperationModel{ workflowId: string; workflowVersionId: string; + workflowName: string; + workflowVersion: string; protected OperationTypeEnum: Array<String> = [ 'Create', @@ -117,6 +123,8 @@ export class OperationModel extends BEOperationModel{ this.workflowVersionId = operation.workflowVersionId; this.artifactFileName = operation.artifactFileName; this.artifactData = operation.artifactData; + this.workflowName = operation.workflowName; + this.workflowVersion = operation.workflowVersion; } } diff --git a/catalog-ui/src/app/ng2/pages/interface-operation/operation-creator/operation-creator.component.ts b/catalog-ui/src/app/ng2/pages/interface-operation/operation-creator/operation-creator.component.ts index 23b678177f..1e217f10d4 100644 --- a/catalog-ui/src/app/ng2/pages/interface-operation/operation-creator/operation-creator.component.ts +++ b/catalog-ui/src/app/ng2/pages/interface-operation/operation-creator/operation-creator.component.ts @@ -339,6 +339,11 @@ export class OperationCreatorComponent implements OperationCreatorInput { this.assignInputParameters[this.operation.workflowId] = {}; this.assignOutputParameters[this.operation.workflowId] = {}; } + this.operation.workflowName = workflowId.label; + if (!this.assignInputParameters[this.operation.workflowName]) { + this.assignInputParameters[this.operation.workflowName] = {}; + this.assignOutputParameters[this.operation.workflowName] = {}; + } this.isLoading = true; this.validityChanged(); @@ -366,6 +371,7 @@ export class OperationCreatorComponent implements OperationCreatorInput { ); if (!selectedVersionId && this.workflowVersions.length) { this.operation.workflowVersionId = _.last(this.workflowVersions).value; + this.operation.workflowVersion = _.last(this.workflowVersions).label; } this.changeWorkflowVersion(new DropDownOption(this.operation.workflowVersionId)); diff --git a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/OperationDataDefinition.java b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/OperationDataDefinition.java index 4c14551c1b..f93e41cf51 100644 --- a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/OperationDataDefinition.java +++ b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/OperationDataDefinition.java @@ -28,6 +28,8 @@ import java.io.Serializable; import static org.openecomp.sdc.be.datatypes.enums.JsonPresentationFields.IO_WORKFLOW_ASSOCIATION_TYPE; import static org.openecomp.sdc.be.datatypes.enums.JsonPresentationFields.IO_WORKFLOW_ID; +import static org.openecomp.sdc.be.datatypes.enums.JsonPresentationFields.IO_WORKFLOW_NAME; +import static org.openecomp.sdc.be.datatypes.enums.JsonPresentationFields.IO_WORKFLOW_VERSION; import static org.openecomp.sdc.be.datatypes.enums.JsonPresentationFields.IO_WORKFLOW_VERSION_ID; public class OperationDataDefinition extends ToscaDataDefinition implements Serializable { @@ -53,6 +55,8 @@ public class OperationDataDefinition extends ToscaDataDefinition implements Seri setWorkflowId(p.getWorkflowId()); setWorkflowVersionId(p.getWorkflowVersionId()); setWorkflowAssociationType(p.getWorkflowAssociationType()); + setWorkflowName(p.getWorkflowName()); + setWorkflowVersion(p.getWorkflowVersion()); } public String getDescription() { @@ -109,6 +113,14 @@ public class OperationDataDefinition extends ToscaDataDefinition implements Seri setToscaPresentationValue(IO_WORKFLOW_ID, workflowId); } + public String getWorkflowName() { + return (String) getToscaPresentationValue(IO_WORKFLOW_NAME); + } + + public void setWorkflowName(String workflowName) { + setToscaPresentationValue(IO_WORKFLOW_NAME, workflowName); + } + public String getWorkflowVersionId() { return (String) getToscaPresentationValue(IO_WORKFLOW_VERSION_ID); } @@ -117,6 +129,14 @@ public class OperationDataDefinition extends ToscaDataDefinition implements Seri setToscaPresentationValue(IO_WORKFLOW_VERSION_ID, workflowVersionId); } + public String getWorkflowVersion() { + return (String) getToscaPresentationValue(IO_WORKFLOW_VERSION); + } + + public void setWorkflowVersion(String workflowVersion) { + setToscaPresentationValue(IO_WORKFLOW_VERSION, workflowVersion); + } + public String getWorkflowAssociationType() { return (String) getToscaPresentationValue(IO_WORKFLOW_ASSOCIATION_TYPE); } diff --git a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/enums/JsonPresentationFields.java b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/enums/JsonPresentationFields.java index 58baeb549c..46a3f99abc 100644 --- a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/enums/JsonPresentationFields.java +++ b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/enums/JsonPresentationFields.java @@ -234,6 +234,8 @@ public enum JsonPresentationFields { IO_MANDATORY("mandatory", null), IO_TYPE("type", null), IO_PROPERTY("property", null), + IO_WORKFLOW_NAME("workflowName", null), + IO_WORKFLOW_VERSION("workflowVersion", null), IO_WORKFLOW_ID("workflowId", null), IO_WORKFLOW_VERSION_ID("workflowVersionId", null), IO_WORKFLOW_ASSOCIATION_TYPE("workflowAssociationType", null), |