leoluzh opened a new issue, #7054:
URL: https://github.com/apache/incubator-kie/issues/7054

   ### Kogito version
   10.1.0 (Quarkus 3.15.x, Java 21). Still reproducible by code inspection on 
`main`.
   
   ### Describe the bug
   When a BPMN user task defines a deadline notification (`NotStartedNotify` / 
`NotCompletedNotify`)
   and the application uses the external Jobs Service integration via
   `kogito-addons-quarkus-jobs-management`, **task activation fails and the 
whole process
   instance transitions to ERROR state (state=5) at creation time**.
   
   Root cause: `UserTaskInstanceJobDescription.path()` is a stub returning 
`null`:
   
https://github.com/apache/incubator-kie-kogito-runtimes/blob/10.1.0/api/kogito-api/src/main/java/org/kie/kogito/jobs/descriptors/UserTaskInstanceJobDescription.java#L77-L79
   
   `JobCallbackResourceDef.buildCallbackURI` concatenates it without validation:
   `jobsCallbackEndpoint + description.path()` → `"http://runtime-service:8080"; 
+ null`
   → `"http://runtime-service:8080null"` → `MalformedURLException` / 
`NumberFormatException`
   when the JDK parses `"8080null"` as a port.
   
   Additionally, there is no REST callback resource for user task jobs:
   `CallbackJobsServiceResource` only exposes
   
`/management/jobs/{processId}/instances/{processInstanceId}/timers/{timerId}` 
(process timers).
   The only executor able to handle `UserTaskInstanceJobDescription` is
   `InMemoryUserTaskJobExecutorFactory` (in-VM). The same broken 
`buildCallbackURI` is also used by
   `kogito-addons-quarkus-jobs-messaging` 
(`AbstractReactiveMessagingJobsService`), so the Kafka
   integration is equally affected.
   
   ### Stack trace
   ```
   org.jbpm.workflow.instance.WorkflowRuntimeException: ... -- Not valid URI: 
http://runtime-service:8080null
   Caused by: java.lang.IllegalArgumentException: Not valid URI: 
http://runtime-service:8080null
       at org.kie.kogito.jobs.api.URIBuilder.toURI(URIBuilder.java:49)
       at 
org.kie.kogito.jobs.api.JobCallbackResourceDef.buildCallbackURI(JobCallbackResourceDef.java:63)
       at 
org.kie.kogito.jobs.management.RestJobsService.getCallbackEndpoint(RestJobsService.java:50)
       at 
org.kie.kogito.jobs.management.quarkus.VertxJobsService.scheduleJob(VertxJobsService.java:92)
       at 
org.kie.kogito.usertask.impl.DefaultUserTaskInstance.initTimers(DefaultUserTaskInstance.java:671)
       at 
org.kie.kogito.usertask.impl.DefaultUserTaskInstance.startNotCompletedDeadlines(DefaultUserTaskInstance.java:709)
   Caused by: java.net.MalformedURLException: Error at index 4 in: "8080null"
   Caused by: java.lang.NumberFormatException: Error at index 4 in: "8080null"
   ```
   
   ### To Reproduce
   1. Quarkus Kogito 10.1.0 project with 
`kogito-addons-quarkus-jobs-management`,
      `kogito.jobs-service.url` and `kogito.service.url` configured against an 
external Jobs Service.
   2. BPMN with a user task containing e.g.
      `NotCompletedNotify = 
[from:[email protected]|tousers:|togroups:|toemails:[email protected]|subject:s|body:b]@[P2D]`
   3. Start a process instance → activation throws, instance persisted in ERROR 
state.
   
   ### Expected behavior
   Either user task deadline jobs are supported by the external Jobs Service 
integration
   (valid `path()` + a callback resource that resolves the `UserTaskInstance` 
and calls
   `trigger(jobDescription)`, mirroring 
`SignalUserTaskInstanceOnExpiredTimer`), or the
   combination fails gracefully at build time / is documented as unsupported — 
instead of
   breaking process instance creation at runtime.
   
   ### Additional context
   Related: apache/incubator-kie-issues#1858 added the missing fields 
(processId, processInstanceId, nodeInstanceId,
   metadata) to `UserTaskInstanceJobDescription` and wired user task jobs into 
the
   **embedded** jobs service, but `path()` remained `null`, so the 
REST/messaging
   integrations are still broken. Workarounds validated: embedded jobs service
   (`kogito-addons-quarkus-jobs-service-embedded`) or a non-interrupting 
boundary timer
   + service task instead of native notifications.


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