wmedvede commented on code in PR #3441:
URL: 
https://github.com/apache/incubator-kie-kogito-runtimes/pull/3441#discussion_r1526093584


##########
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:
   I see what you mean, but IMO, in that case, what people is invoking is the 
interface, and thus, they say, "I want to get a process instance for  
"my_process", in the version "xxx" and that has the businessKey = "yyyy".
   The fact that the interface internally is never using some parameters is a 
different story.
   
   And thus, If this fails, for me, it makes sense to have message I mentioned, 
because it helps to link the error to the action you wanted to execute. But np.
   
   
   



-- 
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]

Reply via email to