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
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;
}
workflowAssociationType: string;
workflowId: string;
workflowVersionId: string;
+ workflowName: string;
+ workflowVersion: string;
implementation?: {
artifactName: string;
this.workflowAssociationType = operation.workflowAssociationType;
this.workflowId = operation.workflowId;
this.workflowVersionId = operation.workflowVersionId;
+ this.workflowName = operation.workflowName;
+ this.workflowVersion = operation.workflowVersion;
this.implementation = operation.implementation || {};
}
}
workflowId: string;
workflowVersionId: string;
+ workflowName: string;
+ workflowVersion: string;
protected OperationTypeEnum: Array<String> = [
'Create',
this.workflowVersionId = operation.workflowVersionId;
this.artifactFileName = operation.artifactFileName;
this.artifactData = operation.artifactData;
+ this.workflowName = operation.workflowName;
+ this.workflowVersion = operation.workflowVersion;
}
}
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();
);
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));
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 {
setWorkflowId(p.getWorkflowId());
setWorkflowVersionId(p.getWorkflowVersionId());
setWorkflowAssociationType(p.getWorkflowAssociationType());
+ setWorkflowName(p.getWorkflowName());
+ setWorkflowVersion(p.getWorkflowVersion());
}
public String getDescription() {
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);
}
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);
}
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),