Merge pull request #974 from Luis-Fernando-Molina/develop
Contribution: Available Workspaces Look and Feel Improved
This commit is contained in:
12 files changed
+645
-141
No files matched your search
@@ -455,10 +455,10 @@
|
||||
"fileName": "DataDependenciesFunctions.js"
|
||||
},
|
||||
{
|
||||
"name": "Data Aggregation Functions",
|
||||
"propertyName": "dataAggregationFunctions",
|
||||
"functionName": "newSuperalgosFunctionLibrariesDataAggregationFunctions",
|
||||
"fileName": "DataAggregationFunctions.js"
|
||||
"name": "From One Min To Multi Period Functions",
|
||||
"propertyName": "fromOneMinToMultiPeriodFunctions",
|
||||
"functionName": "newSuperalgosFunctionLibrariesFromOneMinToMultiPeriodFunctions",
|
||||
"fileName": "FromOneMinToMultiPeriodFunctions.js"
|
||||
},
|
||||
{
|
||||
"name": "Process Files Functions",
|
||||
@@ -497,6 +497,12 @@
|
||||
"propertyName": "docsFunctions",
|
||||
"functionName": "newSuperalgosUtilitiesDocsFunctions",
|
||||
"fileName": "DocsFunctions.js"
|
||||
},
|
||||
{
|
||||
"name": "Error Handling Functions",
|
||||
"propertyName": "errorHandlingFunctions",
|
||||
"functionName": "newSuperalgosUtilitiesErrorHandlingFunctions",
|
||||
"fileName": "ErrorHandlingFunctions.js"
|
||||
}
|
||||
],
|
||||
"taskModules": [
|
||||
|
||||
+101
@@ -0,0 +1,101 @@
|
||||
{
|
||||
"topic": "TS Dataset Type Standard Converter Error",
|
||||
"pageNumber": "1",
|
||||
"type": "TS Dataset Type Standard Convertert Error - Only One Data Dependency Expected",
|
||||
"definition": {
|
||||
"text": "For this type of Dataset conversion, the process needs to have only one Data Dependency defined. Zero or more than one where found. To fix this issue, define only one Data Dependency and try again.",
|
||||
"updated": 1621859784437
|
||||
},
|
||||
"paragraphs": [
|
||||
{
|
||||
"style": "Error",
|
||||
"text": "Only One Data Dependency Expected",
|
||||
"updated": 1621860374194
|
||||
},
|
||||
{
|
||||
"style": "Title",
|
||||
"text": "Error Info"
|
||||
},
|
||||
{
|
||||
"style": "Text",
|
||||
"text": "In the following section, you will find the information recorded when the error occurred."
|
||||
},
|
||||
{
|
||||
"style": "Text",
|
||||
"text": "You will only see the information if you opened this page as a result of the error actually occurring.",
|
||||
"updated": 1611680880668
|
||||
},
|
||||
{
|
||||
"style": "Subtitle",
|
||||
"text": "Error Message"
|
||||
},
|
||||
{
|
||||
"style": "Text",
|
||||
"text": "The following is the Error Message of the Exception that occured at the API Data Fetcher Bot:"
|
||||
},
|
||||
{
|
||||
"style": "Placeholder",
|
||||
"text": "errorMessage"
|
||||
},
|
||||
{
|
||||
"style": "Subtitle",
|
||||
"text": "Error Stack"
|
||||
},
|
||||
{
|
||||
"style": "Text",
|
||||
"text": "The following is the Error Stack of the Exception that occured at the API Data Fetcher Bot:"
|
||||
},
|
||||
{
|
||||
"style": "Placeholder",
|
||||
"text": "errorStack"
|
||||
},
|
||||
{
|
||||
"style": "Subtitle",
|
||||
"text": "Error Code"
|
||||
},
|
||||
{
|
||||
"style": "Text",
|
||||
"text": "The following is the Error Code of the Exception that occured at the API Data Fetcher Bot:"
|
||||
},
|
||||
{
|
||||
"style": "Placeholder",
|
||||
"text": "errorCode"
|
||||
},
|
||||
{
|
||||
"style": "Subtitle",
|
||||
"text": "Error Details"
|
||||
},
|
||||
{
|
||||
"style": "Text",
|
||||
"text": "The following are all the Error details of the Exception that occured at the API Data Fetcher Bot:"
|
||||
},
|
||||
{
|
||||
"style": "Placeholder",
|
||||
"text": "errorDetails"
|
||||
},
|
||||
{
|
||||
"style": "Subtitle",
|
||||
"text": "Node Name"
|
||||
},
|
||||
{
|
||||
"style": "Text",
|
||||
"text": "The following is the node's name of the Node most related to this error:"
|
||||
},
|
||||
{
|
||||
"style": "Placeholder",
|
||||
"text": "nodeName"
|
||||
},
|
||||
{
|
||||
"style": "Subtitle",
|
||||
"text": "Node Code"
|
||||
},
|
||||
{
|
||||
"style": "Text",
|
||||
"text": "The following is the code stored at the node that produced the error at the API Data Fetcher Bot:"
|
||||
},
|
||||
{
|
||||
"style": "Placeholder",
|
||||
"text": "nodeCode"
|
||||
}
|
||||
]
|
||||
}
|
||||
+101
@@ -0,0 +1,101 @@
|
||||
{
|
||||
"topic": "TS Dataset Type Standard Converter Error",
|
||||
"pageNumber": "2",
|
||||
"type": "TS Dataset Type Standard Convertert Error - Only One Output Dataset Expected",
|
||||
"definition": {
|
||||
"text": "For this type of Dataset conversion, the process needs to have only one Output Datasety defined. Zero or more than one where found. To fix this issue, define only one Output Dataset and try again.",
|
||||
"updated": 1621859784437
|
||||
},
|
||||
"paragraphs": [
|
||||
{
|
||||
"style": "Error",
|
||||
"text": "Only One Output Dataset Expected",
|
||||
"updated": 1621860374194
|
||||
},
|
||||
{
|
||||
"style": "Title",
|
||||
"text": "Error Info"
|
||||
},
|
||||
{
|
||||
"style": "Text",
|
||||
"text": "In the following section, you will find the information recorded when the error occurred."
|
||||
},
|
||||
{
|
||||
"style": "Text",
|
||||
"text": "You will only see the information if you opened this page as a result of the error actually occurring.",
|
||||
"updated": 1611680880668
|
||||
},
|
||||
{
|
||||
"style": "Subtitle",
|
||||
"text": "Error Message"
|
||||
},
|
||||
{
|
||||
"style": "Text",
|
||||
"text": "The following is the Error Message of the Exception that occured at the API Data Fetcher Bot:"
|
||||
},
|
||||
{
|
||||
"style": "Placeholder",
|
||||
"text": "errorMessage"
|
||||
},
|
||||
{
|
||||
"style": "Subtitle",
|
||||
"text": "Error Stack"
|
||||
},
|
||||
{
|
||||
"style": "Text",
|
||||
"text": "The following is the Error Stack of the Exception that occured at the API Data Fetcher Bot:"
|
||||
},
|
||||
{
|
||||
"style": "Placeholder",
|
||||
"text": "errorStack"
|
||||
},
|
||||
{
|
||||
"style": "Subtitle",
|
||||
"text": "Error Code"
|
||||
},
|
||||
{
|
||||
"style": "Text",
|
||||
"text": "The following is the Error Code of the Exception that occured at the API Data Fetcher Bot:"
|
||||
},
|
||||
{
|
||||
"style": "Placeholder",
|
||||
"text": "errorCode"
|
||||
},
|
||||
{
|
||||
"style": "Subtitle",
|
||||
"text": "Error Details"
|
||||
},
|
||||
{
|
||||
"style": "Text",
|
||||
"text": "The following are all the Error details of the Exception that occured at the API Data Fetcher Bot:"
|
||||
},
|
||||
{
|
||||
"style": "Placeholder",
|
||||
"text": "errorDetails"
|
||||
},
|
||||
{
|
||||
"style": "Subtitle",
|
||||
"text": "Node Name"
|
||||
},
|
||||
{
|
||||
"style": "Text",
|
||||
"text": "The following is the node's name of the Node most related to this error:"
|
||||
},
|
||||
{
|
||||
"style": "Placeholder",
|
||||
"text": "nodeName"
|
||||
},
|
||||
{
|
||||
"style": "Subtitle",
|
||||
"text": "Node Code"
|
||||
},
|
||||
{
|
||||
"style": "Text",
|
||||
"text": "The following is the code stored at the node that produced the error at the API Data Fetcher Bot:"
|
||||
},
|
||||
{
|
||||
"style": "Placeholder",
|
||||
"text": "nodeCode"
|
||||
}
|
||||
]
|
||||
}
|
||||
+101
@@ -0,0 +1,101 @@
|
||||
{
|
||||
"topic": "TS Dataset Type Standard Converter Error",
|
||||
"pageNumber": "3",
|
||||
"type": "TS Dataset Type Standard Convertert Error - Status Report Is Corrupt",
|
||||
"definition": {
|
||||
"text": "The status report of one of the processes defined as Status Dependencies is corrupt and cannot be read. See below for details.",
|
||||
"updated": 1621859784437
|
||||
},
|
||||
"paragraphs": [
|
||||
{
|
||||
"style": "Error",
|
||||
"text": "Status Report Is Corrupt",
|
||||
"updated": 1621860374194
|
||||
},
|
||||
{
|
||||
"style": "Title",
|
||||
"text": "Error Info"
|
||||
},
|
||||
{
|
||||
"style": "Text",
|
||||
"text": "In the following section, you will find the information recorded when the error occurred."
|
||||
},
|
||||
{
|
||||
"style": "Text",
|
||||
"text": "You will only see the information if you opened this page as a result of the error actually occurring.",
|
||||
"updated": 1611680880668
|
||||
},
|
||||
{
|
||||
"style": "Subtitle",
|
||||
"text": "Error Message"
|
||||
},
|
||||
{
|
||||
"style": "Text",
|
||||
"text": "The following is the Error Message of the Exception that occured at the API Data Fetcher Bot:"
|
||||
},
|
||||
{
|
||||
"style": "Placeholder",
|
||||
"text": "errorMessage"
|
||||
},
|
||||
{
|
||||
"style": "Subtitle",
|
||||
"text": "Error Stack"
|
||||
},
|
||||
{
|
||||
"style": "Text",
|
||||
"text": "The following is the Error Stack of the Exception that occured at the API Data Fetcher Bot:"
|
||||
},
|
||||
{
|
||||
"style": "Placeholder",
|
||||
"text": "errorStack"
|
||||
},
|
||||
{
|
||||
"style": "Subtitle",
|
||||
"text": "Error Code"
|
||||
},
|
||||
{
|
||||
"style": "Text",
|
||||
"text": "The following is the Error Code of the Exception that occured at the API Data Fetcher Bot:"
|
||||
},
|
||||
{
|
||||
"style": "Placeholder",
|
||||
"text": "errorCode"
|
||||
},
|
||||
{
|
||||
"style": "Subtitle",
|
||||
"text": "Error Details"
|
||||
},
|
||||
{
|
||||
"style": "Text",
|
||||
"text": "The following are all the Error details of the Exception that occured at the API Data Fetcher Bot:"
|
||||
},
|
||||
{
|
||||
"style": "Placeholder",
|
||||
"text": "errorDetails"
|
||||
},
|
||||
{
|
||||
"style": "Subtitle",
|
||||
"text": "Node Name"
|
||||
},
|
||||
{
|
||||
"style": "Text",
|
||||
"text": "The following is the node's name of the Node most related to this error:"
|
||||
},
|
||||
{
|
||||
"style": "Placeholder",
|
||||
"text": "nodeName"
|
||||
},
|
||||
{
|
||||
"style": "Subtitle",
|
||||
"text": "Node Code"
|
||||
},
|
||||
{
|
||||
"style": "Text",
|
||||
"text": "The following is the code stored at the node that produced the error at the API Data Fetcher Bot:"
|
||||
},
|
||||
{
|
||||
"style": "Placeholder",
|
||||
"text": "nodeCode"
|
||||
}
|
||||
]
|
||||
}
|
||||
+101
@@ -0,0 +1,101 @@
|
||||
{
|
||||
"topic": "TS Dataset Type Standard Converter Error",
|
||||
"pageNumber": "4",
|
||||
"type": "TS Dataset Type Standard Convertert Error - Get Context Variables Failed",
|
||||
"definition": {
|
||||
"text": "It was not possible to get the context variables needed for running this process. See below for details.",
|
||||
"updated": 1621859784437
|
||||
},
|
||||
"paragraphs": [
|
||||
{
|
||||
"style": "Error",
|
||||
"text": "Get Context Variables Failed",
|
||||
"updated": 1621860374194
|
||||
},
|
||||
{
|
||||
"style": "Title",
|
||||
"text": "Error Info"
|
||||
},
|
||||
{
|
||||
"style": "Text",
|
||||
"text": "In the following section, you will find the information recorded when the error occurred."
|
||||
},
|
||||
{
|
||||
"style": "Text",
|
||||
"text": "You will only see the information if you opened this page as a result of the error actually occurring.",
|
||||
"updated": 1611680880668
|
||||
},
|
||||
{
|
||||
"style": "Subtitle",
|
||||
"text": "Error Message"
|
||||
},
|
||||
{
|
||||
"style": "Text",
|
||||
"text": "The following is the Error Message of the Exception that occured at the API Data Fetcher Bot:"
|
||||
},
|
||||
{
|
||||
"style": "Placeholder",
|
||||
"text": "errorMessage"
|
||||
},
|
||||
{
|
||||
"style": "Subtitle",
|
||||
"text": "Error Stack"
|
||||
},
|
||||
{
|
||||
"style": "Text",
|
||||
"text": "The following is the Error Stack of the Exception that occured at the API Data Fetcher Bot:"
|
||||
},
|
||||
{
|
||||
"style": "Placeholder",
|
||||
"text": "errorStack"
|
||||
},
|
||||
{
|
||||
"style": "Subtitle",
|
||||
"text": "Error Code"
|
||||
},
|
||||
{
|
||||
"style": "Text",
|
||||
"text": "The following is the Error Code of the Exception that occured at the API Data Fetcher Bot:"
|
||||
},
|
||||
{
|
||||
"style": "Placeholder",
|
||||
"text": "errorCode"
|
||||
},
|
||||
{
|
||||
"style": "Subtitle",
|
||||
"text": "Error Details"
|
||||
},
|
||||
{
|
||||
"style": "Text",
|
||||
"text": "The following are all the Error details of the Exception that occured at the API Data Fetcher Bot:"
|
||||
},
|
||||
{
|
||||
"style": "Placeholder",
|
||||
"text": "errorDetails"
|
||||
},
|
||||
{
|
||||
"style": "Subtitle",
|
||||
"text": "Node Name"
|
||||
},
|
||||
{
|
||||
"style": "Text",
|
||||
"text": "The following is the node's name of the Node most related to this error:"
|
||||
},
|
||||
{
|
||||
"style": "Placeholder",
|
||||
"text": "nodeName"
|
||||
},
|
||||
{
|
||||
"style": "Subtitle",
|
||||
"text": "Node Code"
|
||||
},
|
||||
{
|
||||
"style": "Text",
|
||||
"text": "The following is the code stored at the node that produced the error at the API Data Fetcher Bot:"
|
||||
},
|
||||
{
|
||||
"style": "Placeholder",
|
||||
"text": "nodeCode"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -8,7 +8,7 @@ exports.newSuperalgosBotModulesFetchingProcess = function (processIndex) {
|
||||
start: start
|
||||
};
|
||||
|
||||
let fileStorage = TS.projects.superalgos.taskModules.fileStorage.newFileStorage(processIndex);
|
||||
let fileStorage = TS.projects.superalgos.taskModules.fileStorage.newFileStorage(processIndex)
|
||||
let statusDependencies
|
||||
|
||||
return thisObject;
|
||||
@@ -16,19 +16,19 @@ exports.newSuperalgosBotModulesFetchingProcess = function (processIndex) {
|
||||
function initialize(pStatusDependencies, callBackFunction) {
|
||||
try {
|
||||
statusDependencies = pStatusDependencies;
|
||||
callBackFunction(TS.projects.superalgos.globals.standardResponses.DEFAULT_OK_RESPONSE);
|
||||
callBackFunction(TS.projects.superalgos.globals.standardResponses.DEFAULT_OK_RESPONSE)
|
||||
} catch (err) {
|
||||
TS.projects.superalgos.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).UNEXPECTED_ERROR = err
|
||||
TS.projects.superalgos.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).BOT_MAIN_LOOP_LOGGER_MODULE_OBJECT.write(MODULE_NAME,
|
||||
"[ERROR] initialize -> err = " + err.stack);
|
||||
callBackFunction(TS.projects.superalgos.globals.standardResponses.DEFAULT_FAIL_RESPONSE);
|
||||
"[ERROR] initialize -> err = " + err.stack)
|
||||
callBackFunction(TS.projects.superalgos.globals.standardResponses.DEFAULT_FAIL_RESPONSE)
|
||||
}
|
||||
}
|
||||
|
||||
function start(callBackFunction) {
|
||||
try {
|
||||
if (TS.projects.superalgos.globals.taskVariables.IS_TASK_STOPPING === true) {
|
||||
callBackFunction(TS.projects.superalgos.globals.standardResponses.DEFAULT_OK_RESPONSE);
|
||||
callBackFunction(TS.projects.superalgos.globals.standardResponses.DEFAULT_OK_RESPONSE)
|
||||
return
|
||||
}
|
||||
|
||||
@@ -50,8 +50,8 @@ exports.newSuperalgosBotModulesFetchingProcess = function (processIndex) {
|
||||
|
||||
if (statusDependencies.statusReports.get(reportKey).status === "Status Report is corrupt.") {
|
||||
TS.projects.superalgos.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).BOT_MAIN_LOOP_LOGGER_MODULE_OBJECT.write(MODULE_NAME,
|
||||
"[ERROR] start -> getContextVariables -> Can not continue because dependecy Status Report is corrupt. ");
|
||||
callBackFunction(TS.projects.superalgos.globals.standardResponses.DEFAULT_RETRY_RESPONSE);
|
||||
"[ERROR] start -> getContextVariables -> Can not continue because dependecy Status Report is corrupt. ")
|
||||
callBackFunction(TS.projects.superalgos.globals.standardResponses.DEFAULT_RETRY_RESPONSE)
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -61,14 +61,14 @@ exports.newSuperalgosBotModulesFetchingProcess = function (processIndex) {
|
||||
} catch (err) {
|
||||
TS.projects.superalgos.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).UNEXPECTED_ERROR = err
|
||||
TS.projects.superalgos.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).BOT_MAIN_LOOP_LOGGER_MODULE_OBJECT.write(MODULE_NAME,
|
||||
"[ERROR] start -> getContextVariables -> err = " + err.stack);
|
||||
"[ERROR] start -> getContextVariables -> err = " + err.stack)
|
||||
if (err.message === "Cannot read property 'file' of undefined") {
|
||||
TS.projects.superalgos.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).BOT_MAIN_LOOP_LOGGER_MODULE_OBJECT.write(MODULE_NAME,
|
||||
"[HINT] start -> getContextVariables -> Check the bot Status Dependencies. ");
|
||||
"[HINT] start -> getContextVariables -> Check the bot Status Dependencies. ")
|
||||
TS.projects.superalgos.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).BOT_MAIN_LOOP_LOGGER_MODULE_OBJECT.write(MODULE_NAME,
|
||||
"[HINT] start -> getContextVariables -> Dependencies loaded -> keys = " + JSON.stringify(statusDependencies.keys));
|
||||
"[HINT] start -> getContextVariables -> Dependencies loaded -> keys = " + JSON.stringify(statusDependencies.keys))
|
||||
}
|
||||
callBackFunction(TS.projects.superalgos.globals.standardResponses.DEFAULT_FAIL_RESPONSE);
|
||||
callBackFunction(TS.projects.superalgos.globals.standardResponses.DEFAULT_FAIL_RESPONSE)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -77,7 +77,10 @@ exports.newSuperalgosBotModulesFetchingProcess = function (processIndex) {
|
||||
processNode = TS.projects.superalgos.globals.taskConstants.TASK_NODE.bot.processes[processIndex].referenceParent
|
||||
|
||||
if (TS.projects.superalgos.globals.taskConstants.TASK_NODE.bot.processes[processIndex].apiMapReference === undefined) {
|
||||
throwHandledException(
|
||||
TS.projects.superalgos.utilities.errorHandlingFunctions.throwHandledException(
|
||||
processIndex,
|
||||
MODULE_NAME,
|
||||
'API Data Fetcher Bot',
|
||||
undefined,
|
||||
'API Map Reference Node Missing',
|
||||
TS.projects.superalgos.globals.taskConstants.TASK_NODE.bot.processes[processIndex]
|
||||
@@ -86,7 +89,10 @@ exports.newSuperalgosBotModulesFetchingProcess = function (processIndex) {
|
||||
|
||||
let apiMap = TS.projects.superalgos.globals.taskConstants.TASK_NODE.bot.processes[processIndex].apiMapReference.referenceParent
|
||||
if (apiMap === undefined) {
|
||||
throwHandledException(
|
||||
TS.projects.superalgos.utilities.errorHandlingFunctions.throwHandledException(
|
||||
processIndex,
|
||||
MODULE_NAME,
|
||||
'API Data Fetcher Bot',
|
||||
undefined,
|
||||
'Reference Parent Missing',
|
||||
TS.projects.superalgos.globals.taskConstants.TASK_NODE.bot.processes[processIndex].apiMapReference
|
||||
@@ -99,8 +105,11 @@ exports.newSuperalgosBotModulesFetchingProcess = function (processIndex) {
|
||||
let protocol = "https" // default value
|
||||
|
||||
if (apiMap.config.hostName === undefined || apiMap.config.hostName === "") {
|
||||
throwHandledException(
|
||||
{missingProperty: "hostName"},
|
||||
TS.projects.superalgos.utilities.errorHandlingFunctions.throwHandledException(
|
||||
processIndex,
|
||||
MODULE_NAME,
|
||||
'API Data Fetcher Bot',
|
||||
{ missingProperty: "hostName" },
|
||||
'Config Property Missing',
|
||||
apiMap
|
||||
)
|
||||
@@ -121,14 +130,20 @@ exports.newSuperalgosBotModulesFetchingProcess = function (processIndex) {
|
||||
}
|
||||
|
||||
if (apiMap.apiVersions.length === 0) {
|
||||
throwHandledException(
|
||||
TS.projects.superalgos.utilities.errorHandlingFunctions.throwHandledException(
|
||||
processIndex,
|
||||
MODULE_NAME,
|
||||
'API Data Fetcher Bot',
|
||||
undefined,
|
||||
'API Version Node Missing',
|
||||
apiMap
|
||||
)
|
||||
}
|
||||
if (processNode.processOutput === undefined) {
|
||||
throwHandledException(
|
||||
TS.projects.superalgos.utilities.errorHandlingFunctions.throwHandledException(
|
||||
processIndex,
|
||||
MODULE_NAME,
|
||||
'API Data Fetcher Bot',
|
||||
undefined,
|
||||
'Process Output Node Missing',
|
||||
processNode
|
||||
@@ -188,7 +203,10 @@ exports.newSuperalgosBotModulesFetchingProcess = function (processIndex) {
|
||||
to a certain enpoint.
|
||||
*/
|
||||
if (endpointNodeFound === undefined) {
|
||||
throwHandledException(
|
||||
TS.projects.superalgos.utilities.errorHandlingFunctions.throwHandledException(
|
||||
processIndex,
|
||||
MODULE_NAME,
|
||||
'API Data Fetcher Bot',
|
||||
undefined,
|
||||
'API Response Field Not Descendant From Endpoint',
|
||||
apiResponseField
|
||||
@@ -207,7 +225,10 @@ exports.newSuperalgosBotModulesFetchingProcess = function (processIndex) {
|
||||
/*
|
||||
We can not reference fields from different enpoints.
|
||||
*/
|
||||
throwHandledException(
|
||||
TS.projects.superalgos.utilities.errorHandlingFunctions.throwHandledException(
|
||||
processIndex,
|
||||
MODULE_NAME,
|
||||
'API Data Fetcher Bot',
|
||||
undefined,
|
||||
'More Than Two Endpoints Detected',
|
||||
apiResponseField
|
||||
@@ -223,7 +244,10 @@ exports.newSuperalgosBotModulesFetchingProcess = function (processIndex) {
|
||||
has an API Response Field Reference child, and that this one is referencing an
|
||||
API Response Field.
|
||||
*/
|
||||
throwHandledException(
|
||||
TS.projects.superalgos.utilities.errorHandlingFunctions.throwHandledException(
|
||||
processIndex,
|
||||
MODULE_NAME,
|
||||
'API Data Fetcher Bot',
|
||||
undefined,
|
||||
'API Endpoint Not Found',
|
||||
productDefinition.record
|
||||
@@ -403,8 +427,8 @@ exports.newSuperalgosBotModulesFetchingProcess = function (processIndex) {
|
||||
|
||||
function sleep(ms) {
|
||||
return new Promise((resolve) => {
|
||||
setTimeout(resolve, ms);
|
||||
});
|
||||
setTimeout(resolve, ms)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@@ -414,7 +438,7 @@ exports.newSuperalgosBotModulesFetchingProcess = function (processIndex) {
|
||||
Now that we have the endpointNode, the parameters and all the information
|
||||
needed to place the call to the API.
|
||||
*/
|
||||
let httpClient = require('https');
|
||||
let httpClient = require('https')
|
||||
let url = protocol + '://' +
|
||||
hostName +
|
||||
portNumber +
|
||||
@@ -453,7 +477,10 @@ exports.newSuperalgosBotModulesFetchingProcess = function (processIndex) {
|
||||
|
||||
if (apiResponseSchemaNode === undefined) {
|
||||
errorCodeReceived = true
|
||||
throwHandledException(
|
||||
TS.projects.superalgos.utilities.errorHandlingFunctions.throwHandledException(
|
||||
processIndex,
|
||||
MODULE_NAME,
|
||||
'API Data Fetcher Bot',
|
||||
{ resposeCodeReceived: response.statusCode, detais: 'The response code ' + response.statusCode + ' received is not associated with any API Query Response node.' },
|
||||
'Unexpected API Response Code',
|
||||
endpointNode
|
||||
@@ -486,7 +513,7 @@ exports.newSuperalgosBotModulesFetchingProcess = function (processIndex) {
|
||||
if (apiQueryResponse.config.isError === true) {
|
||||
errorCodeReceived = true
|
||||
TS.projects.superalgos.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).BOT_MAIN_LOOP_LOGGER_MODULE_OBJECT.write(MODULE_NAME,
|
||||
"[WARN] start -> startProcess -> fetchAllPages -> fetchAPIData -> onResponse -> getApiResponseSchema -> API Response is an Error -> responseCode = " + responseCode);
|
||||
"[WARN] start -> startProcess -> fetchAllPages -> fetchAPIData -> onResponse -> getApiResponseSchema -> API Response is an Error -> responseCode = " + responseCode)
|
||||
}
|
||||
return
|
||||
}
|
||||
@@ -516,7 +543,7 @@ exports.newSuperalgosBotModulesFetchingProcess = function (processIndex) {
|
||||
*/
|
||||
if (apiResponseReceivedText.substring(0, 1) !== "{") {
|
||||
TS.projects.superalgos.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).BOT_MAIN_LOOP_LOGGER_MODULE_OBJECT.write(MODULE_NAME,
|
||||
"[WARN] start -> startProcess -> fetchAllPages -> fetchAPIData -> onResponse -> onEnd -> Unexpected Response. Not an JSON Object. -> apiResponseReceivedText = " + apiResponseReceivedText);
|
||||
"[WARN] start -> startProcess -> fetchAllPages -> fetchAPIData -> onResponse -> onEnd -> Unexpected Response. Not an JSON Object. -> apiResponseReceivedText = " + apiResponseReceivedText)
|
||||
resolve('UNEXPECTED_API_RESPONSE')
|
||||
return
|
||||
}
|
||||
@@ -529,7 +556,7 @@ exports.newSuperalgosBotModulesFetchingProcess = function (processIndex) {
|
||||
*/
|
||||
if (apiResponseReceivedText.substring(0, 1) !== "[") {
|
||||
TS.projects.superalgos.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).BOT_MAIN_LOOP_LOGGER_MODULE_OBJECT.write(MODULE_NAME,
|
||||
"[WARN] start -> startProcess -> fetchAllPages -> fetchAPIData -> onResponse -> onEnd -> Unexpected Response. Not an Array with Data. -> apiResponseReceivedText = " + apiResponseReceivedText);
|
||||
"[WARN] start -> startProcess -> fetchAllPages -> fetchAPIData -> onResponse -> onEnd -> Unexpected Response. Not an Array with Data. -> apiResponseReceivedText = " + apiResponseReceivedText)
|
||||
resolve('UNEXPECTED_API_RESPONSE')
|
||||
return
|
||||
}
|
||||
@@ -576,8 +603,11 @@ exports.newSuperalgosBotModulesFetchingProcess = function (processIndex) {
|
||||
break
|
||||
}
|
||||
default: {
|
||||
throwHandledException(
|
||||
{ datasetType: dataset.config.codeName},
|
||||
TS.projects.superalgos.utilities.errorHandlingFunctions.throwHandledException(
|
||||
processIndex,
|
||||
MODULE_NAME,
|
||||
'API Data Fetcher Bot',
|
||||
{ datasetType: dataset.config.codeName },
|
||||
'Unsupported Dataset Type',
|
||||
dataset
|
||||
)
|
||||
@@ -755,7 +785,10 @@ exports.newSuperalgosBotModulesFetchingProcess = function (processIndex) {
|
||||
/*
|
||||
There must be a Record Property with codeName 'timestamp' defined.
|
||||
*/
|
||||
throwHandledException(
|
||||
TS.projects.superalgos.utilities.errorHandlingFunctions.throwHandledException(
|
||||
processIndex,
|
||||
MODULE_NAME,
|
||||
'API Data Fetcher Bot',
|
||||
undefined,
|
||||
'Timestamp Record Property Missing',
|
||||
productDefinition.record
|
||||
@@ -782,7 +815,7 @@ exports.newSuperalgosBotModulesFetchingProcess = function (processIndex) {
|
||||
|
||||
if (response.err !== undefined && response.err.result !== TS.projects.superalgos.globals.standardResponses.DEFAULT_OK_RESPONSE.result) {
|
||||
TS.projects.superalgos.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).BOT_MAIN_LOOP_LOGGER_MODULE_OBJECT.write(MODULE_NAME,
|
||||
"[ERROR] start -> startProcess -> readDatasetFile -> Could read file. -> filePath = " + filePath + "/" + fileName);
|
||||
"[ERROR] start -> startProcess -> readDatasetFile -> Could read file. -> filePath = " + filePath + "/" + fileName)
|
||||
throw (response.err)
|
||||
} else {
|
||||
existingFileContent = text
|
||||
@@ -801,11 +834,11 @@ exports.newSuperalgosBotModulesFetchingProcess = function (processIndex) {
|
||||
let fileName = 'Data.json'
|
||||
let filePath = TS.projects.superalgos.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).FILE_PATH_ROOT +
|
||||
"/Output/" + productDefinition.config.codeName + "/" + outputDataset.referenceParent.config.codeName + extraFilePath
|
||||
let response = await fileStorage.asyncCreateTextFile(filePath + '/' + fileName, existingFileContent + '\n');
|
||||
let response = await fileStorage.asyncCreateTextFile(filePath + '/' + fileName, existingFileContent + '\n')
|
||||
|
||||
if (response.err !== undefined && response.err.result !== TS.projects.superalgos.globals.standardResponses.DEFAULT_OK_RESPONSE.result) {
|
||||
TS.projects.superalgos.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).BOT_MAIN_LOOP_LOGGER_MODULE_OBJECT.write(MODULE_NAME,
|
||||
"[ERROR] start -> startProcess -> saveDatasetFile -> Could not save file. -> filePath = " + filePath + "/" + fileName);
|
||||
"[ERROR] start -> startProcess -> saveDatasetFile -> Could not save file. -> filePath = " + filePath + "/" + fileName)
|
||||
throw (response.err)
|
||||
}
|
||||
}
|
||||
@@ -877,8 +910,8 @@ exports.newSuperalgosBotModulesFetchingProcess = function (processIndex) {
|
||||
} catch (err) {
|
||||
TS.projects.superalgos.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).UNEXPECTED_ERROR = err
|
||||
TS.projects.superalgos.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).BOT_MAIN_LOOP_LOGGER_MODULE_OBJECT.write(MODULE_NAME,
|
||||
"[ERROR] start -> startProcess -> err = " + err.stack);
|
||||
callBackFunction(TS.projects.superalgos.globals.standardResponses.DEFAULT_FAIL_RESPONSE);
|
||||
"[ERROR] start -> startProcess -> err = " + err.stack)
|
||||
callBackFunction(TS.projects.superalgos.globals.standardResponses.DEFAULT_FAIL_RESPONSE)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -900,61 +933,24 @@ exports.newSuperalgosBotModulesFetchingProcess = function (processIndex) {
|
||||
function onSaved(err) {
|
||||
if (err.result !== TS.projects.superalgos.globals.standardResponses.DEFAULT_OK_RESPONSE.result) {
|
||||
TS.projects.superalgos.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).BOT_MAIN_LOOP_LOGGER_MODULE_OBJECT.write(MODULE_NAME,
|
||||
"[ERROR] start -> writeStatusReport -> onSaved -> err = " + err.stack);
|
||||
callBackFunction(err);
|
||||
"[ERROR] start -> writeStatusReport -> onSaved -> err = " + err.stack)
|
||||
callBackFunction(err)
|
||||
return;
|
||||
}
|
||||
callBackFunction(TS.projects.superalgos.globals.standardResponses.DEFAULT_OK_RESPONSE);
|
||||
callBackFunction(TS.projects.superalgos.globals.standardResponses.DEFAULT_OK_RESPONSE)
|
||||
}
|
||||
} catch (err) {
|
||||
TS.projects.superalgos.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).UNEXPECTED_ERROR = err
|
||||
TS.projects.superalgos.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).BOT_MAIN_LOOP_LOGGER_MODULE_OBJECT.write(MODULE_NAME,
|
||||
"[ERROR] start -> writeStatusReport -> err = " + err.stack);
|
||||
callBackFunction(TS.projects.superalgos.globals.standardResponses.DEFAULT_FAIL_RESPONSE);
|
||||
"[ERROR] start -> writeStatusReport -> err = " + err.stack)
|
||||
callBackFunction(TS.projects.superalgos.globals.standardResponses.DEFAULT_FAIL_RESPONSE)
|
||||
}
|
||||
}
|
||||
} catch (err) {
|
||||
TS.projects.superalgos.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).UNEXPECTED_ERROR = err
|
||||
TS.projects.superalgos.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).BOT_MAIN_LOOP_LOGGER_MODULE_OBJECT.write(MODULE_NAME,
|
||||
"[ERROR] start -> err = " + err.stack);
|
||||
callBackFunction(TS.projects.superalgos.globals.standardResponses.DEFAULT_FAIL_RESPONSE);
|
||||
"[ERROR] start -> err = " + err.stack)
|
||||
callBackFunction(TS.projects.superalgos.globals.standardResponses.DEFAULT_FAIL_RESPONSE)
|
||||
}
|
||||
}
|
||||
function throwHandledException(
|
||||
err,
|
||||
message,
|
||||
node
|
||||
) {
|
||||
if (err === undefined) {
|
||||
err = {
|
||||
message: message
|
||||
}
|
||||
}
|
||||
/*
|
||||
This is what the Docs Space will get.
|
||||
*/
|
||||
let docs = {
|
||||
project: 'Superalgos',
|
||||
category: 'Topic',
|
||||
type: 'TS API Data Fetcher Bot Error - ' + message,
|
||||
placeholder: {}
|
||||
}
|
||||
TS.projects.superalgos.utilities.docsFunctions.buildPlaceholder(
|
||||
docs,
|
||||
err,
|
||||
node.name,
|
||||
node.code,
|
||||
node.config,
|
||||
node.value,
|
||||
err
|
||||
)
|
||||
/*
|
||||
This will be needed for the process level error handling. Must be added
|
||||
here after the buildPlaceholder function call.
|
||||
*/
|
||||
err.docs = docs
|
||||
err.node = node
|
||||
|
||||
throw (err)
|
||||
}
|
||||
}
|
||||
@@ -15,7 +15,7 @@ exports.newSuperalgosBotModulesFromOneMinToMultiPeriodDaily = function (processI
|
||||
Everytime this process runs, it will be able to resume its job and process everything pending until
|
||||
reaching the head of the market.
|
||||
*/
|
||||
const MODULE_NAME = "From One Min To Multi Period Market"
|
||||
const MODULE_NAME = "From One Min To Multi Period Daily"
|
||||
|
||||
let thisObject = {
|
||||
initialize: initialize,
|
||||
@@ -35,7 +35,7 @@ exports.newSuperalgosBotModulesFromOneMinToMultiPeriodDaily = function (processI
|
||||
|
||||
statusDependenciesModule = pStatusDependencies
|
||||
dataDependenciesModule = pDataDependencies
|
||||
TS.projects.superalgos.functionLibraries.dataAggregationFunctions.checkForKnownConstraints(
|
||||
TS.projects.superalgos.functionLibraries.fromOneMinToMultiPeriodFunctions.checkForKnownConstraints(
|
||||
dataDependenciesModule,
|
||||
node,
|
||||
processIndex,
|
||||
@@ -62,7 +62,7 @@ exports.newSuperalgosBotModulesFromOneMinToMultiPeriodDaily = function (processI
|
||||
beginingOfMarket: undefined // Datetime of the begining of the market.
|
||||
}
|
||||
|
||||
TS.projects.superalgos.functionLibraries.dataAggregationFunctions.getContextVariables(
|
||||
TS.projects.superalgos.functionLibraries.fromOneMinToMultiPeriodFunctions.getContextVariables(
|
||||
statusDependenciesModule,
|
||||
contextVariables,
|
||||
buildOutput,
|
||||
@@ -88,7 +88,7 @@ exports.newSuperalgosBotModulesFromOneMinToMultiPeriodDaily = function (processI
|
||||
moveToNextDay()
|
||||
|
||||
function moveToNextDay() {
|
||||
TS.projects.superalgos.functionLibraries.dataAggregationFunctions.advanceTime(
|
||||
TS.projects.superalgos.functionLibraries.fromOneMinToMultiPeriodFunctions.advanceTime(
|
||||
fromDate,
|
||||
lastDate,
|
||||
contextVariables,
|
||||
@@ -115,7 +115,7 @@ exports.newSuperalgosBotModulesFromOneMinToMultiPeriodDaily = function (processI
|
||||
at each pass, we will read one of Exchange Raw Data's daily files and
|
||||
add all its elements to our in memory arrays.
|
||||
*/
|
||||
TS.projects.superalgos.functionLibraries.dataAggregationFunctions.nextDependencyDailyFile(
|
||||
TS.projects.superalgos.functionLibraries.fromOneMinToMultiPeriodFunctions.nextDependencyDailyFile(
|
||||
contextVariables,
|
||||
node,
|
||||
aggregateAndWriteOutputFile,
|
||||
@@ -129,7 +129,7 @@ exports.newSuperalgosBotModulesFromOneMinToMultiPeriodDaily = function (processI
|
||||
Here we call the function that will aggregate all the information
|
||||
at the dependency file into standarized begin-end-elements.
|
||||
*/
|
||||
TS.projects.superalgos.functionLibraries.dataAggregationFunctions.aggregateFileContent(
|
||||
TS.projects.superalgos.functionLibraries.fromOneMinToMultiPeriodFunctions.aggregateFileContent(
|
||||
node,
|
||||
contextVariables,
|
||||
dependencyDailyFile,
|
||||
@@ -144,7 +144,7 @@ exports.newSuperalgosBotModulesFromOneMinToMultiPeriodDaily = function (processI
|
||||
Here we will write the contents of the file to disk.
|
||||
*/
|
||||
try {
|
||||
let fileContent = TS.projects.superalgos.functionLibraries.dataAggregationFunctions.generateOutputFileContent(
|
||||
let fileContent = TS.projects.superalgos.functionLibraries.fromOneMinToMultiPeriodFunctions.generateOutputFileContent(
|
||||
node,
|
||||
outputElementsCurrentTimeFrame
|
||||
)
|
||||
@@ -209,7 +209,7 @@ exports.newSuperalgosBotModulesFromOneMinToMultiPeriodDaily = function (processI
|
||||
if (timeFrameArrayIndex < TS.projects.superalgos.globals.timeFrames.dailyTimeFramesArray().length) {
|
||||
loopBody()
|
||||
} else {
|
||||
TS.projects.superalgos.functionLibraries.dataAggregationFunctions.writeStatusReport(
|
||||
TS.projects.superalgos.functionLibraries.fromOneMinToMultiPeriodFunctions.writeStatusReport(
|
||||
statusDependenciesModule,
|
||||
contextVariables,
|
||||
contextVariables.datetimeLastProducedFile,
|
||||
|
||||
@@ -43,7 +43,7 @@ exports.newSuperalgosBotModulesFromOneMinToMultiPeriodMarket = function (process
|
||||
|
||||
statusDependenciesModule = pStatusDependencies
|
||||
dataDependenciesModule = pDataDependencies
|
||||
TS.projects.superalgos.functionLibraries.dataAggregationFunctions.checkForKnownConstraints(
|
||||
TS.projects.superalgos.functionLibraries.fromOneMinToMultiPeriodFunctions.checkForKnownConstraints(
|
||||
dataDependenciesModule,
|
||||
node,
|
||||
processIndex,
|
||||
@@ -70,7 +70,7 @@ exports.newSuperalgosBotModulesFromOneMinToMultiPeriodMarket = function (process
|
||||
beginingOfMarket: undefined // Datetime of the begining of the market.
|
||||
}
|
||||
|
||||
TS.projects.superalgos.functionLibraries.dataAggregationFunctions.getContextVariables(
|
||||
TS.projects.superalgos.functionLibraries.fromOneMinToMultiPeriodFunctions.getContextVariables(
|
||||
statusDependenciesModule,
|
||||
contextVariables,
|
||||
loadExistingFiles,
|
||||
@@ -175,7 +175,7 @@ exports.newSuperalgosBotModulesFromOneMinToMultiPeriodMarket = function (process
|
||||
moveToNextDay()
|
||||
|
||||
function moveToNextDay() {
|
||||
TS.projects.superalgos.functionLibraries.dataAggregationFunctions.advanceTime(
|
||||
TS.projects.superalgos.functionLibraries.fromOneMinToMultiPeriodFunctions.advanceTime(
|
||||
fromDate,
|
||||
lastDate,
|
||||
contextVariables,
|
||||
@@ -235,7 +235,7 @@ exports.newSuperalgosBotModulesFromOneMinToMultiPeriodMarket = function (process
|
||||
allPreviousElements[timeFrameArrayIndex] = [] // erasing these so as not to duplicate them.
|
||||
}
|
||||
|
||||
TS.projects.superalgos.functionLibraries.dataAggregationFunctions.nextDependencyDailyFile(
|
||||
TS.projects.superalgos.functionLibraries.fromOneMinToMultiPeriodFunctions.nextDependencyDailyFile(
|
||||
contextVariables,
|
||||
node,
|
||||
aggregateAndWriteOutputFile,
|
||||
@@ -249,7 +249,7 @@ exports.newSuperalgosBotModulesFromOneMinToMultiPeriodMarket = function (process
|
||||
Here we call the function that will aggregate all the information
|
||||
at the dependency file into standarized begin-end-elements.
|
||||
*/
|
||||
TS.projects.superalgos.functionLibraries.dataAggregationFunctions.aggregateFileContent(
|
||||
TS.projects.superalgos.functionLibraries.fromOneMinToMultiPeriodFunctions.aggregateFileContent(
|
||||
node,
|
||||
contextVariables,
|
||||
dependencyDailyFile,
|
||||
@@ -264,7 +264,7 @@ exports.newSuperalgosBotModulesFromOneMinToMultiPeriodMarket = function (process
|
||||
Here we will write the contents of the file to disk.
|
||||
*/
|
||||
try {
|
||||
let fileContent = TS.projects.superalgos.functionLibraries.dataAggregationFunctions.generateOutputFileContent(
|
||||
let fileContent = TS.projects.superalgos.functionLibraries.fromOneMinToMultiPeriodFunctions.generateOutputFileContent(
|
||||
node,
|
||||
outputElementsCurrentTimeFrame
|
||||
)
|
||||
@@ -314,7 +314,7 @@ exports.newSuperalgosBotModulesFromOneMinToMultiPeriodMarket = function (process
|
||||
if (timeFrameArrayIndex < TS.projects.superalgos.globals.timeFrames.marketTimeFramesArray().length) {
|
||||
loopBody()
|
||||
} else {
|
||||
TS.projects.superalgos.functionLibraries.dataAggregationFunctions.writeStatusReport(
|
||||
TS.projects.superalgos.functionLibraries.fromOneMinToMultiPeriodFunctions.writeStatusReport(
|
||||
statusDependenciesModule,
|
||||
contextVariables,
|
||||
contextVariables.datetimeLastProducedFile,
|
||||
|
||||
+60
-36
@@ -1,11 +1,11 @@
|
||||
exports.newSuperalgosFunctionLibrariesDataAggregationFunctions = function () {
|
||||
exports.newSuperalgosFunctionLibrariesFromOneMinToMultiPeriodFunctions = function () {
|
||||
/*
|
||||
This module contains the functions to aggregate data into elements with
|
||||
begin and end properties. It is used by both the One Min to Market
|
||||
and One Min to Daily frameworks as a common place to haave functions
|
||||
used at both of them.
|
||||
*/
|
||||
const MODULE_NAME = "Data Aggregation Functions"
|
||||
const MODULE_NAME = "From One Min To Multi Period Functions"
|
||||
|
||||
let thisObject = {
|
||||
checkForKnownConstraints: checkForKnownConstraints,
|
||||
@@ -36,10 +36,14 @@ exports.newSuperalgosFunctionLibrariesDataAggregationFunctions = function () {
|
||||
is not to merge information and splitted into multiple outputs.
|
||||
*/
|
||||
if (dataDependenciesModule.curatedDependencyNodeArray.length !== 1) {
|
||||
TS.projects.superalgos.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).BOT_MAIN_LOOP_LOGGER_MODULE_OBJECT.write(MODULE_NAME,
|
||||
"[ERROR] checkForKnownConstraints -> Validation Check Not Passed -> Expecting only one Data Dependency. Found = " + dataDependenciesModule.curatedDependencyNodeArray.length)
|
||||
callBackFunction(TS.projects.superalgos.globals.standardResponses.DEFAULT_FAIL_RESPONSE)
|
||||
return
|
||||
TS.projects.superalgos.utilities.errorHandlingFunctions.throwHandledException(
|
||||
processIndex,
|
||||
MODULE_NAME,
|
||||
'Dataset Type Standard Converter',
|
||||
{ errorDetails: "checkForKnownConstraints -> Validation Check Not Passed -> Expecting only one Data Dependency. Found = " + dataDependenciesModule.curatedDependencyNodeArray.length },
|
||||
'Only One Data Dependency Expected',
|
||||
TS.projects.superalgos.globals.taskConstants.TASK_NODE.bot.processes[processIndex].referenceParent.processDependencies
|
||||
)
|
||||
} else {
|
||||
node.dataDependency = dataDependenciesModule.curatedDependencyNodeArray[0]
|
||||
}
|
||||
@@ -49,10 +53,14 @@ exports.newSuperalgosFunctionLibrariesDataAggregationFunctions = function () {
|
||||
)
|
||||
|
||||
if (outputDatasets.length !== 1) {
|
||||
TS.projects.superalgos.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).BOT_MAIN_LOOP_LOGGER_MODULE_OBJECT.write(MODULE_NAME,
|
||||
"[ERROR] checkForKnownConstraints -> Validation Check Not Passed -> Expecting only one Output Dataset. Found = " + outputDatasets.length)
|
||||
callBackFunction(TS.projects.superalgos.globals.standardResponses.DEFAULT_FAIL_RESPONSE)
|
||||
return
|
||||
TS.projects.superalgos.utilities.errorHandlingFunctions.throwHandledException(
|
||||
processIndex,
|
||||
MODULE_NAME,
|
||||
'Dataset Type Standard Converter',
|
||||
{ errorDetails: "checkForKnownConstraints -> Validation Check Not Passed -> Expecting only one Output Dataset. Found = " + outputDatasets.length },
|
||||
'Only One Output Dataset Expected',
|
||||
TS.projects.superalgos.globals.taskConstants.TASK_NODE.bot.processes[processIndex].referenceParent.processOutput
|
||||
)
|
||||
} else {
|
||||
node.outputDataset = outputDatasets[0]
|
||||
}
|
||||
@@ -90,10 +98,14 @@ exports.newSuperalgosFunctionLibrariesDataAggregationFunctions = function () {
|
||||
}
|
||||
|
||||
if (statusReport.status === "Status Report is corrupt.") {
|
||||
TS.projects.superalgos.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).BOT_MAIN_LOOP_LOGGER_MODULE_OBJECT.write(MODULE_NAME,
|
||||
"[ERROR] getContextVariables -> detectWhereTheMarketBegins-> Can not continue because dependecy Status Report is corrupt. ")
|
||||
callBackFunction(TS.projects.superalgos.globals.standardResponses.DEFAULT_RETRY_RESPONSE)
|
||||
return
|
||||
TS.projects.superalgos.utilities.errorHandlingFunctions.throwHandledException(
|
||||
processIndex,
|
||||
MODULE_NAME,
|
||||
'Dataset Type Standard Converter',
|
||||
{ errorDetails: "getContextVariables -> detectWhereTheMarketBegins -> Can not continue because dependecy Status Report is corrupt. " },
|
||||
'Status Report Is Corrupt',
|
||||
TS.projects.superalgos.globals.taskConstants.TASK_NODE.bot.processes[processIndex].referenceParent.processOutput
|
||||
)
|
||||
}
|
||||
|
||||
thisReport = statusReport.file
|
||||
@@ -131,10 +143,14 @@ exports.newSuperalgosFunctionLibrariesDataAggregationFunctions = function () {
|
||||
}
|
||||
|
||||
if (statusReport.status === "Status Report is corrupt.") {
|
||||
TS.projects.superalgos.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).BOT_MAIN_LOOP_LOGGER_MODULE_OBJECT.write(MODULE_NAME,
|
||||
"[ERROR] getContextVariables -> detectWhereTheMarketEnds-> Can not continue because dependecy Status Report is corrupt. ")
|
||||
callBackFunction(TS.projects.superalgos.globals.standardResponses.DEFAULT_RETRY_RESPONSE)
|
||||
return
|
||||
TS.projects.superalgos.utilities.errorHandlingFunctions.throwHandledException(
|
||||
processIndex,
|
||||
MODULE_NAME,
|
||||
'Dataset Type Standard Converter',
|
||||
{ errorDetails: "getContextVariables -> detectWhereTheMarketEnds -> Can not continue because dependecy Status Report is corrupt. " },
|
||||
'Status Report Is Corrupt',
|
||||
TS.projects.superalgos.globals.taskConstants.TASK_NODE.bot.processes[processIndex].referenceParent.processOutput
|
||||
)
|
||||
}
|
||||
|
||||
thisReport = statusReport.file
|
||||
@@ -171,10 +187,14 @@ exports.newSuperalgosFunctionLibrariesDataAggregationFunctions = function () {
|
||||
}
|
||||
|
||||
if (statusReport.status === "Status Report is corrupt.") {
|
||||
TS.projects.superalgos.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).BOT_MAIN_LOOP_LOGGER_MODULE_OBJECT.write(MODULE_NAME,
|
||||
"[ERROR] getContextVariables -> Can not continue because self dependecy Status Report is corrupt. Aborting Process.")
|
||||
callBackFunction(TS.projects.superalgos.globals.standardResponses.DEFAULT_FAIL_RESPONSE)
|
||||
return
|
||||
TS.projects.superalgos.utilities.errorHandlingFunctions.throwHandledException(
|
||||
processIndex,
|
||||
MODULE_NAME,
|
||||
'Dataset Type Standard Converter',
|
||||
{ errorDetails: "getContextVariables -> getOwnStatusReport -> Can not continue because dependecy Status Report is corrupt. " },
|
||||
'Status Report Is Corrupt',
|
||||
TS.projects.superalgos.globals.taskConstants.TASK_NODE.bot.processes[processIndex].referenceParent.processOutput
|
||||
)
|
||||
}
|
||||
|
||||
thisReport = statusReport.file
|
||||
@@ -244,18 +264,22 @@ exports.newSuperalgosFunctionLibrariesDataAggregationFunctions = function () {
|
||||
}
|
||||
|
||||
} catch (err) {
|
||||
TS.projects.superalgos.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).UNEXPECTED_ERROR = err
|
||||
TS.projects.superalgos.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).BOT_MAIN_LOOP_LOGGER_MODULE_OBJECT.write(MODULE_NAME,
|
||||
"[ERROR] getContextVariables -> getOwnStatusReport-> err = " + err.stack)
|
||||
|
||||
if (err.message === "Cannot read property 'file' of undefined") {
|
||||
TS.projects.superalgos.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).BOT_MAIN_LOOP_LOGGER_MODULE_OBJECT.write(MODULE_NAME,
|
||||
"[HINT] getContextVariables -> getOwnStatusReport-> Check the bot configuration to see if all of its statusDependencies declarations are correct. ")
|
||||
TS.projects.superalgos.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).BOT_MAIN_LOOP_LOGGER_MODULE_OBJECT.write(MODULE_NAME,
|
||||
"[HINT] getContextVariables -> getOwnStatusReport-> Dependencies loaded -> keys = " + JSON.stringify(statusDependenciesModule.keys))
|
||||
TS.projects.superalgos.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).BOT_MAIN_LOOP_LOGGER_MODULE_OBJECT.write(MODULE_NAME,
|
||||
"[HINT] getContextVariables -> getOwnStatusReport-> Dependencies loaded -> Double check that you are not running a process that only can be run at noTime mode at a certain month when it is not prepared to do so.")
|
||||
err.errorDetails = [
|
||||
"[HINT] getContextVariables -> getOwnStatusReport-> Check the bot configuration to see if all of its statusDependencies declarations are correct. ",
|
||||
"[HINT] getContextVariables -> getOwnStatusReport-> Dependencies loaded -> keys = " + JSON.stringify(statusDependenciesModule.keys),
|
||||
"[HINT] getContextVariables -> getOwnStatusReport-> Dependencies loaded -> Double check that you are not running a process that only can be run at noTime mode at a certain month when it is not prepared to do so."
|
||||
]
|
||||
}
|
||||
callBackFunction(TS.projects.superalgos.globals.standardResponses.DEFAULT_FAIL_RESPONSE)
|
||||
TS.projects.superalgos.utilities.errorHandlingFunctions.throwHandledException(
|
||||
processIndex,
|
||||
MODULE_NAME,
|
||||
'Dataset Type Standard Converter',
|
||||
err,
|
||||
'Get Context Variables Failed',
|
||||
TS.projects.superalgos.globals.taskConstants.TASK_NODE.bot.processes[processIndex].referenceParent.processOutput
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -362,9 +386,9 @@ exports.newSuperalgosFunctionLibrariesDataAggregationFunctions = function () {
|
||||
dependencyDailyFile = JSON.parse(text)
|
||||
} catch (err) {
|
||||
TS.projects.superalgos.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).BOT_MAIN_LOOP_LOGGER_MODULE_OBJECT.write(MODULE_NAME,
|
||||
"[ERROR] nextDependencyDailyFile -> onFileReceived -> Error Parsing JSON -> err = " + err.stack)
|
||||
"[WARN] nextDependencyDailyFile -> onFileReceived -> Error Parsing JSON -> err = " + err.stack)
|
||||
TS.projects.superalgos.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).BOT_MAIN_LOOP_LOGGER_MODULE_OBJECT.write(MODULE_NAME,
|
||||
"[ERROR] nextDependencyDailyFile -> onFileReceived -> Asuming this is a temporary situation. Requesting a Retry.")
|
||||
"[WARN] nextDependencyDailyFile -> onFileReceived -> Asuming this is a temporary situation. Requesting a Retry.")
|
||||
callBackFunction(TS.projects.superalgos.globals.standardResponses.DEFAULT_RETRY_RESPONSE)
|
||||
return
|
||||
}
|
||||
@@ -546,7 +570,7 @@ exports.newSuperalgosFunctionLibrariesDataAggregationFunctions = function () {
|
||||
function aggregationMethodLast() {
|
||||
/*
|
||||
This is the LAST type of aggregation.
|
||||
|
||||
|
||||
Everything that follows will be set for each element overiding the previous
|
||||
ones, so only the last values will survive.
|
||||
*/
|
||||
@@ -561,7 +585,7 @@ exports.newSuperalgosFunctionLibrariesDataAggregationFunctions = function () {
|
||||
function aggregationMethodMin() {
|
||||
/*
|
||||
This is the MIN type of aggregation.
|
||||
|
||||
|
||||
Note that to be able to calculate the minimum, we will be assigning to all properties the first
|
||||
element values, so as to have a baseline from where to compare later on.
|
||||
*/
|
||||
@@ -0,0 +1,61 @@
|
||||
exports.newSuperalgosUtilitiesErrorHandlingFunctions = function () {
|
||||
|
||||
let thisObject = {
|
||||
throwHandledException: throwHandledException
|
||||
}
|
||||
|
||||
return thisObject
|
||||
|
||||
/*
|
||||
This function helps Bots to integrate their error handling to the In-App-Docs.
|
||||
*/
|
||||
function throwHandledException(
|
||||
processIndex, // The index of the process where the exception happened.
|
||||
MODULE_NAME, // The name of the module where the exception happened.
|
||||
source, // A user understandable source of the exception. This will be part of the Doc's page name.
|
||||
err, // The Error object available, if any.
|
||||
message, // The Message, which will be part of the Docs page name.
|
||||
node // The closest node related to the exception.
|
||||
) {
|
||||
if (err === undefined) {
|
||||
err = {
|
||||
message: message
|
||||
}
|
||||
}
|
||||
/*
|
||||
This is what the Docs Space will get.
|
||||
*/
|
||||
let docs = {
|
||||
project: 'Superalgos',
|
||||
category: 'Topic',
|
||||
type: 'TS ' + source + ' Error - ' + message,
|
||||
placeholder: {}
|
||||
}
|
||||
TS.projects.superalgos.utilities.docsFunctions.buildPlaceholder(
|
||||
docs,
|
||||
err,
|
||||
node.name,
|
||||
node.code,
|
||||
node.config,
|
||||
node.value,
|
||||
err
|
||||
)
|
||||
/*
|
||||
This will be needed for the process level error handling. Must be added
|
||||
here after the buildPlaceholder function call otherwise it would be included as a
|
||||
placeholder.
|
||||
*/
|
||||
err.docs = docs
|
||||
err.node = node
|
||||
/*
|
||||
Users will not always be watching the console when an execption happens, for that
|
||||
reason we will send it also to the Debug Logs.
|
||||
*/
|
||||
let errorDetails = err.errorDetails
|
||||
if (errorDetails === undefined) { errorDetails = "No error details availabe."}
|
||||
TS.projects.superalgos.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).BOT_MAIN_LOOP_LOGGER_MODULE_OBJECT.write(MODULE_NAME,
|
||||
"[ERROR] " + errorDetails)
|
||||
|
||||
throw (err)
|
||||
}
|
||||
}
|
||||
@@ -2,7 +2,7 @@ function newListItem() {
|
||||
const MODULE_NAME = 'List Item'
|
||||
const ERROR_LOG = true
|
||||
const logger = newWebDebugLog()
|
||||
|
||||
|
||||
|
||||
let thisObject = {
|
||||
container: undefined,
|
||||
@@ -21,8 +21,9 @@ function newListItem() {
|
||||
thisObject.container.detectMouseOver = true
|
||||
thisObject.container.isClickeable = true
|
||||
thisObject.container.frame.width = SIDE_PANEL_WIDTH * 0.75
|
||||
thisObject.container.frame.height = SIDE_PANEL_WIDTH * 0.75
|
||||
thisObject.container.frame.height = SIDE_PANEL_WIDTH * 0.40
|
||||
|
||||
let prefix = "User "
|
||||
let name
|
||||
let project
|
||||
let type
|
||||
@@ -49,6 +50,12 @@ function newListItem() {
|
||||
project = pProject
|
||||
type = pType
|
||||
|
||||
let splittedName = name.split('→')
|
||||
if (splittedName.length === 2) {
|
||||
name = splittedName[1]
|
||||
prefix = splittedName[0]
|
||||
}
|
||||
|
||||
onMouseOverEventSubscriptionId = thisObject.container.eventHandler.listenToEvent('onMouseOver', onMouseOver)
|
||||
onMouseNotOverEventSubscriptionId = thisObject.container.eventHandler.listenToEvent('onMouseNotOver', onMouseNotOver)
|
||||
onMouseClickEventSubscriptionId = thisObject.container.eventHandler.listenToEvent('onMouseClick', onMouseClick)
|
||||
@@ -78,9 +85,15 @@ function newListItem() {
|
||||
|
||||
function draw() {
|
||||
let icon = UI.projects.superalgos.spaces.designSpace.getIconByProjectAndType('Superalgos', type)
|
||||
let backgroundColor = UI_COLOR.BLACK
|
||||
let backgroundColor
|
||||
let labelColor
|
||||
|
||||
if (prefix === "User ") {
|
||||
backgroundColor = UI_COLOR.BLACK
|
||||
} else {
|
||||
backgroundColor = UI_COLOR.RUSTED_RED
|
||||
}
|
||||
|
||||
const RED_LINE_HIGHT = 4
|
||||
const OPACITY = 1
|
||||
|
||||
@@ -102,8 +115,8 @@ function newListItem() {
|
||||
|
||||
UI.projects.superalgos.utilities.drawPrint.roundedCornersBackground(params)
|
||||
|
||||
UI.projects.superalgos.utilities.drawPrint.drawLabel(name, 1 / 2, 3.0 / 10, -5, 0, 15, thisObject.container, labelColor)
|
||||
UI.projects.superalgos.utilities.drawPrint.drawLabel(type, 1 / 2, 7.2 / 10, -5, 0, 15, thisObject.container, labelColor)
|
||||
UI.projects.superalgos.utilities.drawPrint.drawIcon(icon, 1 / 2, 1 / 2, 0, 0, 80, thisObject.container)
|
||||
UI.projects.superalgos.utilities.drawPrint.drawLabel(name, 1 / 2, 2.5 / 10, -5, 0, 15, thisObject.container, labelColor)
|
||||
UI.projects.superalgos.utilities.drawPrint.drawLabel(prefix + type, 1 / 2, 8.5 / 10, -5, 0, 15, thisObject.container, labelColor)
|
||||
UI.projects.superalgos.utilities.drawPrint.drawIcon(icon, 1 / 2, 1 / 2, 0, 0, 50, thisObject.container)
|
||||
}
|
||||
}
|
||||
@@ -34,7 +34,7 @@ function newListView() {
|
||||
|
||||
let headerHeight = 40
|
||||
let footerHeight = 30
|
||||
let listItemHeight = SIDE_PANEL_WIDTH * 0.75
|
||||
let listItemHeight = SIDE_PANEL_WIDTH * 0.40
|
||||
|
||||
let posibleVisibleListItems
|
||||
|
||||
|
||||
Reference in new issue
Block a user