Package org.bgerp.plugin.ai.aixflow.dao
Class FileN8nTaskDAO
java.lang.Object
ru.bgcrm.dao.CommonDAO
org.bgerp.plugin.ai.aixflow.dao.FileN8nTaskDAO
DAO for file_n8n_tasks table
-
Nested Class Summary
Nested classes/interfaces inherited from class ru.bgcrm.dao.CommonDAO
CommonDAO.ObjectExtractor<T>, CommonDAO.RecordUpdater<T extends Id>
-
Field Summary
Fields inherited from class ru.bgcrm.dao.CommonDAO
con, SQL_AND, SQL_DELETE, SQL_DELETE_FROM, SQL_DESC, SQL_DISTINCT, SQL_FROM, SQL_GROUP_BY, SQL_INNER_JOIN, SQL_INSERT_IGNORE, SQL_INSERT_INTO, SQL_LEFT_JOIN, SQL_LIMIT, SQL_ON_DUP_KEY_UPDATE, SQL_ORDER_BY, SQL_REPLACE, SQL_SELECT, SQL_SELECT_ALL_FROM, SQL_SELECT_COUNT_ROWS, SQL_SET, SQL_UNION_ALL, SQL_UPDATE, SQL_VALUES, SQL_VALUES_1, SQL_VALUES_2, SQL_VALUES_3, SQL_VALUES_4, SQL_VALUES_5, SQL_WHERE
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreate
(FileN8nTask task) Create a new taskboolean
delete
(int id) Delete a taskgetAllTasks
(String status, int limit) Get all tasks with optional filteringgetByFileId
(int fileId) Get tasks by file IDgetById
(int id) Get a task by IDgetByTaskId
(String taskId) Get task by task IDboolean
updateTaskStatus
(String taskId, String status, String result, String errorMessage) Update task statusMethods inherited from class ru.bgcrm.dao.CommonDAO
deleteById, foundRows, getById, getGroupedIds, getGroupedIds, getIds, getIds, getPageLimit, getPeriodSql, lastInsertId, setPeriodParamValue, setRecordCount, update, updateColumn, updateIds, updateIds, updateOrInsert
-
Constructor Details
-
FileN8nTaskDAO
-
-
Method Details
-
create
Create a new task- Parameters:
task
- the task to create- Returns:
- the created task with ID set
- Throws:
SQLException
- if a database error occurs
-
getById
Get a task by ID- Parameters:
id
- the task ID- Returns:
- the task or null if not found
- Throws:
SQLException
- if a database error occurs
-
getByFileId
Get tasks by file ID- Parameters:
fileId
- the file ID- Returns:
- list of tasks for the file
- Throws:
SQLException
- if a database error occurs
-
getByTaskId
Get task by task ID- Parameters:
taskId
- the n8n task ID- Returns:
- the task or null if not found
- Throws:
SQLException
- if a database error occurs
-
updateTaskStatus
public boolean updateTaskStatus(String taskId, String status, String result, String errorMessage) throws SQLException Update task status- Parameters:
taskId
- the n8n task IDstatus
- the new statusresult
- the result (can be null)errorMessage
- the error message (can be null)- Returns:
- true if the task was updated, false if not found
- Throws:
SQLException
- if a database error occurs
-
delete
Delete a task- Parameters:
id
- the task ID- Returns:
- true if the task was deleted, false if not found
- Throws:
SQLException
- if a database error occurs
-
getAllTasks
Get all tasks with optional filtering- Parameters:
status
- optional status filterlimit
- maximum number of tasks to return (0 for no limit)- Returns:
- list of all tasks matching the criteria
- Throws:
SQLException
- if a database error occurs
-