ensureConnectorInitialized();
ConnectorRequest<? extends ConnectorResponse> request = connectorInstance.createRequest();
// create a variable scopes for the connector
ConnectorVariableScope connectorInputVariableScope = new ConnectorVariableScope((CoreVariableScope) execution);
ConnectorVariableScope connectorOuputVariableScope = new ConnectorVariableScope((CoreVariableScope) execution);
// TODO: make this non-optional?
if(ioMapping != null) {
// execute the connector input parameters
ioMapping.executeInputParameters(connectorInputVariableScope);
// write the local variables to the request.
connectorInputVariableScope.writeToRequest(request);
}
try {
// execute the request and obtain a response:
ConnectorResponse response = request.execute();
// TODO: make this non-optional?
if(ioMapping != null) {
// read parameters from response
connectorOuputVariableScope.readFromResponse(response);
// map variables to parent scope.
ioMapping.executeOutputParameters(connectorOuputVariableScope);
}