Session Concept Introduced into Product Storage

This commit is contained in:
Luis Fernando Molina committed 2019-10-07 14:51:58 +02:00
1 parent 5264885ab8
commit e4323deb83
5 files changed
+96 -8

No files matched your search

@@ -0,0 +1,61 @@
function newLayerFunctions () {
thisObject = {
turnLayerOn: turnLayerOn,
turnLayerOff: turnLayerOff,
turnAllLayersOn: turnAllLayersOn,
turnAllLayersOff: turnAllLayersOff
}
return thisObject
function turnLayerOn (node, functionLibraryProtocolNode, callBackFunction) {
/* Check if it is possible to turn on or not */
let code
try {
code = JSON.parse(node.code)
} catch (err) {
{
callBackFunction(GLOBAL.DEFAULT_FAIL_RESPONSE)
return
}
}
/* Ok, we are going to turn the layer on */
}
function turnLayerOff (node, functionLibraryProtocolNode, callBackFunction) {
let event = {
taskId: node.id,
taskName: node.name
}
systemEventHandler.raiseEvent('Layer Manager', 'Turn Layer Off', event)
node.payload.uiObject.stop(callBackFunction)
if (node.bot === undefined) { return }
if (node.bot.processes.length === 0) { return }
for (let i = 0; i < node.bot.processes.length; i++) {
let process = node.bot.processes[i]
process.payload.uiObject.stop()
}
}
function turnAllLayersOn (taskManager, functionLibraryProtocolNode) {
for (let i = 0; i < taskManager.tasks.length; i++) {
let node = taskManager.tasks[i]
let menu = node.payload.uiObject.menu
menu.internalClick('Turn Layer On')
}
}
function turnAllLayersOff (taskManager, functionLibraryProtocolNode) {
for (let i = 0; i < taskManager.tasks.length; i++) {
let node = taskManager.tasks[i]
let menu = node.payload.uiObject.menu
menu.internalClick('Turn Layer Off')
}
}
}
@@ -10,8 +10,14 @@ function newTaskFunctions () {
function runTask (node, functionLibraryProtocolNode, callBackFunction) {
/* Check if it is possible to Run or not */
if (node.bot === undefined) { return }
if (node.bot.processes.length === 0) { return }
if (node.bot === undefined) {
callBackFunction(GLOBAL.DEFAULT_FAIL_RESPONSE)
return
}
if (node.bot.processes.length === 0) {
callBackFunction(GLOBAL.DEFAULT_FAIL_RESPONSE)
return
}
for (let i = 0; i < node.bot.processes.length; i++) {
let process = node.bot.processes[i]