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 |
ObjectId of the new job object
String
# 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 |
# 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 |
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 |
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 |
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 |
# 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) |