summaryrefslogtreecommitdiffstats
path: root/bpmn/so-bpmn-tasks/src
diff options
context:
space:
mode:
authorMateusz Gołuchowski <mateusz.goluchowski@nokia.com>2020-06-14 11:27:27 +0200
committerMateusz Gołuchowski <mateusz.goluchowski@nokia.com>2020-06-17 14:30:29 +0200
commit07f92dace9984821f162aacd3f92770c41ad1187 (patch)
treec71d2ccd3f68e85c72a1ad99d4c29bd58a77b829 /bpmn/so-bpmn-tasks/src
parentac1fe27ad4d7301f886d1755ea9eb8d1cb10be74 (diff)
WorkflowAction refactoring
Refactoring of selectExecutionList method. Issue-ID: SO-1841 Change-Id: I375db2004867f1f634adac31d4d1af3635f5981c Signed-off-by: Mateusz Goluchowski <mateusz.goluchowski@nokia.com>
Diffstat (limited to 'bpmn/so-bpmn-tasks/src')
-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 b4eb97a187..58f7f4af2a 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)
@@ -409,6 +400,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();