How can i get name of field by using id?

cancel
Showing results for 
Search instead for 
Did you mean: 
vamsinipun
Established Member

How can i get name of field by using id?

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
vamsinipun
Established Member

Re: How can i get name of field by using id?

Please anyone reply on this.

daisuke-yoshimo
Senior Member

Re: How can i get name of field by using id?

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());

        }

    }