Package com.axelor.ai.tool.data
Class DeleteRecordTool
java.lang.Object
com.axelor.ai.tool.system.ModelAwareSystemTool<DeleteRecordTool.Input>
com.axelor.ai.tool.data.DeleteRecordTool
- All Implemented Interfaces:
SystemTool<DeleteRecordTool.Input>
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncallTitle(DeleteRecordTool.Input input, String name) A batch is not one record; how many it was belongs to the card that lists them.protected ToolResultcheckForJsonModel(DeleteRecordTool.Input input, MetaJsonModel jsonModel, Access access) The same for a custom model.protected ToolResultcheckForModel(DeleteRecordTool.Input input, Class<? extends Model> modelClass, Access access) What the call would refuse on this entity, found without writing anything, so that a refusal known up front costs the user no approval; null when it would go through.code()Unique code matching AiTool.systemTool field.Brief description of what this tool does.protected ToolResultexecuteForJsonModel(DeleteRecordTool.Input input, MetaJsonModel jsonModel, Access access) Subclass hook — called for a custom model once it is allowed.protected ToolResultexecuteForModel(DeleteRecordTool.Input input, Class<? extends Model> modelClass, Access access) Subclass hook — called for a JPA entity once the model is allowed.The input record class.name()Human-readable display name (e.g.protected OperationThe operation this tool performs, which the model's permissions are checked for.safety()Safety classification for approval decisions.Methods inherited from class com.axelor.ai.tool.system.ModelAwareSystemTool
beforeApproval, customFieldsByName, entityCustomFieldNames, entityCustomFields, entityFieldNames, execute, extractCustomFields, invalidChoice, invalidJsonValues, invalidValues, jsonFieldNames, jsonModelFields, jsonPropertyOf, parseAttrs, saveRecord, selectionOptions, selectionOptions, serializeAttrs, unknownFields, unknownFieldsMessage, unknownJsonFields, validateFields, validateJsonFieldsMethods 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, runsOutsideTransaction, undoneByRollback
-
Field Details
-
CODE
- See Also:
-
-
Constructor Details
-
DeleteRecordTool
public DeleteRecordTool()
-
-
Method Details
-
operation
Description copied from class:ModelAwareSystemToolThe operation this tool performs, which the model's permissions are checked for.- Specified by:
operationin classModelAwareSystemTool<DeleteRecordTool.Input>
-
safety
Description copied from interface:SystemToolSafety classification for approval decisions. Tools default toToolSafety.WRITE. Override toToolSafety.READ_ONLYfor safe tools that never require approval orToolSafety.DESTRUCTIVEfor tools that should always require approval. -
code
Description copied from interface:SystemToolUnique code matching AiTool.systemTool field. -
name
Description copied from interface:SystemToolHuman-readable display name (e.g. "Search Records"). -
description
Description copied from interface:SystemToolBrief description of what this tool does. -
inputType
Description copied from interface:SystemToolThe input record class. ReturnVoid.classfor tools with no input. -
callTitle
A batch is not one record; how many it was belongs to the card that lists them.- Parameters:
input- the call's input, or null when the tool takes nonename- the tool's configured display name
-
executeForModel
protected ToolResult executeForModel(DeleteRecordTool.Input input, Class<? extends Model> modelClass, Access access) Description copied from class:ModelAwareSystemToolSubclass hook — called for a JPA entity once the model is allowed.- Specified by:
executeForModelin classModelAwareSystemTool<DeleteRecordTool.Input>- Parameters:
access- what the call may do; the tool asks it about every record and field it touches, and may throwAccessDeniedfrom anywhere to refuse the call
-
checkForModel
protected ToolResult checkForModel(DeleteRecordTool.Input input, Class<? extends Model> modelClass, Access access) Description copied from class:ModelAwareSystemToolWhat the call would refuse on this entity, found without writing anything, so that a refusal known up front costs the user no approval; null when it would go through. The call checks again when it runs.- Overrides:
checkForModelin classModelAwareSystemTool<DeleteRecordTool.Input>
-
executeForJsonModel
protected ToolResult executeForJsonModel(DeleteRecordTool.Input input, MetaJsonModel jsonModel, Access access) Description copied from class:ModelAwareSystemToolSubclass hook — called for a custom model once it is allowed.- Specified by:
executeForJsonModelin classModelAwareSystemTool<DeleteRecordTool.Input>
-
checkForJsonModel
protected ToolResult checkForJsonModel(DeleteRecordTool.Input input, MetaJsonModel jsonModel, Access access) Description copied from class:ModelAwareSystemToolThe same for a custom model.- Overrides:
checkForJsonModelin classModelAwareSystemTool<DeleteRecordTool.Input>
-