From e8b15e46fea5dbb241ca13b7a726efae008b7003 Mon Sep 17 00:00:00 2001 From: Luis Fernando Molina Date: Mon, 11 Nov 2019 13:29:54 +0100 Subject: [PATCH] Process Output Implemented --- IndicatorBotProcessMainLoop.js | 84 ++++++++- ProcessOutput.js | 104 +++++++++++ Project.njsproj | 3 + Root.js | 7 + SensorBotProcessMainLoop.js | 83 ++++++++- StatusDependencies.js | 5 + StatusReport.js | 34 +--- TradingBotProcessMainLoop.js | 306 ++++++++++++++++++++++++++++++++- server.js | 2 +- 9 files changed, 592 insertions(+), 36 deletions(-) create mode 100644 ProcessOutput.js diff --git a/IndicatorBotProcessMainLoop.js b/IndicatorBotProcessMainLoop.js index 13ae6c05a..99bda771b 100644 --- a/IndicatorBotProcessMainLoop.js +++ b/IndicatorBotProcessMainLoop.js @@ -130,6 +130,7 @@ const DATA_DEPENDENCIES = require(ROOT_DIR + 'DataDependencies'); const DATA_SET = require(ROOT_DIR + 'DataSet'); const PROCESS_EXECUTION_EVENTS = require(ROOT_DIR + 'ProcessExecutionEvents'); + const PROCESS_OUTPUT = require(ROOT_DIR + 'ProcessOutput'); /* We define the datetime for the process that we are running now. This will be the official processing time for both the infraestructure and the bot. */ @@ -142,6 +143,7 @@ /* We will prepare first the infraestructure needed for the bot to run. There are 3 modules we need to sucessfullly initialize first. */ + let processOutput let processExecutionEvents let userBot; let processFramework; @@ -158,7 +160,7 @@ if (FULL_LOG === true) { logger.write(MODULE_NAME, "[INFO] run -> loop -> initializeProcessExecutionEvents -> Entering function."); } - processExecutionEvents = PROCESS_EXECUTION_EVENTS.newProcessExecutionEvents(bot, parentLogger) + processExecutionEvents = PROCESS_EXECUTION_EVENTS.newProcessExecutionEvents(bot, logger) processExecutionEvents.initialize(pMonth, pYear, onInizialized); @@ -598,7 +600,7 @@ switch (err.result) { case global.DEFAULT_OK_RESPONSE.result: { logger.write(MODULE_NAME, "[INFO] run -> loop -> startUserBot -> onFinished -> Execution finished well."); - finishProcessExecutionEvents() + raiseEventsProcessOutput() return; } case global.DEFAULT_RETRY_RESPONSE.result: { // Something bad happened, but if we retry in a while it might go through the next time. @@ -830,7 +832,7 @@ switch (err.result) { case global.DEFAULT_OK_RESPONSE.result: { logger.write(MODULE_NAME, "[INFO] run -> loop -> startProcessFramework -> onFinished -> Execution finished well."); - finishProcessExecutionEvents() + raiseEventsProcessOutput() return; } case global.DEFAULT_RETRY_RESPONSE.result: { // Something bad happened, but if we retry in a while it might go through the next time. @@ -943,6 +945,81 @@ } } + function raiseEventsProcessOutput() { + + try { + + if (FULL_LOG === true) { logger.write(MODULE_NAME, "[INFO] run -> loop -> raiseEventsProcessOutput -> Entering function."); } + + processOutput = PROCESS_OUTPUT.newProcessOutput(bot, logger) + + processOutput.raiseEvents(statusDependencies, onFinished); + + function onFinished(err) { + + try { + + if (FULL_LOG === true) { logger.write(MODULE_NAME, "[INFO] run -> loop -> raiseEventsProcessOutput -> onFinished -> Entering function."); } + + switch (err.result) { + case global.DEFAULT_OK_RESPONSE.result: { + logger.write(MODULE_NAME, "[INFO] run -> loop -> raiseEventsProcessOutput -> onFinished -> Execution finished well."); + finishProcessExecutionEvents() + return; + } + case global.DEFAULT_RETRY_RESPONSE.result: { // Something bad happened, but if we retry in a while it might go through the next time. + logger.write(MODULE_NAME, "[WARN] run -> loop -> raiseEventsProcessOutput -> onFinished -> Retry Later. Requesting Execution Retry."); + nextWaitTime = 'Retry'; + loopControl(nextWaitTime); + return; + } + case global.DEFAULT_FAIL_RESPONSE.result: { // This is an unexpected exception that we do not know how to handle. + processStopped() + logger.write(MODULE_NAME, "[ERROR] run -> loop -> raiseEventsProcessOutput -> onFinished -> Operation Failed. Aborting the process."); + logger.persist(); + clearInterval(fixedTimeLoopIntervalHandle); + clearTimeout(nextLoopTimeoutHandle); + clearTimeout(checkLoopHealthHandle); + bot.enableCheckLoopHealth = false; + callBackFunction(err); + return; + } + default: { + logger.write(MODULE_NAME, "[ERROR] run -> loop -> raiseEventsProcessOutput -> onFinished -> Unhandled err.result received. -> err.result = " + err.result); + logger.write(MODULE_NAME, "[ERROR] run -> loop -> raiseEventsProcessOutput -> onFinished -> Unhandled err.result received. -> err = " + err.message); + + logger.persist(); + clearInterval(fixedTimeLoopIntervalHandle); + clearTimeout(nextLoopTimeoutHandle); + clearTimeout(checkLoopHealthHandle); + bot.enableCheckLoopHealth = false; + callBackFunction(global.DEFAULT_FAIL_RESPONSE); + return; + } + } + + } catch (err) { + logger.write(MODULE_NAME, "[ERROR] run -> loop -> raiseEventsProcessOutput -> onFinished -> err = " + err.stack); + logger.persist(); + clearInterval(fixedTimeLoopIntervalHandle); + clearTimeout(nextLoopTimeoutHandle); + clearTimeout(checkLoopHealthHandle); + bot.enableCheckLoopHealth = false; + callBackFunction(err); + } + } + + } catch (err) { + logger.write(MODULE_NAME, "[ERROR] run -> loop -> raiseEventsProcessOutput -> err = " + err.stack); + logger.persist(); + clearInterval(fixedTimeLoopIntervalHandle); + clearTimeout(nextLoopTimeoutHandle); + clearTimeout(checkLoopHealthHandle); + bot.enableCheckLoopHealth = false; + callBackFunction(err); + } + } + function finishProcessExecutionEvents() { try { @@ -1017,7 +1094,6 @@ } } - function loopControl(nextWaitTime) { if (FULL_LOG === true) { logger.write(MODULE_NAME, "[INFO] run -> loop -> loopControl -> Entering function."); } diff --git a/ProcessOutput.js b/ProcessOutput.js new file mode 100644 index 000000000..ef74e7305 --- /dev/null +++ b/ProcessOutput.js @@ -0,0 +1,104 @@ +exports.newProcessOutput = function newProcessOutput(BOT, logger) { + + /* + Here we emit the events that signals that a Dataset was updated. + */ + + const MODULE_NAME = "Process Output"; + + let bot = BOT; + + let thisObject = { + raiseEvents, raiseEvents + }; + + return thisObject; + + function raiseEvents(statusDependencies, callBackFunction) { + + try { + if (global.LOG_CONTROL[MODULE_NAME].logInfo === true) { logger.write(MODULE_NAME, "[INFO] raiseEvents -> Entering function."); } + + /* We will reaise the events for the datasets impacted by the process that just finished. */ + + if (bot.processNode.referenceParent.processOutput !== undefined) { + if (bot.processNode.referenceParent.processOutput.outputDatasets !== undefined) { + let outputDatasets = bot.processNode.referenceParent.processOutput.outputDatasets + + for (let j = 0; j < outputDatasets.length; j++) { + let outputDataset = outputDatasets[j] + + /* Some validations to verify that everything is in place. */ + if (outputDataset.referenceParent !== undefined) { + if (outputDataset.referenceParent.code.codeName === undefined) { + logger.write(MODULE_NAME, "[ERROR] raiseEvents -> codeName at Dataset Definition not defined. Dataset Definition = " + JSON.stringify(outputDataset.referenceParent)); + callBackFunction(global.DEFAULT_FAIL_RESPONSE); + return + } + if (outputDataset.referenceParent.parentNode !== undefined) { + if (outputDataset.referenceParent.parentNode.code.codeName === undefined) { + logger.write(MODULE_NAME, "[ERROR] raiseEvents -> codeName at Product not defined. Product = " + JSON.stringify(outputDataset.referenceParent.parentNode)); + callBackFunction(global.DEFAULT_FAIL_RESPONSE); + return + } + if (outputDataset.referenceParent.parentNode.parentNode !== undefined) { + if (outputDataset.referenceParent.parentNode.parentNode.code.codeName === undefined) { + logger.write(MODULE_NAME, "[ERROR] raiseEvents -> codeName at Bot not defined. Bot = " + JSON.stringify(outputDataset.referenceParent.parentNode.parentNode)); + callBackFunction(global.DEFAULT_FAIL_RESPONSE); + return + } + if (outputDataset.referenceParent.parentNode.parentNode.parentNode !== undefined) { + if (outputDataset.referenceParent.parentNode.parentNode.parentNode.code.codeName === undefined) { + logger.write(MODULE_NAME, "[ERROR] raiseEvents -> codeName at Team not defined. Team = " + JSON.stringify(outputDataset.referenceParent.parentNode.parentNode.parentNode)); + callBackFunction(global.DEFAULT_FAIL_RESPONSE); + return + } + } else { + logger.write(MODULE_NAME, "[ERROR] raiseEvents -> Bot not attached to a Team. Bot = " + JSON.stringify(outputDataset.referenceParent.parentNode.parentNode)); + callBackFunction(global.DEFAULT_FAIL_RESPONSE); + return + } + } else { + logger.write(MODULE_NAME, "[ERROR] raiseEvents -> Product not attached to a Bot. Product = " + JSON.stringify(outputDataset.referenceParent.parentNode)); + callBackFunction(global.DEFAULT_FAIL_RESPONSE); + return + } + } else { + logger.write(MODULE_NAME, "[ERROR] raiseEvents -> Dataset Definition not attached to a Product. Dataset Definition = " + JSON.stringify(outputDataset.referenceParent)); + callBackFunction(global.DEFAULT_FAIL_RESPONSE); + return + } + } else { + logger.write(MODULE_NAME, "[ERROR] raiseEvents -> Output Dataset with no reference to a Dataset Definition. Output Dataset = " + JSON.stringify(outputDataset)); + callBackFunction(global.DEFAULT_FAIL_RESPONSE); + return + } + + /* All good, lets emit the event. */ + + let devTeam = outputDataset.referenceParent.parentNode.parentNode.parentNode.code.codeName + let botName = outputDataset.referenceParent.parentNode.parentNode.code.codeName + let product = outputDataset.referenceParent.parentNode.code.codeName + let dataset = outputDataset.referenceParent.code.codeName + + let statusReport = statusDependencies.reportsByMainUtility.get("Self Reference") + + key = devTeam + "-" + botName + "-" + product + "-" + dataset + let event = { + lastFile: statusReport.file.lastFile + } + global.SYSTEM_EVENT_HANDLER.createEventHandler(key, 'Dataset Updated') + global.SYSTEM_EVENT_HANDLER.raiseEvent(key, 'Dataset Updated', event) + + } + } + } + + callBackFunction(global.DEFAULT_OK_RESPONSE); + + } catch (err) { + logger.write(MODULE_NAME, "[ERROR] raiseEvents -> err = " + err.stack); + callBackFunction(global.DEFAULT_FAIL_RESPONSE); + } + } +}; diff --git a/Project.njsproj b/Project.njsproj index d6b366b77..5128f194e 100644 --- a/Project.njsproj +++ b/Project.njsproj @@ -48,6 +48,9 @@ Code + + Code + Code diff --git a/Root.js b/Root.js index 707c94093..a76e82d11 100644 --- a/Root.js +++ b/Root.js @@ -99,6 +99,13 @@ logErrors: true, logContent: false, intensiveLogging: false + }, + "Process Output": { + logInfo: true, + logWarnings: false, + logErrors: true, + logContent: false, + intensiveLogging: false } }; diff --git a/SensorBotProcessMainLoop.js b/SensorBotProcessMainLoop.js index 58573ed3a..3bd2fc6fd 100644 --- a/SensorBotProcessMainLoop.js +++ b/SensorBotProcessMainLoop.js @@ -130,7 +130,8 @@ const STATUS_REPORT = require(ROOT_DIR + 'StatusReport'); const EXCHANGE_API = require('@superalgos/exchange-gateway'); const STATUS_DEPENDENCIES = require(ROOT_DIR + 'StatusDependencies'); - const PROCESS_EXECUTION_EVENTS = require(ROOT_DIR + 'ProcessExecutionEvents'); + const PROCESS_EXECUTION_EVENTS = require(ROOT_DIR + 'ProcessExecutionEvents'); + const PROCESS_OUTPUT = require(ROOT_DIR + 'ProcessOutput'); /* We define the datetime for the process that we are running now. This will be the official processing time for both the infraestructure and the bot. */ @@ -143,6 +144,7 @@ /* We will prepare first the infraestructure needed for the bot to run. There are 4 modules we need to sucessfullly initialize first. */ + let processOutput let processExecutionEvents let userBot; let statusDependencies; @@ -158,7 +160,7 @@ if (FULL_LOG === true) { logger.write(MODULE_NAME, "[INFO] run -> loop -> initializeProcessExecutionEvents -> Entering function."); } - processExecutionEvents = PROCESS_EXECUTION_EVENTS.newProcessExecutionEvents(bot, parentLogger) + processExecutionEvents = PROCESS_EXECUTION_EVENTS.newProcessExecutionEvents(bot, logger) processExecutionEvents.initialize(pMonth, pYear, onInizialized); @@ -577,7 +579,7 @@ switch (err.result) { case global.DEFAULT_OK_RESPONSE.result: { logger.write(MODULE_NAME, "[INFO] run -> loop -> startUserBot -> onFinished > Execution finished well."); - finishProcessExecutionEvents() + raiseEventsProcessOutput() return; } case global.DEFAULT_RETRY_RESPONSE.result: { // Something bad happened, but if we retry in a while it might go through the next time. @@ -690,6 +692,81 @@ } } + function raiseEventsProcessOutput() { + + try { + + if (FULL_LOG === true) { logger.write(MODULE_NAME, "[INFO] run -> loop -> raiseEventsProcessOutput -> Entering function."); } + + processOutput = PROCESS_OUTPUT.newProcessOutput(bot, logger) + + processOutput.raiseEvents(statusDependencies, onFinished); + + function onFinished(err) { + + try { + + if (FULL_LOG === true) { logger.write(MODULE_NAME, "[INFO] run -> loop -> raiseEventsProcessOutput -> onFinished -> Entering function."); } + + switch (err.result) { + case global.DEFAULT_OK_RESPONSE.result: { + logger.write(MODULE_NAME, "[INFO] run -> loop -> raiseEventsProcessOutput -> onFinished -> Execution finished well."); + finishProcessExecutionEvents() + return; + } + case global.DEFAULT_RETRY_RESPONSE.result: { // Something bad happened, but if we retry in a while it might go through the next time. + logger.write(MODULE_NAME, "[WARN] run -> loop -> raiseEventsProcessOutput -> onFinished -> Retry Later. Requesting Execution Retry."); + nextWaitTime = 'Retry'; + loopControl(nextWaitTime); + return; + } + case global.DEFAULT_FAIL_RESPONSE.result: { // This is an unexpected exception that we do not know how to handle. + processStopped() + logger.write(MODULE_NAME, "[ERROR] run -> loop -> raiseEventsProcessOutput -> onFinished -> Operation Failed. Aborting the process."); + logger.persist(); + clearInterval(fixedTimeLoopIntervalHandle); + clearTimeout(nextLoopTimeoutHandle); + clearTimeout(checkLoopHealthHandle); + bot.enableCheckLoopHealth = false; + callBackFunction(err); + return; + } + default: { + logger.write(MODULE_NAME, "[ERROR] run -> loop -> raiseEventsProcessOutput -> onFinished -> Unhandled err.result received. -> err.result = " + err.result); + logger.write(MODULE_NAME, "[ERROR] run -> loop -> raiseEventsProcessOutput -> onFinished -> Unhandled err.result received. -> err = " + err.message); + + logger.persist(); + clearInterval(fixedTimeLoopIntervalHandle); + clearTimeout(nextLoopTimeoutHandle); + clearTimeout(checkLoopHealthHandle); + bot.enableCheckLoopHealth = false; + callBackFunction(global.DEFAULT_FAIL_RESPONSE); + return; + } + } + + } catch (err) { + logger.write(MODULE_NAME, "[ERROR] run -> loop -> raiseEventsProcessOutput -> onFinished -> err = " + err.stack); + logger.persist(); + clearInterval(fixedTimeLoopIntervalHandle); + clearTimeout(nextLoopTimeoutHandle); + clearTimeout(checkLoopHealthHandle); + bot.enableCheckLoopHealth = false; + callBackFunction(err); + } + } + + } catch (err) { + logger.write(MODULE_NAME, "[ERROR] run -> loop -> raiseEventsProcessOutput -> err = " + err.stack); + logger.persist(); + clearInterval(fixedTimeLoopIntervalHandle); + clearTimeout(nextLoopTimeoutHandle); + clearTimeout(checkLoopHealthHandle); + bot.enableCheckLoopHealth = false; + callBackFunction(err); + } + } + function finishProcessExecutionEvents() { try { diff --git a/StatusDependencies.js b/StatusDependencies.js index 1be68c6c0..95092e152 100644 --- a/StatusDependencies.js +++ b/StatusDependencies.js @@ -9,6 +9,7 @@ let thisObject = { nodeArray: undefined, statusReports: new Map(), + reportsByMainUtility: new Map(), initialize: initialize, keys: [] }; @@ -136,6 +137,10 @@ thisObject.keys.push(key); thisObject.statusReports.set(key, statusReportModule); + if (statusReportModule.mainUtility !== undefined) { + thisObject.reportsByMainUtility.set(statusReportModule.mainUtility, statusReportModule) + } + if (FULL_LOG === true) { logger.write(MODULE_NAME, "[INFO] initialize -> addReport -> Report added to Map. -> key = " + key); } if (loadCount === thisObject.nodeArray.length) { diff --git a/StatusReport.js b/StatusReport.js index 79c78a1cb..4e24d5201 100644 --- a/StatusReport.js +++ b/StatusReport.js @@ -13,6 +13,7 @@ let bot = BOT; let thisObject = { + mainUtility: undefined, file: undefined, // Here we have the JSON object representing the file content. initialize: initialize, load: load, @@ -107,7 +108,14 @@ } } } - + + /* We retrieve the report main utility */ + if (owner.code !== undefined) { + if (owner.code.mainUtility !== undefined) { + thisObject.mainUtility = owner.code.mainUtility + } + } + /* This stuff is still hardcoded and unresolved. */ owner.botVersion = { "major": 1, @@ -267,30 +275,6 @@ logger.write(MODULE_NAME, "[INFO] save -> onFileCreated -> Content written = " + fileContent); } - /* Here we raise the event stating that this status report was updated. */ - let key = bot.devTeam + "-" + bot.codeName + "-" + bot.process - global.SYSTEM_EVENT_HANDLER.raiseEvent(key, 'Status Report Updated') - - /* We will also reaise the events for the datasets impacted by the process that just finished. */ - for (let j = 0; j < bot.processes.length; j++) { - let process = bot.processes[j] - if (process.name === bot.process) { - let updatesDatasets = process.updatesDatasets - if (updatesDatasets !== undefined) { - for (let i = 0; i < updatesDatasets.length; i++) { - let updatedDataSet = updatesDatasets[i] - - key = bot.devTeam + "-" + bot.codeName + "-" + updatedDataSet.product + "-" + updatedDataSet.dataSet - let event = { - lastFile: thisObject.file.lastFile - } - global.SYSTEM_EVENT_HANDLER.createEventHandler(key, 'Dataset Updated') - global.SYSTEM_EVENT_HANDLER.raiseEvent(key, 'Dataset Updated', event) - } - } - } - } - callBackFunction(global.DEFAULT_OK_RESPONSE); return; } diff --git a/TradingBotProcessMainLoop.js b/TradingBotProcessMainLoop.js index fd008890e..8877a59f9 100644 --- a/TradingBotProcessMainLoop.js +++ b/TradingBotProcessMainLoop.js @@ -140,6 +140,8 @@ const STATUS_DEPENDENCIES = require(ROOT_DIR + 'StatusDependencies'); const DATA_DEPENDENCIES = require(ROOT_DIR + 'DataDependencies'); const DATA_SET = require(ROOT_DIR + 'DataSet'); + const PROCESS_EXECUTION_EVENTS = require(ROOT_DIR + 'ProcessExecutionEvents'); + const PROCESS_OUTPUT = require(ROOT_DIR + 'ProcessOutput'); /* We define the datetime for the process that we are running now. This will be the official processing time for both the infraestructure and the bot. */ @@ -177,12 +179,162 @@ /* We will prepare first the infraestructure needed for the bot to run. There are 3 modules we need to sucessfullly initialize first. */ + let processOutput + let processExecutionEvents let userBot; let processFramework; let statusDependencies; let dataDependencies; - initializeStatusDependencies(); + initializeProcessExecutionEvents(); + + function initializeProcessExecutionEvents() { + + try { + + if (FULL_LOG === true) { logger.write(MODULE_NAME, "[INFO] run -> loop -> initializeProcessExecutionEvents -> Entering function."); } + + processExecutionEvents = PROCESS_EXECUTION_EVENTS.newProcessExecutionEvents(bot, logger) + + processExecutionEvents.initialize(pMonth, pYear, onInizialized); + + function onInizialized(err) { + + try { + + if (FULL_LOG === true) { logger.write(MODULE_NAME, "[INFO] run -> loop -> initializeProcessExecutionEvents -> onInizialized -> Entering function."); } + + switch (err.result) { + case global.DEFAULT_OK_RESPONSE.result: { + logger.write(MODULE_NAME, "[INFO] run -> loop -> initializeProcessExecutionEvents -> onInizialized -> Execution finished well."); + startProcessExecutionEvents() + return; + } + case global.DEFAULT_RETRY_RESPONSE.result: { // Something bad happened, but if we retry in a while it might go through the next time. + logger.write(MODULE_NAME, "[WARN] run -> loop -> initializeProcessExecutionEvents -> onInizialized -> Retry Later. Requesting Execution Retry."); + nextWaitTime = 'Retry'; + loopControl(nextWaitTime); + return; + } + case global.DEFAULT_FAIL_RESPONSE.result: { // This is an unexpected exception that we do not know how to handle. + processStopped() + logger.write(MODULE_NAME, "[ERROR] run -> loop -> initializeProcessExecutionEvents -> onInizialized -> Operation Failed. Aborting the process."); + logger.persist(); + clearInterval(fixedTimeLoopIntervalHandle); + clearTimeout(nextLoopTimeoutHandle); + clearTimeout(checkLoopHealthHandle); + bot.enableCheckLoopHealth = false; + callBackFunction(err); + return; + } + default: { + logger.write(MODULE_NAME, "[ERROR] run -> loop -> initializeProcessExecutionEvents -> onInizialized -> Unhandled err.result received. -> err.result = " + err.result); + logger.write(MODULE_NAME, "[ERROR] run -> loop -> initializeProcessExecutionEvents -> onInizialized -> Unhandled err.result received. -> err = " + err.message); + + logger.persist(); + clearInterval(fixedTimeLoopIntervalHandle); + clearTimeout(nextLoopTimeoutHandle); + clearTimeout(checkLoopHealthHandle); + bot.enableCheckLoopHealth = false; + callBackFunction(global.DEFAULT_FAIL_RESPONSE); + return; + } + } + + } catch (err) { + logger.write(MODULE_NAME, "[ERROR] run -> loop -> initializeProcessExecutionEvents -> onInizialized -> err = " + err.stack); + logger.persist(); + clearInterval(fixedTimeLoopIntervalHandle); + clearTimeout(nextLoopTimeoutHandle); + clearTimeout(checkLoopHealthHandle); + bot.enableCheckLoopHealth = false; + callBackFunction(err); + } + } + + } catch (err) { + logger.write(MODULE_NAME, "[ERROR] run -> loop -> initializeProcessExecutionEvents -> err = " + err.stack); + logger.persist(); + clearInterval(fixedTimeLoopIntervalHandle); + clearTimeout(nextLoopTimeoutHandle); + clearTimeout(checkLoopHealthHandle); + bot.enableCheckLoopHealth = false; + callBackFunction(err); + } + } + + function startProcessExecutionEvents() { + + try { + + if (FULL_LOG === true) { logger.write(MODULE_NAME, "[INFO] run -> loop -> startProcessExecutionEvents -> Entering function."); } + + processExecutionEvents.start(onStarted); + + function onStarted(err) { + + try { + + if (FULL_LOG === true) { logger.write(MODULE_NAME, "[INFO] run -> loop -> startProcessExecutionEvents -> onStarted -> Entering function."); } + + switch (err.result) { + case global.DEFAULT_OK_RESPONSE.result: { + logger.write(MODULE_NAME, "[INFO] run -> loop -> startProcessExecutionEvents -> onStarted -> Execution finished well."); + initializeStatusDependencies(); + return; + } + case global.DEFAULT_RETRY_RESPONSE.result: { // Something bad happened, but if we retry in a while it might go through the next time. + logger.write(MODULE_NAME, "[WARN] run -> loop -> startProcessExecutionEvents -> onStarted -> Retry Later. Requesting Execution Retry."); + nextWaitTime = 'Retry'; + loopControl(nextWaitTime); + return; + } + case global.DEFAULT_FAIL_RESPONSE.result: { // This is an unexpected exception that we do not know how to handle. + processStopped() + logger.write(MODULE_NAME, "[ERROR] run -> loop -> startProcessExecutionEvents -> onStarted -> Operation Failed. Aborting the process."); + logger.persist(); + clearInterval(fixedTimeLoopIntervalHandle); + clearTimeout(nextLoopTimeoutHandle); + clearTimeout(checkLoopHealthHandle); + bot.enableCheckLoopHealth = false; + callBackFunction(err); + return; + } + default: { + logger.write(MODULE_NAME, "[ERROR] run -> loop -> startProcessExecutionEvents -> onStarted -> Unhandled err.result received. -> err.result = " + err.result); + logger.write(MODULE_NAME, "[ERROR] run -> loop -> startProcessExecutionEvents -> onStarted -> Unhandled err.result received. -> err = " + err.message); + + logger.persist(); + clearInterval(fixedTimeLoopIntervalHandle); + clearTimeout(nextLoopTimeoutHandle); + clearTimeout(checkLoopHealthHandle); + bot.enableCheckLoopHealth = false; + callBackFunction(global.DEFAULT_FAIL_RESPONSE); + return; + } + } + + } catch (err) { + logger.write(MODULE_NAME, "[ERROR] run -> loop -> startProcessExecutionEvents -> onStarted -> err = " + err.stack); + logger.persist(); + clearInterval(fixedTimeLoopIntervalHandle); + clearTimeout(nextLoopTimeoutHandle); + clearTimeout(checkLoopHealthHandle); + bot.enableCheckLoopHealth = false; + callBackFunction(err); + } + } + + } catch (err) { + logger.write(MODULE_NAME, "[ERROR] run -> loop -> startProcessExecutionEvents -> err = " + err.stack); + logger.persist(); + clearInterval(fixedTimeLoopIntervalHandle); + clearTimeout(nextLoopTimeoutHandle); + clearTimeout(checkLoopHealthHandle); + bot.enableCheckLoopHealth = false; + callBackFunction(err); + } + } function initializeStatusDependencies() { @@ -848,8 +1000,7 @@ switch (err.result) { case global.DEFAULT_OK_RESPONSE.result: { if (FULL_LOG === true) { logger.write(MODULE_NAME, "[INFO] run -> loop -> saveContext -> onFinished -> Execution finished well."); } - nextWaitTime = 'Normal'; - loopControl(nextWaitTime); + raiseEventsProcessOutput() return; } case global.DEFAULT_RETRY_RESPONSE.result: { // Something bad happened, but if we retry in a while it might go through the next time. @@ -910,6 +1061,155 @@ } } + function raiseEventsProcessOutput() { + + try { + + if (FULL_LOG === true) { logger.write(MODULE_NAME, "[INFO] run -> loop -> raiseEventsProcessOutput -> Entering function."); } + + processOutput = PROCESS_OUTPUT.newProcessOutput(bot, logger) + + processOutput.raiseEvents(statusDependencies, onFinished); + + function onFinished(err) { + + try { + + if (FULL_LOG === true) { logger.write(MODULE_NAME, "[INFO] run -> loop -> raiseEventsProcessOutput -> onFinished -> Entering function."); } + + switch (err.result) { + case global.DEFAULT_OK_RESPONSE.result: { + logger.write(MODULE_NAME, "[INFO] run -> loop -> raiseEventsProcessOutput -> onFinished -> Execution finished well."); + finishProcessExecutionEvents() + return; + } + case global.DEFAULT_RETRY_RESPONSE.result: { // Something bad happened, but if we retry in a while it might go through the next time. + logger.write(MODULE_NAME, "[WARN] run -> loop -> raiseEventsProcessOutput -> onFinished -> Retry Later. Requesting Execution Retry."); + nextWaitTime = 'Retry'; + loopControl(nextWaitTime); + return; + } + case global.DEFAULT_FAIL_RESPONSE.result: { // This is an unexpected exception that we do not know how to handle. + processStopped() + logger.write(MODULE_NAME, "[ERROR] run -> loop -> raiseEventsProcessOutput -> onFinished -> Operation Failed. Aborting the process."); + logger.persist(); + clearInterval(fixedTimeLoopIntervalHandle); + clearTimeout(nextLoopTimeoutHandle); + clearTimeout(checkLoopHealthHandle); + bot.enableCheckLoopHealth = false; + callBackFunction(err); + return; + } + default: { + logger.write(MODULE_NAME, "[ERROR] run -> loop -> raiseEventsProcessOutput -> onFinished -> Unhandled err.result received. -> err.result = " + err.result); + logger.write(MODULE_NAME, "[ERROR] run -> loop -> raiseEventsProcessOutput -> onFinished -> Unhandled err.result received. -> err = " + err.message); + + logger.persist(); + clearInterval(fixedTimeLoopIntervalHandle); + clearTimeout(nextLoopTimeoutHandle); + clearTimeout(checkLoopHealthHandle); + bot.enableCheckLoopHealth = false; + callBackFunction(global.DEFAULT_FAIL_RESPONSE); + return; + } + } + + } catch (err) { + logger.write(MODULE_NAME, "[ERROR] run -> loop -> raiseEventsProcessOutput -> onFinished -> err = " + err.stack); + logger.persist(); + clearInterval(fixedTimeLoopIntervalHandle); + clearTimeout(nextLoopTimeoutHandle); + clearTimeout(checkLoopHealthHandle); + bot.enableCheckLoopHealth = false; + callBackFunction(err); + } + } + + } catch (err) { + logger.write(MODULE_NAME, "[ERROR] run -> loop -> raiseEventsProcessOutput -> err = " + err.stack); + logger.persist(); + clearInterval(fixedTimeLoopIntervalHandle); + clearTimeout(nextLoopTimeoutHandle); + clearTimeout(checkLoopHealthHandle); + bot.enableCheckLoopHealth = false; + callBackFunction(err); + } + } + + function finishProcessExecutionEvents() { + + try { + + if (FULL_LOG === true) { logger.write(MODULE_NAME, "[INFO] run -> loop -> finishProcessExecutionEvents -> Entering function."); } + + processExecutionEvents.finish(onFinished); + + function onFinished(err) { + + try { + + if (FULL_LOG === true) { logger.write(MODULE_NAME, "[INFO] run -> loop -> finishProcessExecutionEvents -> onFinished -> Entering function."); } + + switch (err.result) { + case global.DEFAULT_OK_RESPONSE.result: { + logger.write(MODULE_NAME, "[INFO] run -> loop -> finishProcessExecutionEvents -> onFinished -> Execution finished well."); + nextWaitTime = 'Normal'; + loopControl(nextWaitTime); + return; + } + case global.DEFAULT_RETRY_RESPONSE.result: { // Something bad happened, but if we retry in a while it might go through the next time. + logger.write(MODULE_NAME, "[WARN] run -> loop -> finishProcessExecutionEvents -> onFinished -> Retry Later. Requesting Execution Retry."); + nextWaitTime = 'Retry'; + loopControl(nextWaitTime); + return; + } + case global.DEFAULT_FAIL_RESPONSE.result: { // This is an unexpected exception that we do not know how to handle. + processStopped() + logger.write(MODULE_NAME, "[ERROR] run -> loop -> finishProcessExecutionEvents -> onFinished -> Operation Failed. Aborting the process."); + logger.persist(); + clearInterval(fixedTimeLoopIntervalHandle); + clearTimeout(nextLoopTimeoutHandle); + clearTimeout(checkLoopHealthHandle); + bot.enableCheckLoopHealth = false; + callBackFunction(err); + return; + } + default: { + logger.write(MODULE_NAME, "[ERROR] run -> loop -> finishProcessExecutionEvents -> onFinished -> Unhandled err.result received. -> err.result = " + err.result); + logger.write(MODULE_NAME, "[ERROR] run -> loop -> finishProcessExecutionEvents -> onFinished -> Unhandled err.result received. -> err = " + err.message); + + logger.persist(); + clearInterval(fixedTimeLoopIntervalHandle); + clearTimeout(nextLoopTimeoutHandle); + clearTimeout(checkLoopHealthHandle); + bot.enableCheckLoopHealth = false; + callBackFunction(global.DEFAULT_FAIL_RESPONSE); + return; + } + } + + } catch (err) { + logger.write(MODULE_NAME, "[ERROR] run -> loop -> finishProcessExecutionEvents -> onFinished -> err = " + err.stack); + logger.persist(); + clearInterval(fixedTimeLoopIntervalHandle); + clearTimeout(nextLoopTimeoutHandle); + clearTimeout(checkLoopHealthHandle); + bot.enableCheckLoopHealth = false; + callBackFunction(err); + } + } + + } catch (err) { + logger.write(MODULE_NAME, "[ERROR] run -> loop -> finishProcessExecutionEvents -> err = " + err.stack); + logger.persist(); + clearInterval(fixedTimeLoopIntervalHandle); + clearTimeout(nextLoopTimeoutHandle); + clearTimeout(checkLoopHealthHandle); + bot.enableCheckLoopHealth = false; + callBackFunction(err); + } + } + function loopControl(nextWaitTime) { if (FULL_LOG === true) { logger.write(MODULE_NAME, "[INFO] run -> loop -> loopControl -> Entering function."); } diff --git a/server.js b/server.js index c63d95e5d..7ad8aa56c 100644 --- a/server.js +++ b/server.js @@ -73,7 +73,7 @@ if (global.TASK_NODE !== undefined) { } else { // I use this section to debug in standalone mode. let argument - argument = ' {"type":"Task","name":"Brings Trades Records from the Exchange","bot":{"type":"Sensor Bot Instance","name":"Charly","code":{"team":"AAMasters","bot":"AACharly","repo":"AACharly-Sensor-Bot"},"processes":[{"type":"Process Instance","subType":"Sensor Process Instance","name":"Live Trades","code":{"process":"Live-Trades"},"id":"338266fa-14c2-42eb-b0e5-d0a8ed9309fc","referenceParent":{"type":"Process Definition","name":"Live-Trades","code":{"codeName":"Live-Trades","description":"Retrieves the trades done at the current and the previous minute and saves them at the storage account.","startMode":{"allMonths":{"run":"false","minYear":"","maxYear":""},"oneMonth":{"run":"false","year":"","month":""},"noTime":{"run":"false"},"fixedInterval":{"run":"true","interval":60000}},"deadWaitTime":0,"normalWaitTime":60000,"retryWaitTime":10000,"sleepWaitTime":3600000,"comaWaitTime":86400000},"id":"371a2507-655b-46c5-b959-52f527cc4d7e","processOutput":{"type":"Process Output","name":"New Process Output","outputDatasets":[],"id":"9ffdaadd-5204-4436-b89e-cabd8f0e5829"},"processDependencies":{"type":"Process Dependencies","name":"New Process Dependencies","statusDependencies":[{"type":"Status Dependency","name":"New Status Dependency","id":"cfd2acec-5b56-40fb-b97b-10cdb91faa92","referenceParent":{"type":"Status Report","name":"New Status Report","parentNode":{"type":"Process Definition","name":"Live-Trades","code":{"codeName":"Live-Trades","description":"Retrieves the trades done at the current and the previous minute and saves them at the storage account.","startMode":{"allMonths":{"run":"false","minYear":"","maxYear":""},"oneMonth":{"run":"false","year":"","month":""},"noTime":{"run":"false"},"fixedInterval":{"run":"true","interval":60000}},"deadWaitTime":0,"normalWaitTime":60000,"retryWaitTime":10000,"sleepWaitTime":3600000,"comaWaitTime":86400000},"id":"371a2507-655b-46c5-b959-52f527cc4d7e","parentNode":{"type":"Sensor Bot","name":"Charly","code":{"codeName":"AACharly"},"processes":[],"products":[],"parentNode":{"type":"Team","name":"Masters","code":{"codeName":"AAMasters"},"sensorBots":[],"indicatorBots":[],"tradingBots":[],"plotters":[],"id":"35be7b1c-a0f7-4b5f-9ee1-8fb51595e959"},"id":"957bef47-cd90-4dfa-bbb1-3696c527b010"}},"id":"9f3ea81f-2aa1-41ec-907f-c003dec0c827"}}],"dataDependencies":[],"id":"a98b94ad-0cd4-4e54-ade4-68b0ab577414"},"statusReport":{"type":"Status Report","name":"New Status Report","parentNode":{"type":"Process Definition","name":"Live-Trades","code":{"codeName":"Live-Trades","description":"Retrieves the trades done at the current and the previous minute and saves them at the storage account.","startMode":{"allMonths":{"run":"false","minYear":"","maxYear":""},"oneMonth":{"run":"false","year":"","month":""},"noTime":{"run":"false"},"fixedInterval":{"run":"true","interval":60000}},"deadWaitTime":0,"normalWaitTime":60000,"retryWaitTime":10000,"sleepWaitTime":3600000,"comaWaitTime":86400000},"id":"371a2507-655b-46c5-b959-52f527cc4d7e","parentNode":{"type":"Sensor Bot","name":"Charly","code":{"codeName":"AACharly"},"processes":[],"products":[],"parentNode":{"type":"Team","name":"Masters","code":{"codeName":"AAMasters"},"sensorBots":[],"indicatorBots":[],"tradingBots":[],"plotters":[],"id":"35be7b1c-a0f7-4b5f-9ee1-8fb51595e959"},"id":"957bef47-cd90-4dfa-bbb1-3696c527b010"}},"id":"9f3ea81f-2aa1-41ec-907f-c003dec0c827"},"executionStartedEvent":{"type":"Execution Started Event","name":"New Execution Started Event","id":"942c8337-5d22-413d-9e44-e2da9a5479f1"},"executionFinishedEvent":{"type":"Execution Finished Event","name":"New Execution Finished Event","id":"d5f1f2b3-ffa5-442b-b875-e91a786337ae","parentNode":{"type":"Process Definition","name":"Live-Trades","id":"371a2507-655b-46c5-b959-52f527cc4d7e","code":{"codeName":"Live-Trades","description":"Retrieves the trades done at the current and the previous minute and saves them at the storage account.","startMode":{"allMonths":{"run":"false","minYear":"","maxYear":""},"oneMonth":{"run":"false","year":"","month":""},"noTime":{"run":"false"},"fixedInterval":{"run":"true","interval":60000}},"deadWaitTime":0,"normalWaitTime":60000,"retryWaitTime":10000,"sleepWaitTime":3600000,"comaWaitTime":86400000}}},"calculations":{"type":"Calculations Procedure","name":"New Calculations Procedure","id":"e3774584-43e5-4dc5-b097-7b16476d586a"},"dataBuilding":{"type":"Data Building Procedure","name":"New Data Building Procedure","id":"0f8cc852-ad72-40fe-bf4a-866e68439492"}}},{"type":"Process Instance","subType":"Sensor Process Instance","name":"Hole Fixing","code":{"process":"Hole-Fixing"},"id":"3d7e0bdd-64e3-4442-8742-cc9282a82631","referenceParent":{"type":"Process Definition","name":"Hole-Fixing","code":{"codeName":"Hole-Fixing","description":"Scans the trades saved by the Live Trades and Historic Trades processes searching for missing records. Once a hole is found on the data set, it patches it by retrieving the missing records from the exchange.","startMode":{"allMonths":{"run":"true","minYear":"2019","maxYear":"2019"},"oneMonth":{"run":"false","year":"2019","month":"10"},"noTime":{"run":"false"},"fixedInterval":{"run":"false","interval":0}},"deadWaitTime":0,"normalWaitTime":0,"retryWaitTime":10000,"sleepWaitTime":3600000,"comaWaitTime":86400000},"id":"60c8e8b0-0c0d-49bd-980e-6c7814a4cb18","processOutput":{"type":"Process Output","name":"New Process Output","outputDatasets":[],"id":"d8e3878e-6f12-4ef9-873b-e3f8a8f5a63e"},"processDependencies":{"type":"Process Dependencies","name":"New Process Dependencies","statusDependencies":[{"type":"Status Dependency","name":"New Status Dependency","id":"2746eb59-ea5f-4f2d-b838-b13adeb4c2e6","referenceParent":{"type":"Status Report","name":"New Status Report","parentNode":{"type":"Process Definition","name":"Historic-Trades","code":{"codeName":"Historic-Trades","description":"Retrieves and saves the historical trades in batches going backwards from the current time until reaching the begining of the market.","startMode":{"allMonths":{"run":"false","minYear":"2014","maxYear":"2020"},"oneMonth":{"run":"false","year":"2018","month":"01"},"noTime":{"run":"false"},"fixedInterval":{"run":"false","interval":0}},"deadWaitTime":0,"normalWaitTime":60000,"retryWaitTime":10000,"sleepWaitTime":3600000,"comaWaitTime":86400000},"id":"e2c3f7c3-b74c-4145-8a60-f73cc3364629","parentNode":{"type":"Sensor Bot","name":"Charly","code":{"codeName":"AACharly"},"processes":[],"products":[],"parentNode":{"type":"Team","name":"Masters","code":{"codeName":"AAMasters"},"sensorBots":[],"indicatorBots":[],"tradingBots":[],"plotters":[],"id":"35be7b1c-a0f7-4b5f-9ee1-8fb51595e959"},"id":"957bef47-cd90-4dfa-bbb1-3696c527b010"}},"id":"c542a73e-a350-431f-ad3e-10f3ebef8ec7"}},{"type":"Status Dependency","name":"New Status Dependency","id":"3d84de0f-5939-4992-9395-dc1a1ee93232","referenceParent":{"type":"Status Report","name":"New Status Report","parentNode":{"type":"Process Definition","name":"Live-Trades","code":{"codeName":"Live-Trades","description":"Retrieves the trades done at the current and the previous minute and saves them at the storage account.","startMode":{"allMonths":{"run":"false","minYear":"","maxYear":""},"oneMonth":{"run":"false","year":"","month":""},"noTime":{"run":"false"},"fixedInterval":{"run":"true","interval":60000}},"deadWaitTime":0,"normalWaitTime":60000,"retryWaitTime":10000,"sleepWaitTime":3600000,"comaWaitTime":86400000},"id":"371a2507-655b-46c5-b959-52f527cc4d7e","parentNode":{"type":"Sensor Bot","name":"Charly","code":{"codeName":"AACharly"},"processes":[],"products":[],"parentNode":{"type":"Team","name":"Masters","code":{"codeName":"AAMasters"},"sensorBots":[],"indicatorBots":[],"tradingBots":[],"plotters":[],"id":"35be7b1c-a0f7-4b5f-9ee1-8fb51595e959"},"id":"957bef47-cd90-4dfa-bbb1-3696c527b010"}},"id":"9f3ea81f-2aa1-41ec-907f-c003dec0c827"}},{"type":"Status Dependency","name":"New Status Dependency","id":"612519b7-cc59-4363-9452-903ab2f4a958","referenceParent":{"type":"Status Report","name":"New Status Report","parentNode":{"type":"Process Definition","name":"Hole-Fixing","code":{"codeName":"Hole-Fixing","description":"Scans the trades saved by the Live Trades and Historic Trades processes searching for missing records. Once a hole is found on the data set, it patches it by retrieving the missing records from the exchange.","startMode":{"allMonths":{"run":"true","minYear":"2019","maxYear":"2019"},"oneMonth":{"run":"false","year":"2019","month":"10"},"noTime":{"run":"false"},"fixedInterval":{"run":"false","interval":0}},"deadWaitTime":0,"normalWaitTime":0,"retryWaitTime":10000,"sleepWaitTime":3600000,"comaWaitTime":86400000},"id":"60c8e8b0-0c0d-49bd-980e-6c7814a4cb18","parentNode":{"type":"Sensor Bot","name":"Charly","code":{"codeName":"AACharly"},"processes":[],"products":[],"parentNode":{"type":"Team","name":"Masters","code":{"codeName":"AAMasters"},"sensorBots":[],"indicatorBots":[],"tradingBots":[],"plotters":[],"id":"35be7b1c-a0f7-4b5f-9ee1-8fb51595e959"},"id":"957bef47-cd90-4dfa-bbb1-3696c527b010"}},"id":"93f391ac-4651-47c6-b2ff-e9387fe0a444"}}],"dataDependencies":[],"id":"aa390ea7-0f89-47cc-a75f-fa4fb738219a"},"statusReport":{"type":"Status Report","name":"New Status Report","parentNode":{"type":"Process Definition","name":"Hole-Fixing","code":{"codeName":"Hole-Fixing","description":"Scans the trades saved by the Live Trades and Historic Trades processes searching for missing records. Once a hole is found on the data set, it patches it by retrieving the missing records from the exchange.","startMode":{"allMonths":{"run":"true","minYear":"2019","maxYear":"2019"},"oneMonth":{"run":"false","year":"2019","month":"10"},"noTime":{"run":"false"},"fixedInterval":{"run":"false","interval":0}},"deadWaitTime":0,"normalWaitTime":0,"retryWaitTime":10000,"sleepWaitTime":3600000,"comaWaitTime":86400000},"id":"60c8e8b0-0c0d-49bd-980e-6c7814a4cb18","parentNode":{"type":"Sensor Bot","name":"Charly","code":{"codeName":"AACharly"},"processes":[],"products":[],"parentNode":{"type":"Team","name":"Masters","code":{"codeName":"AAMasters"},"sensorBots":[],"indicatorBots":[],"tradingBots":[],"plotters":[],"id":"35be7b1c-a0f7-4b5f-9ee1-8fb51595e959"},"id":"957bef47-cd90-4dfa-bbb1-3696c527b010"}},"id":"93f391ac-4651-47c6-b2ff-e9387fe0a444"},"executionStartedEvent":{"type":"Execution Started Event","name":"New Execution Started Event","id":"542f80b6-e848-4ab5-aa46-06674837ca3a","referenceParent":{"type":"Execution Finished Event","name":"New Execution Finished Event","id":"d5f1f2b3-ffa5-442b-b875-e91a786337ae","parentNode":{"type":"Process Definition","name":"Live-Trades","id":"371a2507-655b-46c5-b959-52f527cc4d7e","code":{"codeName":"Live-Trades","description":"Retrieves the trades done at the current and the previous minute and saves them at the storage account.","startMode":{"allMonths":{"run":"false","minYear":"","maxYear":""},"oneMonth":{"run":"false","year":"","month":""},"noTime":{"run":"false"},"fixedInterval":{"run":"true","interval":60000}},"deadWaitTime":0,"normalWaitTime":60000,"retryWaitTime":10000,"sleepWaitTime":3600000,"comaWaitTime":86400000}}}},"executionFinishedEvent":{"type":"Execution Finished Event","name":"New Execution Finished Event","id":"ab5e01b1-8036-4761-8a93-d61a663b0088","parentNode":{"type":"Process Definition","name":"Hole-Fixing","id":"60c8e8b0-0c0d-49bd-980e-6c7814a4cb18","code":{"codeName":"Hole-Fixing","description":"Scans the trades saved by the Live Trades and Historic Trades processes searching for missing records. Once a hole is found on the data set, it patches it by retrieving the missing records from the exchange.","startMode":{"allMonths":{"run":"true","minYear":"2019","maxYear":"2019"},"oneMonth":{"run":"false","year":"2019","month":"10"},"noTime":{"run":"false"},"fixedInterval":{"run":"false","interval":0}},"deadWaitTime":0,"normalWaitTime":0,"retryWaitTime":10000,"sleepWaitTime":3600000,"comaWaitTime":86400000}}},"calculations":{"type":"Calculations Procedure","name":"New Calculations Procedure","id":"ca19a529-5b73-4ef0-83e2-91aaa73ca4dd"},"dataBuilding":{"type":"Data Building Procedure","name":"New Data Building Procedure","id":"5c586e2e-3f91-49d9-b0d3-fa1a84eedec2"}}}],"id":"85c4f582-56ee-4b8e-95b2-aa61baedfa39"},"id":"2fcbea08-a941-4891-80fd-236eacd83c11"}' + argument = '{"type":"Task","name":"Generates 1 min to 24 hs Candles & Volumes","bot":{"type":"Indicator Bot Instance","name":"Olivia","code":{"team":"AAMasters","bot":"AAOlivia","repo":"AAOlivia-Indicator-Bot"},"processes":[{"type":"Process Instance","subType":"Indicator Process Instance","name":"Daily","code":{"process":"Multi-Period-Daily"},"id":"050d715f-2851-48b4-86b6-d93ab4baa1b2","referenceParent":{"type":"Process Definition","name":"Multi-Period-Daily","code":{"codeName":"Multi-Period-Daily","description":"Produces different files with multi-period candles and volumes on a daily format.","startMode":{"allMonths":{"run":"false","minYear":"","maxYear":""},"oneMonth":{"run":"false","year":"","month":""},"noTime":{"run":"true"},"fixedInterval":{"run":"false","interval":0}},"deadWaitTime":0,"normalWaitTime":0,"retryWaitTime":10000,"sleepWaitTime":3600000,"comaWaitTime":86400000},"id":"5c56f87a-e3b2-46fc-8e4e-f40c0dacabb5","processOutput":{"type":"Process Output","name":"New Process Output","outputDatasets":[{"type":"Output Dataset","name":"New Output Dataset","id":"f349a029-5381-4f8e-92d4-1b7e7df76966","referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Daily","code":{"codeName":"Multi-Period-Daily"},"parentNode":{"type":"Product Definition","name":"Candles","code":{"codeName":"Candles"},"datasets":[],"parentNode":{"type":"Indicator Bot","name":"Olivia","code":{"codeName":"AAOlivia"},"processes":[],"products":[],"parentNode":{"type":"Team","name":"Masters","code":{"codeName":"AAMasters"},"sensorBots":[],"indicatorBots":[],"tradingBots":[],"plotters":[],"id":"35be7b1c-a0f7-4b5f-9ee1-8fb51595e959"},"id":"30d6289c-4f5c-471e-9d6d-93bfd5453781"},"id":"36ae2d5d-6734-4526-b2f8-31c89a0c4fc1"},"id":"742ab33f-d382-4a40-ab03-42e4f1916cc2"}},{"type":"Output Dataset","name":"New Output Dataset","id":"15fd40ad-ceca-46ea-8fdd-4a396f9bde14","referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Daily","code":{"codeName":"Multi-Period-Daily"},"parentNode":{"type":"Product Definition","name":"Volumes","code":{"codeName":"Volumes"},"datasets":[],"parentNode":{"type":"Indicator Bot","name":"Olivia","code":{"codeName":"AAOlivia"},"processes":[],"products":[],"parentNode":{"type":"Team","name":"Masters","code":{"codeName":"AAMasters"},"sensorBots":[],"indicatorBots":[],"tradingBots":[],"plotters":[],"id":"35be7b1c-a0f7-4b5f-9ee1-8fb51595e959"},"id":"30d6289c-4f5c-471e-9d6d-93bfd5453781"},"id":"b2d5ba69-67ac-490f-9e74-28239b35a92e"},"id":"404b8d12-db14-462c-b4e4-6ee5093560c3"}}],"id":"e130a389-0b18-4433-809d-f44162a00a4a"},"processDependencies":{"type":"Process Dependencies","name":"New Process Dependencies","statusDependencies":[{"type":"Status Dependency","name":"Market Starting Point","code":{"mainUtility":"Market Starting Point"},"id":"93f6d813-594f-49cd-a32f-181a7b8352ee","referenceParent":{"type":"Status Report","name":"New Status Report","parentNode":{"type":"Process Definition","name":"Historic-Trades","code":{"codeName":"Historic-Trades","description":"Retrieves and saves the historical trades in batches going backwards from the current time until reaching the begining of the market.","startMode":{"allMonths":{"run":"false","minYear":"2014","maxYear":"2020"},"oneMonth":{"run":"false","year":"2018","month":"01"},"noTime":{"run":"false"},"fixedInterval":{"run":"false","interval":0}},"deadWaitTime":0,"normalWaitTime":60000,"retryWaitTime":10000,"sleepWaitTime":3600000,"comaWaitTime":86400000},"id":"e2c3f7c3-b74c-4145-8a60-f73cc3364629","parentNode":{"type":"Sensor Bot","name":"Charly","code":{"codeName":"AACharly"},"processes":[],"products":[],"parentNode":{"type":"Team","name":"Masters","code":{"codeName":"AAMasters"},"sensorBots":[],"indicatorBots":[],"tradingBots":[],"plotters":[],"id":"35be7b1c-a0f7-4b5f-9ee1-8fb51595e959"},"id":"957bef47-cd90-4dfa-bbb1-3696c527b010"}},"id":"c542a73e-a350-431f-ad3e-10f3ebef8ec7"}},{"type":"Status Dependency","name":"Self Reference","code":{"mainUtility":"Self Reference"},"id":"cb413af9-e1f6-4dbe-ab8c-9f7eb949bd93","referenceParent":{"type":"Status Report","name":"New Status Report","parentNode":{"type":"Process Definition","name":"Multi-Period-Daily","code":{"codeName":"Multi-Period-Daily","description":"Produces different files with multi-period candles and volumes on a daily format.","startMode":{"allMonths":{"run":"false","minYear":"","maxYear":""},"oneMonth":{"run":"false","year":"","month":""},"noTime":{"run":"true"},"fixedInterval":{"run":"false","interval":0}},"deadWaitTime":0,"normalWaitTime":0,"retryWaitTime":10000,"sleepWaitTime":3600000,"comaWaitTime":86400000},"id":"5c56f87a-e3b2-46fc-8e4e-f40c0dacabb5","parentNode":{"type":"Indicator Bot","name":"Olivia","code":{"codeName":"AAOlivia"},"processes":[],"products":[],"parentNode":{"type":"Team","name":"Masters","code":{"codeName":"AAMasters"},"sensorBots":[],"indicatorBots":[],"tradingBots":[],"plotters":[],"id":"35be7b1c-a0f7-4b5f-9ee1-8fb51595e959"},"id":"30d6289c-4f5c-471e-9d6d-93bfd5453781"}},"id":"973fe943-4d30-49eb-84b3-52f6cd9cdbd1"}},{"type":"Status Dependency","name":"Market Ending Point","code":{"mainUtility":"Market Ending Point"},"id":"fbaa8e58-7e12-48d8-81e5-1050c034c736","referenceParent":{"type":"Status Report","name":"New Status Report","parentNode":{"type":"Process Definition","name":"Single-Period-Daily","code":{"codeName":"Single-Period-Daily","description":"Produces two data-sets with candles and volumes.","startMode":{"allMonths":{"run":"true","minYear":"2019","maxYear":"2019"},"oneMonth":{"run":"false","year":"2018","month":"6"},"noTime":{"run":"false"},"fixedInterval":{"run":"false","interval":0}},"deadWaitTime":0,"normalWaitTime":0,"retryWaitTime":10000,"sleepWaitTime":3600000,"comaWaitTime":86400000},"id":"661e048c-e9e5-435e-bdf9-53dce5ebfa0f","parentNode":{"type":"Indicator Bot","name":"Bruce","code":{"codeName":"AABruce"},"processes":[],"products":[],"parentNode":{"type":"Team","name":"Masters","code":{"codeName":"AAMasters"},"sensorBots":[],"indicatorBots":[],"tradingBots":[],"plotters":[],"id":"35be7b1c-a0f7-4b5f-9ee1-8fb51595e959"},"id":"952e8327-4c9a-422a-bf64-cd773ccc36dd"}},"id":"deaa7a7d-b186-42d8-ad64-aab8a7638ca9"}}],"dataDependencies":[{"type":"Data Dependency","name":"New Data Dependency","id":"c9f72b18-362c-4663-9dab-02b592aba3a1","referenceParent":{"type":"Dataset Definition","name":"One-Min","code":{"codeName":"One-Min"},"parentNode":{"type":"Product Definition","name":"Candles","code":{"codeName":"Candles"},"datasets":[],"parentNode":{"type":"Indicator Bot","name":"Bruce","code":{"codeName":"AABruce"},"processes":[],"products":[],"parentNode":{"type":"Team","name":"Masters","code":{"codeName":"AAMasters"},"sensorBots":[],"indicatorBots":[],"tradingBots":[],"plotters":[],"id":"35be7b1c-a0f7-4b5f-9ee1-8fb51595e959"},"id":"952e8327-4c9a-422a-bf64-cd773ccc36dd"},"id":"3b42a93e-c933-420d-9504-25092a0d1279"},"id":"20d5740b-5711-4b8c-9675-a5391f5ba245"}},{"type":"Data Dependency","name":"New Data Dependency","id":"9aff9fc8-4935-4043-9a95-ee2fe02f2cc1","referenceParent":{"type":"Dataset Definition","name":"One-Min","code":{"codeName":"One-Min"},"parentNode":{"type":"Product Definition","name":"Volumes","code":{"codeName":"Volumes"},"datasets":[],"parentNode":{"type":"Indicator Bot","name":"Bruce","code":{"codeName":"AABruce"},"processes":[],"products":[],"parentNode":{"type":"Team","name":"Masters","code":{"codeName":"AAMasters"},"sensorBots":[],"indicatorBots":[],"tradingBots":[],"plotters":[],"id":"35be7b1c-a0f7-4b5f-9ee1-8fb51595e959"},"id":"952e8327-4c9a-422a-bf64-cd773ccc36dd"},"id":"4e714023-0cfd-4945-a573-52922711cd09"},"id":"2788ed30-ed62-4638-9a1d-35dc7e826870"}}],"id":"dab7d491-7a05-47ac-9f86-a551eb24ef67"},"statusReport":{"type":"Status Report","name":"New Status Report","parentNode":{"type":"Process Definition","name":"Multi-Period-Daily","code":{"codeName":"Multi-Period-Daily","description":"Produces different files with multi-period candles and volumes on a daily format.","startMode":{"allMonths":{"run":"false","minYear":"","maxYear":""},"oneMonth":{"run":"false","year":"","month":""},"noTime":{"run":"true"},"fixedInterval":{"run":"false","interval":0}},"deadWaitTime":0,"normalWaitTime":0,"retryWaitTime":10000,"sleepWaitTime":3600000,"comaWaitTime":86400000},"id":"5c56f87a-e3b2-46fc-8e4e-f40c0dacabb5","parentNode":{"type":"Indicator Bot","name":"Olivia","code":{"codeName":"AAOlivia"},"processes":[],"products":[],"parentNode":{"type":"Team","name":"Masters","code":{"codeName":"AAMasters"},"sensorBots":[],"indicatorBots":[],"tradingBots":[],"plotters":[],"id":"35be7b1c-a0f7-4b5f-9ee1-8fb51595e959"},"id":"30d6289c-4f5c-471e-9d6d-93bfd5453781"}},"id":"973fe943-4d30-49eb-84b3-52f6cd9cdbd1"},"executionStartedEvent":{"type":"Execution Started Event","name":"New Execution Started Event","id":"b83c7f7c-d0c4-4daa-aa6f-41adaa2626b0","referenceParent":{"type":"Execution Finished Event","name":"New Execution Finished Event","id":"f3b263bb-1051-40d8-a69a-d8640cf9afbe","parentNode":{"type":"Process Definition","name":"Single-Period-Daily","id":"661e048c-e9e5-435e-bdf9-53dce5ebfa0f","code":{"codeName":"Single-Period-Daily","description":"Produces two data-sets with candles and volumes.","startMode":{"allMonths":{"run":"true","minYear":"2019","maxYear":"2019"},"oneMonth":{"run":"false","year":"2018","month":"6"},"noTime":{"run":"false"},"fixedInterval":{"run":"false","interval":0}},"deadWaitTime":0,"normalWaitTime":0,"retryWaitTime":10000,"sleepWaitTime":3600000,"comaWaitTime":86400000}}}},"executionFinishedEvent":{"type":"Execution Finished Event","name":"New Execution Finished Event","id":"ac785a4c-9848-4e7e-b2ac-5c3c98defa2f","parentNode":{"type":"Process Definition","name":"Multi-Period-Daily","id":"5c56f87a-e3b2-46fc-8e4e-f40c0dacabb5","code":{"codeName":"Multi-Period-Daily","description":"Produces different files with multi-period candles and volumes on a daily format.","startMode":{"allMonths":{"run":"false","minYear":"","maxYear":""},"oneMonth":{"run":"false","year":"","month":""},"noTime":{"run":"true"},"fixedInterval":{"run":"false","interval":0}},"deadWaitTime":0,"normalWaitTime":0,"retryWaitTime":10000,"sleepWaitTime":3600000,"comaWaitTime":86400000}}},"calculations":{"type":"Calculations Procedure","name":"New Calculations Procedure","id":"522fca96-a4d5-4cba-9271-4e5f66209390"},"dataBuilding":{"type":"Data Building Procedure","name":"New Data Building Procedure","id":"963bf983-f910-4c3e-bdee-b968d56dd155"}}},{"type":"Process Instance","subType":"Indicator Process Instance","name":"Market","code":{"process":"Multi-Period-Market"},"id":"111b43d5-d4ff-414c-8b9f-24f79e2a0254","referenceParent":{"type":"Process Definition","name":"Multi-Period-Market","code":{"codeName":"Multi-Period-Market","description":"Produces different files with multi-period candles and volumes for entire markets.","startMode":{"allMonths":{"run":"false","minYear":"","maxYear":""},"oneMonth":{"run":"false","year":"","month":""},"noTime":{"run":"true"},"fixedInterval":{"run":"false","interval":0}},"deadWaitTime":0,"normalWaitTime":0,"retryWaitTime":10000,"sleepWaitTime":3600000,"comaWaitTime":86400000},"id":"383c3970-13d5-4313-bd8f-7e5d28948577","processOutput":{"type":"Process Output","name":"New Process Output","outputDatasets":[{"type":"Output Dataset","name":"New Output Dataset","id":"7c42483e-6b75-4b61-91c2-597b3fea1aa0","referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Market","code":{"codeName":"Multi-Period-Market"},"parentNode":{"type":"Product Definition","name":"Candles","code":{"codeName":"Candles"},"datasets":[],"parentNode":{"type":"Indicator Bot","name":"Olivia","code":{"codeName":"AAOlivia"},"processes":[],"products":[],"parentNode":{"type":"Team","name":"Masters","code":{"codeName":"AAMasters"},"sensorBots":[],"indicatorBots":[],"tradingBots":[],"plotters":[],"id":"35be7b1c-a0f7-4b5f-9ee1-8fb51595e959"},"id":"30d6289c-4f5c-471e-9d6d-93bfd5453781"},"id":"36ae2d5d-6734-4526-b2f8-31c89a0c4fc1"},"id":"7160ac78-d806-4bac-955b-a201c21c2e7e"}},{"type":"Output Dataset","name":"New Output Dataset","id":"5aa52a69-6139-41c0-bce5-68f1419ab7f2","referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Market","code":{"codeName":"Multi-Period-Market"},"parentNode":{"type":"Product Definition","name":"Volumes","code":{"codeName":"Volumes"},"datasets":[],"parentNode":{"type":"Indicator Bot","name":"Olivia","code":{"codeName":"AAOlivia"},"processes":[],"products":[],"parentNode":{"type":"Team","name":"Masters","code":{"codeName":"AAMasters"},"sensorBots":[],"indicatorBots":[],"tradingBots":[],"plotters":[],"id":"35be7b1c-a0f7-4b5f-9ee1-8fb51595e959"},"id":"30d6289c-4f5c-471e-9d6d-93bfd5453781"},"id":"b2d5ba69-67ac-490f-9e74-28239b35a92e"},"id":"8f6d7c41-f829-4157-8365-707a4789138e"}}],"id":"2912df2e-2d79-4a8b-af79-e79d26be51d0"},"processDependencies":{"type":"Process Dependencies","name":"New Process Dependencies","statusDependencies":[{"type":"Status Dependency","name":"Market Starting Point","code":{"mainUtility":"Market Starting Point"},"id":"92e1f19f-986b-43c8-a742-2b4832e061cc","referenceParent":{"type":"Status Report","name":"New Status Report","parentNode":{"type":"Process Definition","name":"Historic-Trades","code":{"codeName":"Historic-Trades","description":"Retrieves and saves the historical trades in batches going backwards from the current time until reaching the begining of the market.","startMode":{"allMonths":{"run":"false","minYear":"2014","maxYear":"2020"},"oneMonth":{"run":"false","year":"2018","month":"01"},"noTime":{"run":"false"},"fixedInterval":{"run":"false","interval":0}},"deadWaitTime":0,"normalWaitTime":60000,"retryWaitTime":10000,"sleepWaitTime":3600000,"comaWaitTime":86400000},"id":"e2c3f7c3-b74c-4145-8a60-f73cc3364629","parentNode":{"type":"Sensor Bot","name":"Charly","code":{"codeName":"AACharly"},"processes":[],"products":[],"parentNode":{"type":"Team","name":"Masters","code":{"codeName":"AAMasters"},"sensorBots":[],"indicatorBots":[],"tradingBots":[],"plotters":[],"id":"35be7b1c-a0f7-4b5f-9ee1-8fb51595e959"},"id":"957bef47-cd90-4dfa-bbb1-3696c527b010"}},"id":"c542a73e-a350-431f-ad3e-10f3ebef8ec7"}},{"type":"Status Dependency","name":"Market Ending Point","code":{"mainUtility":"Market Ending Point"},"id":"701ead56-8e85-4138-bfe8-263b1d59869d","referenceParent":{"type":"Status Report","name":"New Status Report","parentNode":{"type":"Process Definition","name":"Single-Period-Daily","code":{"codeName":"Single-Period-Daily","description":"Produces two data-sets with candles and volumes.","startMode":{"allMonths":{"run":"true","minYear":"2019","maxYear":"2019"},"oneMonth":{"run":"false","year":"2018","month":"6"},"noTime":{"run":"false"},"fixedInterval":{"run":"false","interval":0}},"deadWaitTime":0,"normalWaitTime":0,"retryWaitTime":10000,"sleepWaitTime":3600000,"comaWaitTime":86400000},"id":"661e048c-e9e5-435e-bdf9-53dce5ebfa0f","parentNode":{"type":"Indicator Bot","name":"Bruce","code":{"codeName":"AABruce"},"processes":[],"products":[],"parentNode":{"type":"Team","name":"Masters","code":{"codeName":"AAMasters"},"sensorBots":[],"indicatorBots":[],"tradingBots":[],"plotters":[],"id":"35be7b1c-a0f7-4b5f-9ee1-8fb51595e959"},"id":"952e8327-4c9a-422a-bf64-cd773ccc36dd"}},"id":"deaa7a7d-b186-42d8-ad64-aab8a7638ca9"}},{"type":"Status Dependency","name":"Self Reference","code":{"mainUtility":"Self Reference"},"id":"757b878a-99bd-402c-bd1c-4ae7961e35bf","referenceParent":{"type":"Status Report","name":"New Status Report","parentNode":{"type":"Process Definition","name":"Multi-Period-Market","code":{"codeName":"Multi-Period-Market","description":"Produces different files with multi-period candles and volumes for entire markets.","startMode":{"allMonths":{"run":"false","minYear":"","maxYear":""},"oneMonth":{"run":"false","year":"","month":""},"noTime":{"run":"true"},"fixedInterval":{"run":"false","interval":0}},"deadWaitTime":0,"normalWaitTime":0,"retryWaitTime":10000,"sleepWaitTime":3600000,"comaWaitTime":86400000},"id":"383c3970-13d5-4313-bd8f-7e5d28948577","parentNode":{"type":"Indicator Bot","name":"Olivia","code":{"codeName":"AAOlivia"},"processes":[],"products":[],"parentNode":{"type":"Team","name":"Masters","code":{"codeName":"AAMasters"},"sensorBots":[],"indicatorBots":[],"tradingBots":[],"plotters":[],"id":"35be7b1c-a0f7-4b5f-9ee1-8fb51595e959"},"id":"30d6289c-4f5c-471e-9d6d-93bfd5453781"}},"id":"4f71d561-5872-4539-8408-f481be275559"}}],"dataDependencies":[{"type":"Data Dependency","name":"New Data Dependency","id":"72f6e0db-ed45-4ee8-aac0-188a7db38c1b","referenceParent":{"type":"Dataset Definition","name":"One-Min","code":{"codeName":"One-Min"},"parentNode":{"type":"Product Definition","name":"Candles","code":{"codeName":"Candles"},"datasets":[],"parentNode":{"type":"Indicator Bot","name":"Bruce","code":{"codeName":"AABruce"},"processes":[],"products":[],"parentNode":{"type":"Team","name":"Masters","code":{"codeName":"AAMasters"},"sensorBots":[],"indicatorBots":[],"tradingBots":[],"plotters":[],"id":"35be7b1c-a0f7-4b5f-9ee1-8fb51595e959"},"id":"952e8327-4c9a-422a-bf64-cd773ccc36dd"},"id":"3b42a93e-c933-420d-9504-25092a0d1279"},"id":"20d5740b-5711-4b8c-9675-a5391f5ba245"}},{"type":"Data Dependency","name":"New Data Dependency","id":"0bcc9ab5-7534-4aae-ab82-5dde001673db","referenceParent":{"type":"Dataset Definition","name":"One-Min","code":{"codeName":"One-Min"},"parentNode":{"type":"Product Definition","name":"Volumes","code":{"codeName":"Volumes"},"datasets":[],"parentNode":{"type":"Indicator Bot","name":"Bruce","code":{"codeName":"AABruce"},"processes":[],"products":[],"parentNode":{"type":"Team","name":"Masters","code":{"codeName":"AAMasters"},"sensorBots":[],"indicatorBots":[],"tradingBots":[],"plotters":[],"id":"35be7b1c-a0f7-4b5f-9ee1-8fb51595e959"},"id":"952e8327-4c9a-422a-bf64-cd773ccc36dd"},"id":"4e714023-0cfd-4945-a573-52922711cd09"},"id":"2788ed30-ed62-4638-9a1d-35dc7e826870"}}],"id":"af72941b-880c-47b4-8a23-fc7279809d4d"},"statusReport":{"type":"Status Report","name":"New Status Report","parentNode":{"type":"Process Definition","name":"Multi-Period-Market","code":{"codeName":"Multi-Period-Market","description":"Produces different files with multi-period candles and volumes for entire markets.","startMode":{"allMonths":{"run":"false","minYear":"","maxYear":""},"oneMonth":{"run":"false","year":"","month":""},"noTime":{"run":"true"},"fixedInterval":{"run":"false","interval":0}},"deadWaitTime":0,"normalWaitTime":0,"retryWaitTime":10000,"sleepWaitTime":3600000,"comaWaitTime":86400000},"id":"383c3970-13d5-4313-bd8f-7e5d28948577","parentNode":{"type":"Indicator Bot","name":"Olivia","code":{"codeName":"AAOlivia"},"processes":[],"products":[],"parentNode":{"type":"Team","name":"Masters","code":{"codeName":"AAMasters"},"sensorBots":[],"indicatorBots":[],"tradingBots":[],"plotters":[],"id":"35be7b1c-a0f7-4b5f-9ee1-8fb51595e959"},"id":"30d6289c-4f5c-471e-9d6d-93bfd5453781"}},"id":"4f71d561-5872-4539-8408-f481be275559"},"executionStartedEvent":{"type":"Execution Started Event","name":"New Execution Started Event","id":"d54f53d2-7a7e-4ff7-afdf-33d25405865c","referenceParent":{"type":"Execution Finished Event","name":"New Execution Finished Event","id":"f3b263bb-1051-40d8-a69a-d8640cf9afbe","parentNode":{"type":"Process Definition","name":"Single-Period-Daily","id":"661e048c-e9e5-435e-bdf9-53dce5ebfa0f","code":{"codeName":"Single-Period-Daily","description":"Produces two data-sets with candles and volumes.","startMode":{"allMonths":{"run":"true","minYear":"2019","maxYear":"2019"},"oneMonth":{"run":"false","year":"2018","month":"6"},"noTime":{"run":"false"},"fixedInterval":{"run":"false","interval":0}},"deadWaitTime":0,"normalWaitTime":0,"retryWaitTime":10000,"sleepWaitTime":3600000,"comaWaitTime":86400000}}}},"executionFinishedEvent":{"type":"Execution Finished Event","name":"New Execution Finished Event","id":"63929f31-bc0f-4d9c-9ddc-3d7e76305e51","parentNode":{"type":"Process Definition","name":"Multi-Period-Market","id":"383c3970-13d5-4313-bd8f-7e5d28948577","code":{"codeName":"Multi-Period-Market","description":"Produces different files with multi-period candles and volumes for entire markets.","startMode":{"allMonths":{"run":"false","minYear":"","maxYear":""},"oneMonth":{"run":"false","year":"","month":""},"noTime":{"run":"true"},"fixedInterval":{"run":"false","interval":0}},"deadWaitTime":0,"normalWaitTime":0,"retryWaitTime":10000,"sleepWaitTime":3600000,"comaWaitTime":86400000}}},"calculations":{"type":"Calculations Procedure","name":"New Calculations Procedure","id":"9cd6a59f-a537-4c58-ac92-915db8416ad5"},"dataBuilding":{"type":"Data Building Procedure","name":"New Data Building Procedure","id":"406ff220-1437-4030-816b-3d1de0988a60"}}}],"id":"1e587326-ad4d-4ea8-9273-367b3009ea3d"},"id":"e4164330-478a-4de8-b3ae-db67225bfa7a"}' try { global.TASK_NODE = JSON.parse(argument)