aboutsummaryrefslogtreecommitdiffstats
path: root/bpmn/MSOCommonBPMN/src/main/groovy/org/openecomp/mso/bpmn/common/scripts/AbstractServiceTaskProcessor.groovy
diff options
context:
space:
mode:
Diffstat (limited to 'bpmn/MSOCommonBPMN/src/main/groovy/org/openecomp/mso/bpmn/common/scripts/AbstractServiceTaskProcessor.groovy')
-rw-r--r--bpmn/MSOCommonBPMN/src/main/groovy/org/openecomp/mso/bpmn/common/scripts/AbstractServiceTaskProcessor.groovy30
1 files changed, 30 insertions, 0 deletions
diff --git a/bpmn/MSOCommonBPMN/src/main/groovy/org/openecomp/mso/bpmn/common/scripts/AbstractServiceTaskProcessor.groovy b/bpmn/MSOCommonBPMN/src/main/groovy/org/openecomp/mso/bpmn/common/scripts/AbstractServiceTaskProcessor.groovy
index d7aa979..e86f77c 100644
--- a/bpmn/MSOCommonBPMN/src/main/groovy/org/openecomp/mso/bpmn/common/scripts/AbstractServiceTaskProcessor.groovy
+++ b/bpmn/MSOCommonBPMN/src/main/groovy/org/openecomp/mso/bpmn/common/scripts/AbstractServiceTaskProcessor.groovy
@@ -697,6 +697,10 @@ 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 messageType the message type (e.g. SDNCAResponse or VNFAResponse)
* @param correlator the correlator value (e.g. a request ID)
*/
@@ -717,4 +721,30 @@ public abstract class AbstractServiceTaskProcessor implements ServiceTaskProcess
'/' + 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
+ * to call it back through the Workflow Message Adapter.
+ * @param messageType the message type (e.g. SNIROResponse)
+ * @param correlator the correlator value (e.g. a request ID)
+ */
+ public String createWorkflowMessageAdapterCallbackURL(Execution execution, String messageType, String correlator) {
+ String endpoint = (String) execution.getVariable('URN_mso_adapters_workflow_message_endpoint')
+
+ if (endpoint == null || endpoint.isEmpty()) {
+ ExceptionUtil exceptionUtil = new ExceptionUtil()
+ exceptionUtil.buildAndThrowWorkflowException(execution, 2000,
+ 'mso:adapters:workflow:message:endpoint URN mapping is not set')
+ }
+
+ while (endpoint.endsWith('/')) {
+ endpoint = endpoint.substring(0, endpoint.length()-1)
+ }
+
+ return endpoint +
+ '/' + UriUtils.encodePathSegment(messageType, 'UTF-8') +
+ '/' + UriUtils.encodePathSegment(correlator, 'UTF-8')
+ }
} \ No newline at end of file