Class DbUpgradeStep1To2MigrateAgentExchanges
java.lang.Object
com.flowable.agent.engine.db.upgrade.DbUpgradeStep1To2MigrateAgentExchanges
- All Implemented Interfaces:
org.flowable.common.engine.impl.db.DbUpgradeStep
public class DbUpgradeStep1To2MigrateAgentExchanges
extends Object
implements org.flowable.common.engine.impl.db.DbUpgradeStep
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static final record -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidcreateExchangeAndExchangePartsForInvocation(Connection connection, String databasePrefix, String invocationId, Date startTime, Date endTime, String userId, Long promptTokenCount, Long outputTokenCount, List<DbUpgradeStep1To2MigrateAgentExchanges.ExchangeData> exchangeDataFromSameInvocation, AtomicInteger exchangeTransactionOrder) protected StringcreatePaginatedQuery(String baseQuery, int page, int pageSize, String databaseType) voidexecute()getAssistantExchanges(List<DbUpgradeStep1To2MigrateAgentExchanges.ExchangeData> exchangeDataFromSameInvocation) protected org.flowable.common.engine.impl.db.SchemaManagerDatabaseConfigurationgetExchangeDataFromSameInvocation(Connection connection, String table, String agentInstanceId, String operationKey) getExchanges(PreparedStatement preparedStatement) getIntentExchange(List<DbUpgradeStep1To2MigrateAgentExchanges.ExchangeData> exchangeDataFromSameInvocation) getSystemExchange(List<DbUpgradeStep1To2MigrateAgentExchanges.ExchangeData> exchangeDataFromSameInvocation) getUserExchange(List<DbUpgradeStep1To2MigrateAgentExchanges.ExchangeData> exchangeDataFromSameInvocation) protected voidinsertAgentInvocation(Connection connection, String databasePrefix, String id, String agentInstanceId, String operationKey, Date startTime, Date endTime, String userId, Long promptTokenCount, Long outputTokenCount) protected StringinsertExchange(Connection connection, String databasePrefix, String invocationId, Date startTime, Date endTime, String exchangeType, String exchangeSubType, String userId, Long promptTokenCount, Long outputTokenCount, int exchangeTransactionOrder) protected voidinsertExchangePart(Connection connection, String databasePrefix, String exchangeId, String type, String subType, String content, int invocationSequence) protected booleannewGroupNeeded(List<DbUpgradeStep1To2MigrateAgentExchanges.ExchangeData> currentGroup, String newType)
-
Constructor Details
-
DbUpgradeStep1To2MigrateAgentExchanges
public DbUpgradeStep1To2MigrateAgentExchanges()
-
-
Method Details
-
execute
- Specified by:
executein interfaceorg.flowable.common.engine.impl.db.DbUpgradeStep- Throws:
Exception
-
createPaginatedQuery
-
getExchangeDataFromSameInvocation
protected List<DbUpgradeStep1To2MigrateAgentExchanges.ExchangeData> getExchangeDataFromSameInvocation(Connection connection, String table, String agentInstanceId, String operationKey) -
getExchanges
protected List<DbUpgradeStep1To2MigrateAgentExchanges.ExchangeData> getExchanges(PreparedStatement preparedStatement) throws SQLException - Throws:
SQLException
-
insertAgentInvocation
protected void insertAgentInvocation(Connection connection, String databasePrefix, String id, String agentInstanceId, String operationKey, Date startTime, Date endTime, String userId, Long promptTokenCount, Long outputTokenCount) throws SQLException - Throws:
SQLException
-
newGroupNeeded
protected boolean newGroupNeeded(List<DbUpgradeStep1To2MigrateAgentExchanges.ExchangeData> currentGroup, String newType) -
createExchangeAndExchangePartsForInvocation
protected void createExchangeAndExchangePartsForInvocation(Connection connection, String databasePrefix, String invocationId, Date startTime, Date endTime, String userId, Long promptTokenCount, Long outputTokenCount, List<DbUpgradeStep1To2MigrateAgentExchanges.ExchangeData> exchangeDataFromSameInvocation, AtomicInteger exchangeTransactionOrder) throws SQLException - Throws:
SQLException
-
insertExchange
protected String insertExchange(Connection connection, String databasePrefix, String invocationId, Date startTime, Date endTime, String exchangeType, String exchangeSubType, String userId, Long promptTokenCount, Long outputTokenCount, int exchangeTransactionOrder) throws SQLException - Throws:
SQLException
-
insertExchangePart
protected void insertExchangePart(Connection connection, String databasePrefix, String exchangeId, String type, String subType, String content, int invocationSequence) throws SQLException - Throws:
SQLException
-
getSystemExchange
protected DbUpgradeStep1To2MigrateAgentExchanges.ExchangeData getSystemExchange(List<DbUpgradeStep1To2MigrateAgentExchanges.ExchangeData> exchangeDataFromSameInvocation) -
getUserExchange
protected DbUpgradeStep1To2MigrateAgentExchanges.ExchangeData getUserExchange(List<DbUpgradeStep1To2MigrateAgentExchanges.ExchangeData> exchangeDataFromSameInvocation) -
getIntentExchange
protected DbUpgradeStep1To2MigrateAgentExchanges.ExchangeData getIntentExchange(List<DbUpgradeStep1To2MigrateAgentExchanges.ExchangeData> exchangeDataFromSameInvocation) -
getAssistantExchanges
protected List<DbUpgradeStep1To2MigrateAgentExchanges.ExchangeData> getAssistantExchanges(List<DbUpgradeStep1To2MigrateAgentExchanges.ExchangeData> exchangeDataFromSameInvocation) -
getDatabaseConfiguration
protected org.flowable.common.engine.impl.db.SchemaManagerDatabaseConfiguration getDatabaseConfiguration()
-