summaryrefslogtreecommitdiffstats
path: root/bpmn
diff options
context:
space:
mode:
authorMarcus G K Williams <marcus.williams@intel.com>2018-10-16 14:46:51 -0700
committerMarcus G K Williams <marcus.williams@intel.com>2018-10-16 14:51:09 -0700
commit5a78422efe74be8fc786f7b86e61c46994703969 (patch)
tree1e3204b2300d0eb4351bf47b066fe9dd10599df0 /bpmn
parentd6c21ac6f38474841d3b9ced0524fe7671ae8682 (diff)
Fix OOF Config Ingestion
Update Homing OOF Config Path Issue-ID: SO-1127 Change-Id: I10ba6dcf23d474ba5e9832a6f4f35e52ead020b5 Signed-off-by: Marcus G K Williams <marcus.williams@intel.com>
Diffstat (limited to 'bpmn')
-rw-r--r--bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/AbstractServiceTaskProcessor.groovy26
-rw-r--r--bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/OofHoming.groovy4
-rw-r--r--bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/OofUtils.groovy4
3 files changed, 30 insertions, 4 deletions
diff --git a/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/AbstractServiceTaskProcessor.groovy b/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/AbstractServiceTaskProcessor.groovy
index 9e71313e09..00bd8e9ef8 100644
--- a/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/AbstractServiceTaskProcessor.groovy
+++ b/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/AbstractServiceTaskProcessor.groovy
@@ -694,6 +694,32 @@ public abstract class AbstractServiceTaskProcessor implements ServiceTaskProcess
}
/**
+ * Constructs a workflow message callback URL for the specified message type and correlator.
+ * This type of callback URL is used when a workflow wants an MSO adapter (like the SDNC
+ * adapter) to call it back. In other words, this is for callbacks internal to the MSO
+ * complex. Use <code>createWorkflowMessageAdapterCallbackURL</code> if the callback
+ * will come from outside the MSO complex.
+ * @param endpoint endpoint address to contruct URL from
+ * @param messageType the message type (e.g. SDNCAResponse or VNFAResponse)
+ * @param correlator the correlator value (e.g. a request ID)
+ */
+ public String createCallbackURL(String endpoint, String messageType, String correlator) {
+ if (endpoint == null || endpoint.isEmpty()) {
+ ExceptionUtil exceptionUtil = new ExceptionUtil()
+ exceptionUtil.buildAndThrowWorkflowException(execution, 2000,
+ 'mso:workflow:message:endpoint was not passed in')
+ }
+
+ while (endpoint.endsWith('/')) {
+ endpoint = endpoint.substring(0, endpoint.length()-1)
+ }
+
+ return endpoint +
+ '/' + UriUtils.encodePathSegment(messageType, 'UTF-8') +
+ '/' + UriUtils.encodePathSegment(correlator, 'UTF-8')
+ }
+
+ /**
*
* Constructs a workflow message callback URL for the specified message type and correlator.
* This type of callback URL is used when a workflow wants a system outside the MSO complex
diff --git a/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/OofHoming.groovy b/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/OofHoming.groovy
index 7028f6eeed..aa0d8ace6a 100644
--- a/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/OofHoming.groovy
+++ b/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/OofHoming.groovy
@@ -152,9 +152,7 @@ class OofHoming extends AbstractServiceTaskProcessor {
execution.setVariable("oofRequest", oofRequest)
utils.log("DEBUG", "OOF Request is: " + oofRequest, isDebugEnabled)
- String endpoint = UrnPropertiesReader.getVariable("mso.oof.service.agnostic.endpoint", execution)
- String host = UrnPropertiesReader.getVariable("mso.oof.service.agnostic.host", execution)
- String url = host + endpoint
+ String url = UrnPropertiesReader.getVariable("mso.oof.endpoint", execution)
utils.log("DEBUG", "Posting to OOF Url: " + url, isDebugEnabled)
logDebug("URL to be used is: " + url, isDebugEnabled)
diff --git a/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/OofUtils.groovy b/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/OofUtils.groovy
index d95795906f..b1da7cf49b 100644
--- a/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/OofUtils.groovy
+++ b/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/OofUtils.groovy
@@ -87,7 +87,9 @@ class OofUtils {
ArrayList requiredCandidates = null) {
def isDebugEnabled = execution.getVariable("isDebugLogEnabled")
utils.log("DEBUG", "Started Building OOF Request", isDebugEnabled)
- def callbackUrl = utils.createWorkflowMessageAdapterCallbackURL(execution, "oofResponse", requestId)
+ String callbackEndpoint = UrnPropertiesReader.getVariable("mso.oof.callbackEndpoint", execution)
+ utils.log("DEBUG", "mso.oof.callbackEndpoint is: " + callbackEndpoint, isDebugEnabled)
+ def callbackUrl = utils.createWorkflowMessageAdapterCallbackURL(callbackEndpoint, "oofResponse", requestId)
def transactionId = requestId
//ServiceInstance Info
ServiceInstance serviceInstance = decomposition.getServiceInstance()