fjtirado commented on code in PR #4213:
URL: 
https://github.com/apache/incubator-kie-kogito-runtimes/pull/4213#discussion_r2996059182


##########
kogito-workitems/kogito-rest-workitem/src/main/java/org/kogito/workitem/rest/RestWorkItemHandler.java:
##########
@@ -176,19 +178,18 @@ public Optional<WorkItemTransition> 
activateWorkItemHandler(KogitoWorkItemManage
         }
         if (isEmpty(path)) {
             path = endPoint;
-            logger.debug("Path is empty, using whole endpoint {}", endPoint);
+            logger.info("Path is empty, using whole endpoint {}", endPoint);
         }
         if (isEmpty(protocol)) {
             protocol = port == DEFAULT_SSL_PORT ? HTTPS_PROTOCOL : 
HTTP_PROTOCOL;
         }
-        logger.debug("Invoking request with protocol {} host {} port {} and 
endpoint {}", protocol, host, port, path);
 
         WebClient client = isHttps(protocol) ? httpsClient : httpClient;
         HttpRequest<Buffer> request = client.request(method, port, host, path);
         WorkItemRecordParameters.recordInputParameters(workItem, parameters);
-        requestDecorators.forEach(d -> d.decorate(workItem, parameters, 
request));
-        authDecorators.forEach(d -> d.decorate(workItem, parameters, request));
-        paramsDecorator.decorate(workItem, parameters, request);
+        requestDecorators.forEach(d -> d.decorate(workItem, parameters, 
request, handler));

Review Comment:
   In my opinion, The handler should not be a explicit argument for the 
decorator. You are passing it because you want to access to the application 
object (to retrieve the authprovider) in one of the implementations. 
   Even when keeping the current approach (which Im not sure is useful because 
I cannot see how header propagation for a particular process instance is going 
to work) the `KogitoWorkItem` has access to the `KogitoProcessInstance` and 
from there you will have access to `InternalProcessRuntime`, which has also 
access to the Kogito Application, so this extra parameter and all the changes 
in all decorators, are not needed and should be reverted 
   See access to InternalProcessRuntime from ProcessInstance  here 
https://github.com/apache/incubator-kie-kogito-runtimes/blob/main/jbpm/jbpm-flow/src/main/java/org/jbpm/process/instance/ProcessInstance.java#L53
 and ProcessInstance from KogitoWorkItem here 
https://github.com/apache/incubator-kie-kogito-runtimes/blob/main/api/kogito-api/src/main/java/org/kie/kogito/internal/process/workitem/KogitoWorkItem.java#L92
 
   Therefore, the decorator interface should have not been changed, because 
application was already accesible throuw KogitoWorkITem (basically anything you 
will ever need will be there)



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