aboutsummaryrefslogtreecommitdiffstats
path: root/ms/blueprintsprocessor/modules/services/execution-service/src/main/kotlin/org/onap
diff options
context:
space:
mode:
authorSingal, Kapil (ks220y) <ks220y@att.com>2019-09-24 15:10:41 -0400
committerSingal, Kapil (ks220y) <ks220y@att.com>2019-09-24 15:10:41 -0400
commit054b1d80f19d27fb8766bf70339ec5b7a351ac2e (patch)
treebb3c51a1abe05d3e4dc5c9da3df9d3164afb1019 /ms/blueprintsprocessor/modules/services/execution-service/src/main/kotlin/org/onap
parente0e2aa06217ea5299e720e97f4275197551b3e68 (diff)
AbstractComponentFunction Payload API
Adding new API's in AbstractComponentFunction to pull payload Issue-ID: CCSDK-1752 Signed-off-by: Singal, Kapil (ks220y) <ks220y@att.com> Change-Id: I6db5ea12d24765d3775c6c81d7cbbefcd1708ca1
Diffstat (limited to 'ms/blueprintsprocessor/modules/services/execution-service/src/main/kotlin/org/onap')
-rw-r--r--ms/blueprintsprocessor/modules/services/execution-service/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/execution/AbstractComponentFunction.kt20
1 files changed, 20 insertions, 0 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)
}