cancel
Showing results for 
Search instead for 
Did you mean: 

How can i get name of field by using id?

vamsinipun
Star Contributor
Star Contributor

Hi,

I am using activiti in my spring web application and would like to get the name of field by using id. please let me know how to get the name?

Here id is reporting_manager_comments but name is Comments. I would like to display history of task with name. Please help me out solve this issue.

Thanks

2 REPLIES 2

vamsinipun
Star Contributor
Star Contributor

Please anyone reply on this.

daisuke-yoshimo
Star Collaborator
Star Collaborator

You can resolve the field name of form propery by using FormService.class

FormService (Activiti - Engine 6.0.0 API) 

TaskFormData (Activiti - Engine 6.0.0 API) 

Example code

    TaskFormData formData = formService.getTaskFormData(task.getId());

    List<FormProperty> formProperties = formData.getFormProperties();

    for(FormProperty prop : formProperties){

        if ("YOUR_ID".equals(prop.getId())){

            System.out.println(prop.getName());

        }

    }