Interface Task


public interface Task
Contract for Select AI agent task lifecycle management and metadata access.

A task is a database-side resource managed by the DBMS_CLOUD_AI_AGENT PL/SQL package. Tasks define work that can be assigned to or coordinated by an agent team.

A Task instance can represent an existing database task or be configured for creation. The name-only SelectAIAgent.task(String) factory verifies that the task exists and loads its metadata and attributes before returning. SelectAIAgent.listTasks() also returns handles with loaded metadata and attributes. A handle configured for creation is obtained with SelectAIAgent.task(String, TaskAttributes, String, TaskStatus).

A creation-configured handle retains its supplied attributes, description, and status without querying the database. Only such a handle can call create(); after creation succeeds, it becomes database-backed. enable(), disable(), and drop(boolean) require an existing task and operate on the database-side resource. Existing tasks can update individual attributes with setAttribute(String, String) or multiple attributes with setAttributes(TaskAttributes); both operations reload the typed attributes after the database update succeeds.

Before creation, getStatus() and getTaskAttributes() return the configured values. For a database-backed handle, each call to either method queries the database. getStatus() does not change the description returned by getDescription(). The description is supplied or loaded when the handle is initialized; getDescription() does not query the database.

Names and required Java arguments are checked locally. Loading metadata and executing lifecycle operations require database access; the database checks privileges and validates task attributes when they are submitted.

For a complete runnable example, see CreateTaskSample source.

Since:
1.1.0
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Creates this creation-configured task in the database.
    boolean
    Disables this database-backed task.
    boolean
    drop(boolean force)
    Drops this database-backed task.
    boolean
    Enables this database-backed task.
    Returns the description supplied or loaded when this handle was initialized.
    Returns the configured status before creation or the current database status for an existing task.
    Returns task attributes for this handle.
    Returns the configured or database-reported task name without database access.
    boolean
    setAttribute(String attributeName, boolean attributeValue)
    Updates one boolean task attribute in the database.
    boolean
    setAttribute(String attributeName, Float attributeValue)
    Updates one floating-point task attribute in the database.
    boolean
    setAttribute(String attributeName, Integer attributeValue)
    Updates one integer task attribute in the database.
    boolean
    setAttribute(String attributeName, String attributeValue)
    Updates one task attribute in the database.
    boolean
    setAttributes(TaskAttributes taskAttributes)
    Updates multiple task attributes in one database operation.