Interface Team
A team is a database-side resource managed by the
DBMS_CLOUD_AI_AGENT PL/SQL package. Teams coordinate agents and can
run multi-agent workflows using their configured members and attributes.
A Team instance can represent an existing database team or be
configured for creation. The name-only SelectAIAgent.team(String)
factory verifies that the team exists and loads its metadata and attributes
before returning. SelectAIAgent.listTeams() also returns handles with
loaded metadata and attributes. A handle configured for creation is obtained with
SelectAIAgent.team(String, TeamAttributes, String, TeamStatus).
A granted team owned by another user can be run by its qualified name via
SelectAIAgent.runTeam(String, RunTeamRequest); that path does not
create a Team handle or expose owner-only metadata.
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(), drop(boolean),
orchestration, state, and export operations require an existing database-side
team.
Existing teams can update individual attributes with
setAttribute(String, String) or multiple attributes with
setAttributes(TeamAttributes); both operations reload the typed
attributes after the database update succeeds.
Before creation, getStatus() and getTeamAttributes() 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. Methods such as
describe() and getStateByConversationId(String) retrieve
other database-side information.
Names and required Java arguments are checked locally. Loading metadata and executing team operations require database access; the database checks privileges and validates team attributes when they are submitted. Team execution and state-management payloads must conform to the formats accepted by the database package.
For a complete runnable example, see CreateTeamSample source. For an end-to-end example that creates the resources needed by a team, runs it, and continues the same database conversation, see AgentWorkflowSample source. For a supervisor agent coordinating separate worker-task mappings, see SupervisorTeamSample source.
- Since:
- 1.1.0
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionbooleancreate()Creates this creation-configured team in the database.describe()Returns the database-generated team definition and aggregated capabilities.booleandisable()Disables this database-backed team.booleandrop(boolean force) Drops this database-backed team owned by the connected user.booleanenable()Enables this database-backed team.Returns the team definition as JSON using the database defaults.exportDefinition(ExportTeamParams params) Returns the team definition as JSON using typed export parameters.booleanexportDefinition(ExportTeamRequest request) Exports this team definition to object storage or a database directory file.Returns the description supplied or loaded when this handle was initialized.getStateByConversationId(String conversationId) Returns the latest run state for a conversation associated with this team.Returns the configured status before creation or the current database status for an existing team.Returns team attributes for this handle.Returns the configured or database-reported team name without database access.booleangrantAccess(String userOrRoleName) Grants a database user or role permission to run this owner-managed team.booleanrevokeAccess(String userOrRoleName) Revokes a database user or role permission to run this owner-managed team.run(RunTeamRequest request) Starts or resumes a synchronous team run using the supplied prompt and runtime parameters.booleansetAttribute(String attributeName, boolean attributeValue) Updates one boolean team attribute in the database.booleansetAttribute(String attributeName, Float attributeValue) Updates one floating-point team attribute in the database.booleansetAttribute(String attributeName, Integer attributeValue) Updates one integer team attribute in the database.booleansetAttribute(String attributeName, String attributeValue) Updates one team attribute in the database.booleansetAttributes(TeamAttributes teamAttributes) Updates multiple team attributes in one database operation.booleansetExecutionState(ExecutionStateRequest request) Updates the state of a waiting team execution.
-
Method Details
-
create
Creates this creation-configured team in the database.For a runnable example, see CreateTeamSample source.
- Returns:
truewhen the database creates the team- Throws:
IllegalStateException- when this handle was loaded from an existing teamSelectAIException- when the database rejects or cannot complete the operation
-
enable
Enables this database-backed team.For a runnable example, see EnableTeamSample source.
- Returns:
truewhen the database enables the team- Throws:
IllegalStateException- when this team has not been createdSelectAIException- when the database operation fails
-
disable
Disables this database-backed team.For a runnable example, see DisableTeamSample source.
- Returns:
truewhen the database disables the team- Throws:
IllegalStateException- when this team has not been createdSelectAIException- when the database operation fails
-
drop
Drops this database-backed team owned by the connected user. Whenforceisfalse, dropping a missing team fails. Whenforceistrue, a missing-team error is ignored and the operation succeeds. The flag does not bypass authorization or perform a cascading delete.For a runnable example, see DropTeamSample source.
- Parameters:
force- database force-drop option- Returns:
truewhen the drop completes- Throws:
IllegalStateException- whenforceisfalseand this team has not been createdSelectAIException- when the database operation fails
-
setAttribute
Updates one team attribute in the database.For a runnable example, see SetTeamAttributeSample source.
- Parameters:
attributeName- database team attribute nameattributeValue- string value, ornullwhere supported- Returns:
truewhen the update succeeds- Throws:
IllegalArgumentException- whenattributeNameis null or blankIllegalStateException- when this team has not been createdSelectAIException- when the database update fails
-
setAttribute
Updates one boolean team attribute in the database.For a runnable example, see SetTeamAttributeSample source.
- Parameters:
attributeName- database team attribute nameattributeValue- boolean value- Returns:
truewhen the update succeeds- Throws:
IllegalArgumentException- whenattributeNameis null or blankIllegalStateException- when this team has not been createdSelectAIException- when the database update fails
-
setAttribute
Updates one integer team attribute in the database.For a runnable example, see SetTeamAttributeSample source.
- Parameters:
attributeName- database team attribute nameattributeValue- integer value- Returns:
truewhen the update succeeds- Throws:
IllegalArgumentException- whenattributeNameis null or blank, orattributeValueis nullIllegalStateException- when this team has not been createdSelectAIException- when the database update fails
-
setAttribute
Updates one floating-point team attribute in the database.For a runnable example, see SetTeamAttributeSample source.
- Parameters:
attributeName- database team attribute nameattributeValue- floating-point value- Returns:
truewhen the update succeeds- Throws:
IllegalArgumentException- whenattributeNameis null or blank, orattributeValueis nullIllegalStateException- when this team has not been createdSelectAIException- when the database update fails
-
setAttributes
Updates multiple team attributes in one database operation.For a runnable example, see SetTeamAttributesSample source.
- Parameters:
teamAttributes- team attributes to update- Returns:
truewhen the update succeeds- Throws:
IllegalArgumentException- whenteamAttributesis nullIllegalStateException- when this team has not been createdSelectAIException- when the database update fails
-
grantAccess
Grants a database user or role permission to run this owner-managed team. The connected database user must own the team. This operation grants execution access to the team as a unit; it does not grant permission to modify the team or independently run its agents, tasks, or tools.For a runnable example, see GrantTeamHandleAccessSample source.
- Parameters:
userOrRoleName- database user or role receiving execution access- Returns:
truewhen the database accepts the grant- Throws:
IllegalArgumentException- when the name is null, blank, invalid, orPUBLICIllegalStateException- when this team has not been createdSelectAIException- when the database rejects or cannot complete the grant- Since:
- 1.1.0
-
revokeAccess
Revokes a database user or role permission to run this owner-managed team. Revocation prevents new runs and resumes but does not terminate a run that is already in progress.For a runnable example, see RevokeTeamHandleAccessSample source.
- Parameters:
userOrRoleName- database user or role losing execution access- Returns:
truewhen the database accepts the revoke- Throws:
IllegalArgumentException- when the name is null, blank, invalid, orPUBLICIllegalStateException- when this team has not been createdSelectAIException- when the database rejects or cannot complete the revoke- Since:
- 1.1.0
-
run
Starts or resumes a synchronous team run using the supplied prompt and runtime parameters. Reuse the request's conversation identifier to resume a conversation across database sessions. This method uses an existing database-backed handle; useSelectAIAgent.runTeam(String, RunTeamRequest)to run a granted team owned by another user. InDataSourcemode, the borrowed JDBC connection can remain occupied for the duration of the workflow. The SDK does not provide cancellation, and an interrupted or timed-out call may not stop server-side work; retry only when the workflow is known to be safe to repeat. Without established session context, provide a database-created conversation identifier in the request; otherwise the database may reject the run with ORA-20053.For a runnable example, see RunTeamSample source. For a human-input workflow resumed through a pooled
DataSourceusing the client-level run API, see PooledTeamResumeSample source.- Parameters:
request- run request; its prompt and parameters may be unset- Returns:
- typed team result retaining the database response
- Throws:
IllegalArgumentException- whenrequestis nullSelectAIException- when the database operation fails
-
describe
Returns the database-generated team definition and aggregated capabilities.For a runnable example, see DescribeTeamSample source. Additional JSON fields are tolerated; malformed or non-object responses are reported as mapping failures instead of empty metadata.
- Returns:
- typed team description with skills retained as JSON, or
nullwhen the database returns no value - Throws:
IllegalStateException- when this team has not been createdSelectAIException- when the database operation or response mapping fails
-
getStateByConversationId
Returns the latest run state for a conversation associated with this team.This convenience method creates the database
conversation_idparameter and is suitable for resuming or inspecting a run across pooled database connections.For a runnable example, see GetOwnedTeamStateSample source.
- Parameters:
conversationId- existing database conversation identifier- Returns:
- typed team execution state retaining the original database value
- Throws:
IllegalArgumentException- whenconversationIdis null or blankIllegalStateException- when this team has not been createdSelectAIException- when the database operation fails- Since:
- 1.1.0
-
setExecutionState
Updates the state of a waiting team execution. UseExecutionStateRequest.Builder.params(ExecutionStateParams)when the request should expose the typed parameter object explicitly. TheExecutionStateRequest.Builder.conversationId(String)method is a convenience for the common case.For a runnable example, see SetOwnedTeamExecutionStateSample source.
- Parameters:
request- execution state and a typed conversation identifier- Returns:
truewhen the database accepts the update- Throws:
IllegalArgumentException- whenrequestis null or does not identify a conversationIllegalStateException- when this team has not been createdSelectAIException- when the database rejects or cannot complete the operation
-
exportDefinition
Returns the team definition as JSON using the database defaults.For a runnable example, see ExportTeamSample source.
- Returns:
- exported team definition returned by the database
- Throws:
IllegalStateException- when this team has not been createdSelectAIException- when the database operation fails
-
exportDefinition
Returns the team definition as JSON using typed export parameters.The currently supported parameter is
overwrite. The database returns the complete exported definition as a JSON string.For a runnable example, see ExportTeamSample source.
- Parameters:
params- typed export parameters, ornullto use database defaults- Returns:
- exported team definition returned by the database
- Throws:
IllegalStateException- when this team has not been createdSelectAIException- when the database operation fails
-
exportDefinition
Exports this team definition to object storage or a database directory file. UseExportTeamParamsthroughExportTeamRequestto provide the typed export options supported by the database.For a runnable example, see ExportTeamSample source.
- Parameters:
request- export destination and optional overwrite configuration- Returns:
truewhen the export succeeds- Throws:
IllegalArgumentException- whenrequestis nullIllegalStateException- when this team has not been createdSelectAIException- when the database operation fails
-
getTeamName
Returns the configured or database-reported team name without database access.For a runnable example, see LoadTeamSample source.
- Returns:
- configured or database-reported team name
-
getDescription
Returns the description supplied or loaded when this handle was initialized. This method does not access the database and the value is not changed bygetStatus().For a runnable example, see LoadTeamSample source.
- Returns:
- supplied or loaded team description, or
nullwhen absent
-
getStatus
Returns the configured status before creation or the current database status for an existing team. A pending team with no configured status returnsnull. This method does not change the description.For a runnable example, see LoadTeamSample source.
- Returns:
- configured or current team status
- Throws:
SelectAIException- when current team metadata cannot be fetched
-
getTeamAttributes
Returns team attributes for this handle.For a database-backed team, this method reloads the attributes from the database on each call and therefore can fail if the resource was deleted. For a creation-configured team, it returns the configured attributes without querying the database.
For a runnable example, see LoadTeamSample source.
- Returns:
- current team attributes for an existing team, or configured attributes for a team pending creation
- Throws:
SelectAIException- when the team no longer exists or current attributes cannot be fetched
-