diff options
author | Ittay Stern <ittay.stern@att.com> | 2019-09-22 20:04:28 +0300 |
---|---|---|
committer | Ittay Stern <ittay.stern@att.com> | 2019-09-23 12:48:51 +0300 |
commit | 9a2cd4170c33326dc6a0829675fa4cef231efdd9 (patch) | |
tree | 06b2ec4c6d9722e1a1ebf52f60cd632f35f40ebb /vid-app-common/src/main/java | |
parent | 5a824bbfbe95afd3b1fbaae8c029a8b4c5ad5401 (diff) |
Change-management: provide and use scheduler's fields through vm.scheduleWorkflow()
In addition, show error message when no Portal-frame. Use the dumped
data to revive ChangeManagementTest tests by capturing the error's
payload.
Issue-ID: VID-397
Change-Id: I978bf537c43b0e3933e82c761c60cd067ab2cf27
Signed-off-by: Ittay Stern <ittay.stern@att.com>
Diffstat (limited to 'vid-app-common/src/main/java')
-rw-r--r-- | vid-app-common/src/main/java/org/onap/vid/model/SOWorkflows.kt | 1 | ||||
-rw-r--r-- | vid-app-common/src/main/java/org/onap/vid/services/LocalWorkflowsServiceImpl.java | 19 |
2 files changed, 14 insertions, 6 deletions
diff --git a/vid-app-common/src/main/java/org/onap/vid/model/SOWorkflows.kt b/vid-app-common/src/main/java/org/onap/vid/model/SOWorkflows.kt index ea13a76a2..0930c89aa 100644 --- a/vid-app-common/src/main/java/org/onap/vid/model/SOWorkflows.kt +++ b/vid-app-common/src/main/java/org/onap/vid/model/SOWorkflows.kt @@ -72,6 +72,7 @@ data class SOWorkflowParameterDefinitions constructor( data class LocalWorkflowParameterDefinition @JvmOverloads constructor( val id: Long, val name: String, + val displayName: String, val required: Boolean, val type: LocalWorkflowType, val pattern: String? = null, diff --git a/vid-app-common/src/main/java/org/onap/vid/services/LocalWorkflowsServiceImpl.java b/vid-app-common/src/main/java/org/onap/vid/services/LocalWorkflowsServiceImpl.java index 39d433d6a..71d577cd4 100644 --- a/vid-app-common/src/main/java/org/onap/vid/services/LocalWorkflowsServiceImpl.java +++ b/vid-app-common/src/main/java/org/onap/vid/services/LocalWorkflowsServiceImpl.java @@ -19,6 +19,8 @@ */ package org.onap.vid.services; +import static java.util.Collections.emptyList; + import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import java.util.Map; @@ -33,26 +35,31 @@ public class LocalWorkflowsServiceImpl implements LocalWorkflowsService { Map<String, LocalWorkflowParameterDefinitions> WORKFLOWS_WITH_PARAMETERS = ImmutableMap.<String, LocalWorkflowParameterDefinitions>builder() .put("VNF Scale Out", new LocalWorkflowParameterDefinitions( ImmutableList.of( - new LocalWorkflowParameterDefinition(1, "Configuration Parameters", true, LocalWorkflowType.text,".*") + new LocalWorkflowParameterDefinition(1, "configurationParameters", "Configuration Parameters", true, LocalWorkflowType.text,".*") ) )) .put("VNF In Place Software Update", new LocalWorkflowParameterDefinitions( ImmutableList.of( - new LocalWorkflowParameterDefinition(2, "Operations timeout",true, LocalWorkflowType.text,"[0-9]+"), - new LocalWorkflowParameterDefinition(3, "Existing software version", true, LocalWorkflowType.text, "[-a-zA-Z0-9.]+"), - new LocalWorkflowParameterDefinition(4, "New software version", true, LocalWorkflowType.text, "[-a-zA-Z0-9.]+") + new LocalWorkflowParameterDefinition(2, "operationTimeout", "Operations timeout", true, LocalWorkflowType.text,"[0-9]+"), + new LocalWorkflowParameterDefinition(3, "existingSoftwareVersion", "Existing software version", true, LocalWorkflowType.text, "[-a-zA-Z0-9.]+"), + new LocalWorkflowParameterDefinition(4, "newSoftwareVersion", "New software version", true, LocalWorkflowType.text, "[-a-zA-Z0-9.]+") ) )) .put("VNF Config Update", new LocalWorkflowParameterDefinitions( ImmutableList.of( - new LocalWorkflowParameterDefinition(5, "Attach configuration file", true, LocalWorkflowType.FILE, ".*", "Invalid file type. Please select a file with a CSV extension.", "Invalid file structure.", ".csv") + new LocalWorkflowParameterDefinition(5, "configUpdateFile", "Attach configuration file", true, LocalWorkflowType.FILE, ".*", "Invalid file type. Please select a file with a CSV extension.", "Invalid file structure.", ".csv") ) )) .build(); + + private LocalWorkflowParameterDefinitions defaultEmptyParams() { + return new LocalWorkflowParameterDefinitions(emptyList()); + } + @Override public LocalWorkflowParameterDefinitions getWorkflowParameterDefinitions(String workflowName) { - return WORKFLOWS_WITH_PARAMETERS.get(workflowName); + return WORKFLOWS_WITH_PARAMETERS.getOrDefault(workflowName, defaultEmptyParams()); } } |