Weird result on edge case of Get workflow transition rule configuration

Hi,

when setting up a mock implementation for the Get workflow transition rule configurations API call used in migrating app specific workflow rules, I stumbled across an edge case: What if the workflowEntityId passed in is not valid, e.g. “*****” instead of a real id?

Currently, the API returns something weird, e.g.

{
  validRules: [],
  invalidRules: [ '9f16d3bf-d08a-4fc3-8ec6-fbf1c4df0efd' ],
  workflowEntityId: '****'
}

Looking into the documentation, the response example also does not match the real responses - there is no surrounding WorkflowRulesSearchDetails element. Since the call is about retrieval, I guess it would be easier if the call returned Array<WorkflowRulesSearchDetails>, such that the response to an invalid workflowEntityId parameter would simply be an empty array. This could fix the weird edge case, and also make handling of this API call easier.

Hi @UdoHagemannDecadisAG

the response example also does not match the real responses

Thank you for reporting this. We’ll fix our documentation for this.

it would be easier if the call returned Array<WorkflowRulesSearchDetails>

Thanks for sharing your feedback.
I understand the proposed change in the response payload will be a breaking change for the consumers of existing API.

This could fix the weird edge case, and also make handling of this API call easier.

Do you think returning appropriate HTTP error code (404 Not Found) for invalid workflowEntityId will make handling of this API easier ?

I understand the proposed change as an improvement in response of this API on edge case error scenario and not a blocker for your app migration. Please correct, if my understanding is not correct.

Hi @HariharanRajendran,

thanks, yes, I think returning a 404 response for this type of edge case would be fine as well.
And you’re right, nothing urgent, just a suggestion for improvement.

Hi Team,

As @HariharanRajendran mentioned, we’ll get the documentation updated soon to display the correct response from the rest endpoint. As for the HTTP 404 response, that’s a larger discussion so I’m not sure if we’ll have an update on that anytime soon.

Regards,
James.

1 Like