From a8480d1fec5b5696be04eb887f4cbed6b56238be Mon Sep 17 00:00:00 2001 From: mojahidi Date: Thu, 19 Jul 2018 12:35:31 +0530 Subject: Add support for workflowId and workflowVersionId Enhance operation data model and APIs to support workflowId and workflowVersionId Change-Id: Ib8772027a3e0147ae0bb59811a9b31fe46975ac6 Issue-ID: SDC-1535 Signed-off-by: mojahidi --- .../elements/InterfaceOperationDataDefinition.java | 26 +++++++++++++++++++++- .../elements/OperationDataDefinition.java | 20 +++++++++++++++++ .../be/datatypes/enums/JsonPresentationFields.java | 1 + 3 files changed, 46 insertions(+), 1 deletion(-) (limited to 'common-be/src/main/java/org/openecomp') diff --git a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/InterfaceOperationDataDefinition.java b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/InterfaceOperationDataDefinition.java index 4607364f53..bbc3164f50 100644 --- a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/InterfaceOperationDataDefinition.java +++ b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/InterfaceOperationDataDefinition.java @@ -22,7 +22,15 @@ import org.openecomp.sdc.be.datatypes.tosca.ToscaDataDefinition; import java.io.Serializable; -import static org.openecomp.sdc.be.datatypes.enums.JsonPresentationFields.*; +import static org.openecomp.sdc.be.datatypes.enums.JsonPresentationFields.ARTIFACT_UUID; +import static org.openecomp.sdc.be.datatypes.enums.JsonPresentationFields.DESCRIPTION; +import static org.openecomp.sdc.be.datatypes.enums.JsonPresentationFields.IO_INPUT_PARAMETERS; +import static org.openecomp.sdc.be.datatypes.enums.JsonPresentationFields.IO_OPERATION_TYPE; +import static org.openecomp.sdc.be.datatypes.enums.JsonPresentationFields.IO_OUTPUT_PARAMETERS; +import static org.openecomp.sdc.be.datatypes.enums.JsonPresentationFields.IO_WORKFLOW_ID; +import static org.openecomp.sdc.be.datatypes.enums.JsonPresentationFields.IO_WORKFLOW_VERSION_ID; +import static org.openecomp.sdc.be.datatypes.enums.JsonPresentationFields.TOSCA_RESOURCE_NAME; +import static org.openecomp.sdc.be.datatypes.enums.JsonPresentationFields.UNIQUE_ID; public class InterfaceOperationDataDefinition extends ToscaDataDefinition implements Serializable { @@ -40,6 +48,8 @@ public class InterfaceOperationDataDefinition extends ToscaDataDefinition implem setToscaResourceName(iodd.getToscaResourceName()); setOperationType(iodd.getOperationType()); setArtifactUUID(iodd.getArtifactUUID()); + setWorkflowId(iodd.getWorkflowId()); + setWorkflowVersionId(iodd.getWorkflowVersionId()); } public ListDataDefinition getInputParams() { @@ -88,6 +98,20 @@ public class InterfaceOperationDataDefinition extends ToscaDataDefinition implem setToscaPresentationValue(TOSCA_RESOURCE_NAME, toscaResourceName); } + public String getWorkflowId(){ + return (String) getToscaPresentationValue(IO_WORKFLOW_ID); + } + public void setWorkflowId(String workflowId) { + setToscaPresentationValue(IO_WORKFLOW_ID, workflowId); + } + + public String getWorkflowVersionId() { + return (String) getToscaPresentationValue(IO_WORKFLOW_VERSION_ID); + } + public void setWorkflowVersionId(String workflowVersionId) { + setToscaPresentationValue(IO_WORKFLOW_VERSION_ID, workflowVersionId); + } + public String getArtifactUUID() { return (String) getToscaPresentationValue(ARTIFACT_UUID); } 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 5363cbbb2a..49c8ba24a5 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 @@ -26,6 +26,9 @@ import org.openecomp.sdc.be.datatypes.tosca.ToscaDataDefinition; import java.io.Serializable; +import static org.openecomp.sdc.be.datatypes.enums.JsonPresentationFields.IO_WORKFLOW_ID; +import static org.openecomp.sdc.be.datatypes.enums.JsonPresentationFields.IO_WORKFLOW_VERSION_ID; + public class OperationDataDefinition extends ToscaDataDefinition implements Serializable { @@ -46,6 +49,8 @@ public class OperationDataDefinition extends ToscaDataDefinition implements Seri setOutputs(p.getOutputs()); setName(p.getName()); setUniqueId(p.getUniqueId()); + setWorkflowId(p.getWorkflowId()); + setWorkflowVersionId(p.getWorkflowVersionId()); } @@ -114,4 +119,19 @@ public class OperationDataDefinition extends ToscaDataDefinition implements Seri public void setName(String name) { setToscaPresentationValue(JsonPresentationFields.NAME, name); } + + public String getWorkflowId(){ + return (String) getToscaPresentationValue(IO_WORKFLOW_ID); + } + public void setWorkflowId(String workflowId) { + setToscaPresentationValue(IO_WORKFLOW_ID, workflowId); + } + + public String getWorkflowVersionId() { + return (String) getToscaPresentationValue(IO_WORKFLOW_VERSION_ID); + } + public void setWorkflowVersionId(String workflowVersionId) { + setToscaPresentationValue(IO_WORKFLOW_VERSION_ID, workflowVersionId); + } + } 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 98b91c1628..912e3d94b1 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 @@ -221,6 +221,7 @@ public enum JsonPresentationFields { IO_PARAM_NAME("paramName", null), IO_PARAM_ID("paramId", null), IO_WORKFLOW_ID("workflowId", null), + IO_WORKFLOW_VERSION_ID("workflowVersionId", null), //Interface INTERFACE ("interface", null), -- cgit 1.2.3-korg