diff --git a/DesignSpace/Workspace/FunctionLibraries/SessionFunctions.js b/DesignSpace/Workspace/FunctionLibraries/SessionFunctions.js index e46ed99af..c1f96d72f 100644 --- a/DesignSpace/Workspace/FunctionLibraries/SessionFunctions.js +++ b/DesignSpace/Workspace/FunctionLibraries/SessionFunctions.js @@ -148,17 +148,29 @@ function newSessionFunctions() { return } - if (node.payload.parentNode.payload.parentNode.payload.parentNode.payload.parentNode.payload.parentNode === undefined) { + let taskManager = node.payload.parentNode.payload.parentNode.payload.parentNode.payload.parentNode + + if (taskManager.payload.parentNode === undefined) { + node.payload.uiObject.setErrorMessage('Session needs to be inside Mine Tasks.') + return + } + + if (taskManager.payload.parentNode.payload.parentNode === undefined) { + node.payload.uiObject.setErrorMessage('Session needs to be inside Market Tasks.') + return + } + + if (taskManager.payload.parentNode.payload.parentNode.payload.parentNode === undefined) { node.payload.uiObject.setErrorMessage('Session needs to be inside Exchange Tasks.') return } - if (node.payload.parentNode.payload.parentNode.payload.parentNode.payload.parentNode.payload.parentNode.payload.parentNode === undefined) { + if (taskManager.payload.parentNode.payload.parentNode.payload.parentNode.payload.parentNode === undefined) { node.payload.uiObject.setErrorMessage('Session needs to be inside a Testing or Production Environment.') return } - if (node.payload.parentNode.payload.parentNode.payload.parentNode.payload.parentNode.payload.parentNode.payload.parentNode.payload.parentNode === undefined) { + if (taskManager.payload.parentNode.payload.parentNode.payload.parentNode.payload.parentNode.payload.parentNode === undefined) { node.payload.uiObject.setErrorMessage('Session needs to be inside a Network Node.') return } diff --git a/DesignSpace/Workspace/FunctionLibraries/TaskFunctions.js b/DesignSpace/Workspace/FunctionLibraries/TaskFunctions.js index 543838efc..c19f3c3e7 100644 --- a/DesignSpace/Workspace/FunctionLibraries/TaskFunctions.js +++ b/DesignSpace/Workspace/FunctionLibraries/TaskFunctions.js @@ -42,6 +42,10 @@ function newTaskFunctions() { 'Sensor Process Instance->Indicator Process Instance->Trading Process Instance->' + 'Execution Started Event->' + 'Key Reference->Exchange Account Key->' + + 'Task Manager->' + + 'Data Mine Tasks->Trading Mine Tasks->' + 'Market Data Tasks->Market Trading Tasks->' + + 'Exchange Data Tasks->Exchange Trading Tasks->' + 'Market->Exchange Markets->Crypto Exchange->' + 'Market Base Asset->Market Quoted Asset->Asset->' + 'Backtesting Session->Live Trading Session->Paper Trading Session->Fordward Testing Session->' + @@ -68,7 +72,7 @@ function newTaskFunctions() { 'Product Definition Folder->Product Definition Folder->Product Definition Folder->Product Definition Folder->Product Definition Folder->' + 'Indicator Bot->' + 'Trading Bot->' + - 'Data Mine->' + 'Data Mine->Trading Mine->' let taskDefinition = functionLibraryProtocolNode.getProtocolNode(node, false, true, true, false, false, taskLightingPath) @@ -79,7 +83,9 @@ function newTaskFunctions() { 'Data Product Folder->Data Product Folder->Data Product Folder->Data Product Folder->Data Product Folder->' + 'Data Product->Product Definition->' + 'Data Mining->Testing Environment->Production Environment->' + - 'Exchange Tasks->Crypto Exchange->' + + 'Exchange Data Tasks->Exchange Mining Tasks->Crypto Exchange->' + + 'Market Data Tasks->Market Mining Tasks->' + + 'Data Mine Tasks->Trading Mine Tasks->' 'Task Manager->Task->' + 'Indicator Bot Instance->Sensor Bot Instance->Trading Bot Instance->' + 'Indicator Process Instance->Sensor Process Instance->Trading Process Instance->' + @@ -148,26 +154,33 @@ function newTaskFunctions() { return } - if (node.payload.parentNode.payload.parentNode === undefined) { + let taskManager = node.payload.parentNode.payload.parentNode.payload.parentNode.payload.parentNode + + if (taskManager.payload.parentNode === undefined) { + node.payload.uiObject.setErrorMessage('Task needs to be inside Mine Tasks.') + return + } + + if (taskManager.payload.parentNode.payload.parentNode === undefined) { + node.payload.uiObject.setErrorMessage('Task needs to be inside Market Tasks.') + return + } + + if (taskManager.payload.parentNode.payload.parentNode.payload.parentNode === undefined) { node.payload.uiObject.setErrorMessage('Task needs to be inside Exchange Tasks.') return } - if (node.payload.parentNode.payload.parentNode.payload.parentNode === undefined) { - node.payload.uiObject.setErrorMessage('Task needs to be inside a Testing or Production Environment or a Data Mining node.') + if (taskManager.payload.parentNode.payload.parentNode.payload.parentNode.payload.parentNode === undefined) { + node.payload.uiObject.setErrorMessage('Task needs to be inside a Testing or Production Environment.') return } - if (node.payload.parentNode.payload.parentNode.payload.parentNode.payload.parentNode === undefined) { + if (taskManager.payload.parentNode.payload.parentNode.payload.parentNode.payload.parentNode.payload.parentNode === undefined) { node.payload.uiObject.setErrorMessage('Task needs to be inside a Network Node.') return } - if (node.payload.parentNode.payload.parentNode.payload.parentNode.payload.parentNode.payload.parentNode === undefined) { - node.payload.uiObject.setErrorMessage('Task needs to be inside a Network.') - return - } - let networkNode = node.payload.parentNode.payload.parentNode.payload.parentNode.payload.parentNode if (loadPropertyFromNodeConfig(networkNode.payload, 'host') === undefined) { node.payload.uiObject.setErrorMessage('Network Node needs to have a valid Host property at its config.') @@ -224,6 +237,7 @@ function newTaskFunctions() { menu.internalClick('Stop All Tasks') } } + function runAllExchangeDataTasks(parent, functionLibraryProtocolNode) { for (let i = 0; i < parent.exchangeTasks.length; i++) { let node = parent.exchangeTasks[i] diff --git a/DesignSpace/Workspace/Workspace.js b/DesignSpace/Workspace/Workspace.js index 96db27f11..79366ca7f 100644 --- a/DesignSpace/Workspace/Workspace.js +++ b/DesignSpace/Workspace/Workspace.js @@ -345,16 +345,16 @@ function newWorkspace() { for (let j = 0; j < rootNode.networkNodes.length; j++) { let networkNode = rootNode.networkNodes[j] if (networkNode.dataMining !== undefined && networkNode.dataMining.payload !== undefined) { - networkNode.dataMining.payload.uiObject.menu.internalClick('Stop All Exchange Tasks') - networkNode.dataMining.payload.uiObject.menu.internalClick('Stop All Exchange Tasks') + networkNode.dataMining.payload.uiObject.menu.internalClick('Stop All Exchange Data Tasks') + networkNode.dataMining.payload.uiObject.menu.internalClick('Stop All Exchange Data Tasks') } if (networkNode.testingEnvironment !== undefined && networkNode.testingEnvironment.payload !== undefined) { - networkNode.testingEnvironment.payload.uiObject.menu.internalClick('Stop All Exchange Tasks') - networkNode.testingEnvironment.payload.uiObject.menu.internalClick('Stop All Exchange Tasks') + networkNode.testingEnvironment.payload.uiObject.menu.internalClick('Stop All Exchange Trading Tasks') + networkNode.testingEnvironment.payload.uiObject.menu.internalClick('Stop All Exchange Trading Tasks') } if (networkNode.productionEnvironment !== undefined && networkNode.productionEnvironment.payload !== undefined) { - networkNode.productionEnvironment.payload.uiObject.menu.internalClick('Stop All Exchange Tasks') - networkNode.productionEnvironment.payload.uiObject.menu.internalClick('Stop All Exchange Tasks') + networkNode.productionEnvironment.payload.uiObject.menu.internalClick('Stop All Exchange Trading Tasks') + networkNode.productionEnvironment.payload.uiObject.menu.internalClick('Stop All Exchange Trading Tasks') } } }