public final class QueuedRequest
extends java.lang.Object
The robot will be placed in the queue on the Management Console:
| Modifier and Type | Class and Description |
|---|---|
static class |
QueuedRequest.Priority
Queue priority for the robot.
|
| Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT_POLLING_INTERVAL |
| Constructor and Description |
|---|
QueuedRequest(java.lang.String managementConsoleUrl,
java.lang.String robotPath,
java.lang.String projectName,
java.lang.String apiKey)
Creates a new
QueuedRequest with the specified robot URL. |
QueuedRequest(java.lang.String managementConsoleUrl,
java.lang.String robotPath,
java.lang.String projectName,
java.lang.String apiKey,
QueuedRequest.Priority priority,
long queueTimeout)
Creates a new
QueuedRequest with the specified Management Console, robot path and project,
priority and timeout time. |
| Modifier and Type | Method and Description |
|---|---|
void |
cancel()
Signals the execution to stop.
|
RpaObjectBuilder |
createInputVariable(java.lang.String name)
Creates a new input Object with the specified name, and returns an
RpaObjectBuilder that can be
used to build the object. |
void |
createInputVariable(java.lang.String name,
RpaObject object)
Creates a new Input Object with the specified name, from an RpaObject.
|
void |
createOAuthInputVariable(java.lang.String name,
java.lang.String userName,
java.lang.String applicationName)
Creates an input variable for an OAUTH input type, that will look up the OAuth details in Management Console
based on the given username and application name.
|
ExecutionResult |
execute()
Executes the robot request.
|
void |
execute(RobotResponseHandler handler)
Executes the robot request, using a custom response handler.
|
java.util.List<Response> |
getInterimResults()
Retrieves intermediary results from an ongoing execution.
|
int |
getPollingIntervalMillis()
The current polling interval.
|
QueuedRequest.Priority |
getPriority()
The current priority.
|
java.lang.String |
getProject()
Get the project for this request
|
java.lang.String |
getRobotURL()
Returns the currently configured
robotURL property. |
long |
getTimeout()
Gets the current timeout.
|
void |
setPollingIntervalMillis(int pollingIntervalMillis)
Updates to the robot execution status as well as obtaining return values and API exception errors are updated by
polling.
|
void |
setPriority(QueuedRequest.Priority priority)
Sets the priority of the queued task as long as it is in the Management Console queue.
|
void |
setProject(java.lang.String project)
Set the project name for this request.
|
void |
setRobotURL(java.lang.String robotURL)
Sets the
robotURL property. |
void |
setStopRobotOnApiException(boolean stopOnError)
Specifies whether robot execution should stop if an error occurs in the robot, corresponding to
the 'API Exception' checkmark as specified on a robot step.
|
void |
setTimeout(long timeout)
Sets the timeout for how long the robot will stay in the queue while it waits for execution.
|
public static final int DEFAULT_POLLING_INTERVAL
public QueuedRequest(java.lang.String managementConsoleUrl,
java.lang.String robotPath,
java.lang.String projectName,
java.lang.String apiKey)
QueuedRequest with the specified robot URL.managementConsoleUrl - URL of the Management Console to use. E.g. 'http://localhost:8080/ManagementConsole'.robotPath - the path of the robot to execute. E.g. 'Folder/Robot.robot'.projectName - the project name of the robot. E.g. 'Default project'apiKey - API key to use for authentication.public QueuedRequest(java.lang.String managementConsoleUrl,
java.lang.String robotPath,
java.lang.String projectName,
java.lang.String apiKey,
QueuedRequest.Priority priority,
long queueTimeout)
QueuedRequest with the specified Management Console, robot path and project,
priority and timeout time. Uses the given API key for authentication.managementConsoleUrl - URL of the Management Console to use. E.g. 'http://localhost:8080/ManagementConsole'.robotPath - the path of the robot to execute. E.g. 'Folder/Robot.robot'.projectName - the project name of the robot. E.g. 'Default project'apiKey - API key to use for authentication.priority - the priority of the robot to execute.queueTimeout - the queue timeout of the robot to execute.public int getPollingIntervalMillis()
public void setPollingIntervalMillis(int pollingIntervalMillis)
This parameter sets the interval in milliseconds between polls. Short intervals may cause more load on the Management Console, but will increase the update rate of this request.
The default value is 1000 ms.
pollingIntervalMillis - the polling interval to use for this request, in milliseconds.public java.lang.String getRobotURL()
robotURL property.robotURL property.public void setRobotURL(java.lang.String robotURL)
robotURL property.robotURL - the new URL to the robot.public RpaObjectBuilder createInputVariable(java.lang.String name)
RpaObjectBuilder that can be
used to build the object.name - the name of the input object.RpaObjectBuilder that can be used to build the object.public void createInputVariable(java.lang.String name,
RpaObject object)
name - the name of the input object.object - the rpa objectpublic java.lang.String getProject()
public void setProject(java.lang.String project)
project - the project namepublic ExecutionResult execute() throws ApiException
ApiException - if an error in the API occurs, or the thread is interrupted.public void execute(RobotResponseHandler handler) throws ApiException
handler - the response handler that will receive all execution events.ApiException - if thrown by the handler.public void cancel()
throws ApiException
ApiException - if the execution was not in a state that could be stopped, or if the stop request could not be sent.public java.util.List<Response> getInterimResults()
execute(), not when using a custom response handler.public void setStopRobotOnApiException(boolean stopOnError)
stopOnError - true if robot execution should stop if an 'API Exception' is thrown from a robot.public QueuedRequest.Priority getPriority()
public void setPriority(QueuedRequest.Priority priority)
The priority defaults to MEDIUM.
priority - the priority for this request when submitted to the queue.public long getTimeout()
public void setTimeout(long timeout)
The default value is 600 seconds (10 minutes).
timeout - the timeout in seconds to use.public void createOAuthInputVariable(java.lang.String name,
java.lang.String userName,
java.lang.String applicationName)
name - the name of the input variableuserName - the name of the user, as registered in the management consoleapplicationName - the name of the application as registered on the project in the management consoleKofax RPA Java API, v11.5.17