fjtirado commented on code in PR #3441:
URL:
https://github.com/apache/incubator-kie-kogito-runtimes/pull/3441#discussion_r1526100548
##########
addons/common/persistence/jdbc/src/main/java/org/kie/kogito/persistence/jdbc/GenericRepository.java:
##########
@@ -140,6 +143,19 @@ Optional<Record> findByIdInternal(String processId, String
processVersion, UUID
return Optional.empty();
}
+ @Override
+ Optional<Record> findByBusinessKey(String processId, String
processVersion, String businessKey) {
+ try (Connection connection = dataSource.getConnection();
+ PreparedStatement statement =
connection.prepareStatement(FIND_BY_BUSINESS_KEY)) {
+ statement.setString(1, businessKey);
+ try (ResultSet resultSet = statement.executeQuery()) {
+ return resultSet.next() ? Optional.of(from(resultSet)) :
Optional.empty();
+ }
+ } catch (Exception e) {
+ throw uncheckedException(e, "Error finding process instance using
business key %s", businessKey);
Review Comment:
yes, thats a good point, it provides more infor for debugging, changing it
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]