cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Workflow API error 422- Unprocessable entity

StarDev
Participant
0 Likes
4,457

Hi All,

I am using workflows API to start and complete workflows from ABAP code given in the link below through restful abap.

I am able to successfully Start and Close workflows via abap code to call workflow API. The problem comes up when one user claims the workflow from My inbox and tries to complete it, Same abap code gets called trying to complete the workflow. But the API call gives an error 422 saying the entity is unprocessable. If the user unclaims it, we are able to successfully complete the workflows. Any help would be really appreciated.

https://blogs.sap.com/2019/07/09/leveraging-scp-neo-workflow-from-the-scp-abap-environment/comment-p...

View Entire Topic
StarDev
Participant
0 Likes

HI Tobias. Thanks for your commments.

Yeah its the same user

For example if i click on complete without claiming as shown below.

https://api.workflow-sap.cfapps.eu10.hana.ondemand.com/workflow-service/rest/v1/task-instances/b44a7...

Output from response is

Error case. Same user claims it and tries to complete it

https://api.workflow-sap.cfapps.eu10.hana.ondemand.com/workflow-service/rest/v1/task-instances/10623...

I get error 422.

Also i noticed when i claim it( on click of claim button) there is a std api call which changes the status to RESERVED.

Something similiar happens when i unclaim ( Release ) it

tobias_breyer
Product and Topic Expert
Product and Topic Expert

Hi Ravi,

it is difficult to judge from looking at the screenshots. I still think it is quite likely that it is not the same user for both calls. Are you sure that the call that goes goes from the ABAP to workflow service isn't OAuth2 client-credentials based (i.e. using the service keys, not going via e. g. an approuter or Portal)? Technical users will usually never have real tasks or if they try to complete a task already reserved by a real user, they will "always" be different from the real user and get that error message.

If you can confirm it is the same user, I'd recommend opening a support ticket at LOD-BPM-WFS so that we can look at the data.

Regards,

Tobias