Generated Task Form Field Validations Rest API


#1

Dear

In one of the human task we are using Generated Task Form, by using modeler we added Validations and constraints for each fields and is working as expected when the form is loaded using the task List. I would like to know is there any REST API which provides the form fields associated to the task along with validations and constraints.


#2

Hello Narendra,

We are providing these two options only:
https://docs.camunda.org/manual/latest/reference/rest/task/get-form-variables/
https://docs.camunda.org/manual/latest/reference/rest/task/get-rendered-form/

Best regards,
Yana


#3

Hi @yana.vasileva

Thanks for your response, but what is the other option I have to get the form validation rules?

Best Regards
Naren


#4

@narenk you have to use the API to get the BPMN xml and then parse it.


#5

@camunda @thorben, we see this type of request (needing to access xml based data from the bpmn) come up often (and often in the forum).
What are your thoughts on having the REST API: https://docs.camunda.org/manual/7.8/reference/rest/process-definition/get-xml/ provide additional filters allowing something like a xpath filter to return specific values in the XML rather than having to do this on the client side (for REST API usage).


#6

Hi Stephen,

What would be the benefit of having this? If I use an API that returns XML, I need a client that is able to understand and work with XML. From there it is not far too xpath, or am I missing something?

As a minor consideration, letting a server execute arbitrary code-like queries rings the “remote code execution” key in my ear, although I do not know if this is a problem here.

Cheers,
Thorben


#7

Most of the reoccurring requests are always for something similar to the above in this thread: I want all User Tasks for XYZ extension, I was extension data from Task_AB*, i want form validation data, etc. If there was something xpath (or a simple less “scary”), something like a small dsl to crawl the xml as part of a server request, this would increase the APIs ability to return valuable data, and it would also increase the community’s sharing capacity: now its a reusable API command that can be shared, rather than a “just parse the XML” response.

Yes i agree. Its a fine line :wink: