Module

server/socket/socketHelperFunctions

Methods

# static createJob(userId, robotId, status, parameters) → {String}

Creates a Job in the database for a robot execution of a specific user
Parameters:
Name Type Description
userId String Id of the user that wants to execute a robot
robotId String Id of the robot tha will be executed
status String Current status of the job (either waiting, executing, successful or failed)
parameters Array Different parameters the user defined before executing the robot

View Source server/socket/socketHelperFunctions.js, line 85

ObjectId of the new job object
String

# static getAllUserIds() → {Array}

Fetches the user ids of all the users

View Source server/socket/socketHelperFunctions.js, line 64

All user ids
Array

# static getAllWaitingJobsForUser(userId)

Finds all jobs with status waiting in the database for a specific user
Parameters:
Name Type Description
userId String Id of the user for which all waiting jobs will be retrieved

View Source server/socket/socketHelperFunctions.js, line 143

# static getRobotCode(robotId) → {String}

Fetches the ssot of a given robot from the database and parses the ssot to robot code
Parameters:
Name Type Description
robotId String Id of the robot that the robot code will be fetched for

View Source server/socket/socketHelperFunctions.js, line 36

Code of the robot
String

# static getRobotCodeForJob(robotId, jobId) → {String}

Fetches the ssot of a given robot from the database and parses the ssot to robot code
Parameters:
Name Type Description
robotId String Id of the robot that the robot code will be fetched for
jobId String Id of the current job

View Source server/socket/socketHelperFunctions.js, line 22

Code of the robot
String

# static getRobotJobParameters(jobId) → {Array}

Finds a specific robot job and retrieves the parameter array
Parameters:
Name Type Description
jobId String Id of the robot for which all parameters will be retrieved

View Source server/socket/socketHelperFunctions.js, line 50

All parameter objects of the robot
Array

# static updateRobotJobErrors(jobId, errorLog)

Updates the given Job when the run has failed with the list of failing activities
Parameters:
Name Type Description
jobId String Id of the job that will be updated
errorLog Array List of logs of the robots activites

View Source server/socket/socketHelperFunctions.js, line 120

# static updateRobotJobStatus(jobId, status)

Finds a specific job in the database and updates the status of the Job
Parameters:
Name Type Description
jobId String Id of the job that will be updated
status String Current status of the job (either waiting, executing, success or failed)

View Source server/socket/socketHelperFunctions.js, line 107