diff --git a/src/plugins/ExecuteJob/ExecuteJob.js b/src/plugins/ExecuteJob/ExecuteJob.js index ce1ddc3dd..7048ef4a6 100644 --- a/src/plugins/ExecuteJob/ExecuteJob.js +++ b/src/plugins/ExecuteJob/ExecuteJob.js @@ -662,22 +662,20 @@ define([ .catch(err => this.logger.error(`Could not get op info for ${JSON.stringify(opId)}: ${err}`)); }; - ExecuteJob.prototype.onDistOperationComplete = function (node, result) { + ExecuteJob.prototype.onDistOperationComplete = async function (node, result) { const opName = this.getAttribute(node, 'name'); + const resultTypes = await this.getResultTypes(result); let nodeId = this.core.getPath(node), outputMap = {}, - resultTypes, outputs; + // Match the output names to the actual nodes // Create an array of [name, node] // For now, just match by type. Later we may use ports for input/outputs // Store the results in the outgoing ports - return this.getResultTypes(result) - .then(types => { - resultTypes = types; - return this.getOutputs(node); - }) + + return this.getOutputs(node) .then(outputPorts => { outputs = outputPorts.map(tuple => [tuple[0], tuple[2]]); outputs.forEach(output => outputMap[output[0]] = output[1]); @@ -716,8 +714,9 @@ define([ }; ExecuteJob.prototype.getResultTypes = async function (result) { - const artifactHash = result.resultHashes['result-types']; - return await this.getContentHashSafe(artifactHash, 'result-types.json', ERROR.NO_TYPES_FILE); + const mdHash = result.resultHashes['result-types']; + const hash = await this.getContentHashSafe(mdHash, 'result-types.json', ERROR.NO_TYPES_FILE); + return await this.blobClient.getObjectAsJSON(hash); }; ExecuteJob.prototype.getContentHashSafe = async function (artifactHash, fileName, msg) {