Package com.axelor.ai.tool.procedure
Class RunProcedureTool
java.lang.Object
com.axelor.ai.tool.procedure.RunProcedureTool
- All Implemented Interfaces:
SystemTool<RunProcedureTool.Input>
Runs one of the procedures of the agent's skills on a record: the form's own steps, each handled
as the web client would handle it. The model names the procedure and gives its inputs; it never
supplies steps or values of its own (invariant 6).
Refused before anything runs when the procedure is in none of the agent's skills, its model is
outside the user's or the agent's reach, it no longer checks out against the application, an
input is undeclared, missing or mistyped, the user may not change the record, or its guard is
false. Once running, it ends where the browser would: after the last step, at an error, at an
alert the procedure does not answer, or at a close.
Runs outside the chat's transaction: each round trip commits on its own, as a browser's requests do, so what was saved before a stop stays saved, and the result says so.
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionbeforeApproval(RunProcedureTool.Input input, ToolContext context) Before the user is asked: a run that would be refused — anythingexecute(com.axelor.ai.tool.procedure.RunProcedureTool.Input, com.axelor.ai.tool.system.ToolContext)refuses up front, and a guard that is false on the record as the run would open it — is refused without asking, and nothing of the form runs to tell; a run that would go ahead is asked about with the record it acts on, which its input does not name the model of.callTitle(RunProcedureTool.Input input, String name) The procedure's own title — "Confirm the order" — which says what the call does in the words its skill uses.code()Unique code matching AiTool.systemTool field.Brief description of what this tool does.execute(RunProcedureTool.Input input, ToolContext context) Execute with the given typed input and agent-scoped context.The input record class.name()Human-readable display name (e.g.booleanWhether this tool opens its own transactions and must run outside the call's.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.axelor.ai.tool.system.SystemTool
provideContext, refusal, safety, undoneByRollback
-
Field Details
-
CODE
- See Also:
-
-
Method Details
-
code
Description copied from interface:SystemToolUnique code matching AiTool.systemTool field.- Specified by:
codein interfaceSystemTool<RunProcedureTool.Input>
-
name
Description copied from interface:SystemToolHuman-readable display name (e.g. "Search Records").- Specified by:
namein interfaceSystemTool<RunProcedureTool.Input>
-
description
Description copied from interface:SystemToolBrief description of what this tool does.- Specified by:
descriptionin interfaceSystemTool<RunProcedureTool.Input>
-
inputType
Description copied from interface:SystemToolThe input record class. ReturnVoid.classfor tools with no input.- Specified by:
inputTypein interfaceSystemTool<RunProcedureTool.Input>
-
runsOutsideTransaction
public boolean runsOutsideTransaction()Description copied from interface:SystemToolWhether this tool opens its own transactions and must run outside the call's. A tool whose work is several steps, each to be committed on its own as a browser commits each request, returns true; every other tool keeps the one transaction that makes its writes atomic.- Specified by:
runsOutsideTransactionin interfaceSystemTool<RunProcedureTool.Input>
-
callTitle
The procedure's own title — "Confirm the order" — which says what the call does in the words its skill uses. Titling has no agent to go by, so it reads every enabled skill with a procedure of that name, and uses the title only when they all agree: a card never names a procedure other than the one that runs.- Specified by:
callTitlein interfaceSystemTool<RunProcedureTool.Input>- Parameters:
input- the call's input, or null when the tool takes nonename- the tool's configured display name
-
beforeApproval
Before the user is asked: a run that would be refused — anythingexecute(com.axelor.ai.tool.procedure.RunProcedureTool.Input, com.axelor.ai.tool.system.ToolContext)refuses up front, and a guard that is false on the record as the run would open it — is refused without asking, and nothing of the form runs to tell; a run that would go ahead is asked about with the record it acts on, which its input does not name the model of.- Specified by:
beforeApprovalin interfaceSystemTool<RunProcedureTool.Input>- Parameters:
input- the call's input, or null when the tool takes nonecontext- the call's context
-
execute
Description copied from interface:SystemToolExecute with the given typed input and agent-scoped context.- Specified by:
executein interfaceSystemTool<RunProcedureTool.Input>
-