in JBPM is possible to expose a custom REST Service in order to close custom task?
in the example below the process must wait a REST call from an external application in order to close the process.
How I can implement this requirement in JBPM 7.31?
CodePudding user response:
If you remove manager.completeWorkItem(workItem.getId(), results);
from RESTWorkItemHandler process execution will wait for completion of REST task. You can manually complete this task through kie-server REST API
[PUT] /server/containers/{containerId}/processes/instances/{processInstanceId}/workitems/{workItemId}/completed
Inplace of making REST task wait I will suggest to add Intermediate timer node or Intermediate Signal node inplace of REST task.
CodePudding user response:
having a signal or receive task would make more sense here instead of creating Url for each process instance to complete. you can provide your implementation of the receive task i.e. a generic service that completes your task. or a signal that you can trigger when your custom rest service is invoked.