Francesco Motta
Francesco Motta

Reputation: 61

JBPM 7.31 how to expose a REST service to close task

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?

Process example

Upvotes: 0

Views: 203

Answers (2)

Abbas Kararawala
Abbas Kararawala

Reputation: 1254

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.

Upvotes: 1

Abhijit Humbe
Abhijit Humbe

Reputation: 1631

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.

Upvotes: 1

Related Questions