summaryrefslogtreecommitdiffstats
path: root/ms/blueprintsprocessor/modules/services/execution-service
diff options
context:
space:
mode:
authorSingal, Kapil (ks220y) <ks220y@att.com>2019-09-23 16:11:17 -0400
committerKAPIL SINGAL <ks220y@att.com>2019-09-29 03:12:56 +0000
commit7a04ac414b690983d863e96b487e314780572c48 (patch)
tree7df2d84fd1c28f96416c620ee82207be7d0b2945 /ms/blueprintsprocessor/modules/services/execution-service
parentf2dde8ba531cd4783fbc0872c406ec6e0d097c54 (diff)
Refactoring ResourceAssignmentUtils
Refactoring ResourceAssignmentUtils parseResponseNodeForPrimitiveTypes API to remove cyclic value assignments Issue-ID: CCSDK-1748 Signed-off-by: Singal, Kapil (ks220y) <ks220y@att.com> Change-Id: I27b5a7d3ed2df38cf4e3e44686aec094ebdb5f25 Refactoring ResourceAssignmentUtils Changing isNull condition to isNullOrEmpty to make sure Empty value doesn't get assigned to resource Issue-ID: CCSDK-1748 Signed-off-by: Singal, Kapil (ks220y) <ks220y@att.com> Change-Id: I0744537c7ddec80f20ffd7e6545b947439f63743 Resource Resolution Refactoring Refactoring some logging statements and adding new loggers Issue-ID: CCSDK-1748 Signed-off-by: Singal, Kapil (ks220y) <ks220y@att.com> Change-Id: I5676659eea01056a7d29206f13473a4361516755
Diffstat (limited to 'ms/blueprintsprocessor/modules/services/execution-service')
-rw-r--r--ms/blueprintsprocessor/modules/services/execution-service/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/execution/AbstractComponentFunction.kt20
-rw-r--r--ms/blueprintsprocessor/modules/services/execution-service/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/execution/scripts/AbstractComponentFunctionTest.kt7
2 files changed, 21 insertions, 6 deletions
diff --git a/ms/blueprintsprocessor/modules/services/execution-service/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/execution/AbstractComponentFunction.kt b/ms/blueprintsprocessor/modules/services/execution-service/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/execution/AbstractComponentFunction.kt
index 8759338b7..5163a93ac 100644
--- a/ms/blueprintsprocessor/modules/services/execution-service/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/execution/AbstractComponentFunction.kt
+++ b/ms/blueprintsprocessor/modules/services/execution-service/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/execution/AbstractComponentFunction.kt
@@ -154,6 +154,26 @@ abstract class AbstractComponentFunction : BlueprintFunctionNode<ExecutionServic
bluePrintRuntimeService.getBluePrintError().addError(error)
}
+ /**
+ * Get Execution Input Payload data
+ */
+ fun requestPayload(): JsonNode? {
+ return executionServiceInput.payload
+ }
+
+ /**
+ * Get Execution Input payload action property with [expression]
+ * ex: requestPayloadActionProperty("data") will look for path "payload/<action-name>-request/data"
+ */
+ fun requestPayloadActionProperty(expression: String?): JsonNode? {
+ val requestExpression = if (expression.isNullOrBlank()) {
+ "$operationName-request"
+ } else {
+ "$operationName-request.$expression"
+ }
+ return executionServiceInput.payload.jsonPathParse(".$requestExpression")
+ }
+
fun artifactContent(artifactName: String): String {
return bluePrintRuntimeService.resolveNodeTemplateArtifact(nodeTemplateName, artifactName)
}
diff --git a/ms/blueprintsprocessor/modules/services/execution-service/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/execution/scripts/AbstractComponentFunctionTest.kt b/ms/blueprintsprocessor/modules/services/execution-service/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/execution/scripts/AbstractComponentFunctionTest.kt
index 07be8c809..24696b456 100644
--- a/ms/blueprintsprocessor/modules/services/execution-service/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/execution/scripts/AbstractComponentFunctionTest.kt
+++ b/ms/blueprintsprocessor/modules/services/execution-service/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/execution/scripts/AbstractComponentFunctionTest.kt
@@ -70,9 +70,6 @@ class AbstractComponentFunctionTest {
every { blueprintContext.rootPath } returns normalizedPathName("target")
}
- /**
- * Tests the abstract component functionality.
- */
@Test
fun testAbstractComponent() {
runBlocking {
@@ -95,9 +92,6 @@ class AbstractComponentFunctionTest {
}
}
- /**
- * Tests the abstract script component functionality.
- */
@Test
fun testAbstractScriptComponent() {
runBlocking {
@@ -190,5 +184,6 @@ class AbstractComponentFunctionTest {
val componentScriptExecutor = BluePrintTypes.nodeTypeComponentScriptExecutor()
assertNotNull(componentScriptExecutor.interfaces, "failed to get interface operations")
}
+
}