summaryrefslogtreecommitdiffstats
path: root/bpmn/so-bpmn-tasks
diff options
context:
space:
mode:
authorLukasz Muszkieta <lukasz.muszkieta@nokia.com>2020-06-18 10:25:42 +0000
committerGerrit Code Review <gerrit@onap.org>2020-06-18 10:25:42 +0000
commitb60a09ddf1e6f42539ca58d0376196b9642d5cff (patch)
treedf25d87bf2e66dffa4fb984c8f7064eb2bc896da /bpmn/so-bpmn-tasks
parent16045be8d6fa7c6b55d3d9dd216e72d22add0d61 (diff)
parent07f92dace9984821f162aacd3f92770c41ad1187 (diff)
Merge "WorkflowAction refactoring"
Diffstat (limited to 'bpmn/so-bpmn-tasks')
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowAction.java24
1 files changed, 14 insertions, 10 deletions
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowAction.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowAction.java
index fe45e1385e..ac33d7ad08 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowAction.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowAction.java
@@ -213,17 +213,8 @@ public class WorkflowAction {
orchFlows = queryNorthBoundRequestCatalogDb(execution, requestAction, resourceType, true,
cloudOwner, serviceType);
}
- String key = "";
- ModelInfo modelInfo = sIRequest.getRequestDetails().getModelInfo();
- if (modelInfo != null) {
- if (modelInfo.getModelType().equals(ModelType.service)) {
- key = modelInfo.getModelVersionId();
- } else {
- key = modelInfo.getModelCustomizationId();
- }
- }
+ Resource resourceKey = getResourceKey(sIRequest, resourceType);
boolean isConfiguration = isConfiguration(orchFlows);
- Resource resourceKey = new Resource(resourceType, key, true);
if (isConfiguration && !requestAction.equalsIgnoreCase(CREATEINSTANCE)) {
List<ExecuteBuildingBlock> configBuildingBlocks = getConfigBuildingBlocks(
new ConfigBuildingBlocksDataObject().setsIRequest(sIRequest).setOrchFlows(orchFlows)
@@ -408,6 +399,19 @@ public class WorkflowAction {
}
}
+ private Resource getResourceKey(ServiceInstancesRequest sIRequest, WorkflowType resourceType) {
+ String resourceId = "";
+ ModelInfo modelInfo = sIRequest.getRequestDetails().getModelInfo();
+ if (modelInfo != null) {
+ if (modelInfo.getModelType().equals(ModelType.service)) {
+ resourceId = modelInfo.getModelVersionId();
+ } else {
+ resourceId = modelInfo.getModelCustomizationId();
+ }
+ }
+ return new Resource(resourceType, resourceId, true);
+ }
+
private String getCloudOwner(CloudConfiguration cloudConfiguration) {
if (cloudConfiguration != null && cloudConfiguration.getCloudOwner() != null) {
return cloudConfiguration.getCloudOwner();