AnsweredAssumed Answered

Expression to custom form field

Question asked by jwistrom on Jun 24, 2015
Latest reply on Jun 30, 2015 by jbarrez
Hi
I have been wrestling with this problem for a while and I really hope someone could assist me with this. I am fairly new to Activiti so I will try to describe as detailed as possible what I am looking for and what I have tried.

I have created my first custom form field (I am not using activiti explorer) and a corresponding form type. The field consists of two tables with drag and drop functionality. I have created the form type so it accepts two values, like this


<activiti:formProperty expression="${formDataService.getUsers(tenantid)}" id="role_consultants" name="Chose consultants (C)" type="doubleTable">
          <activiti:value id="leftTableCaption" name="Available users"/>
          <activiti:value id="rightTableCaption" name="Assigned as consultants"/>
        </activiti:formProperty>


This works great…almost. The form is rendered with my custom field and two tables are shown with corresponding captions (as in code). I can pass in the expression with all the users (that end up in the "available users"-table). This is a recurring task so when I open the task again I want the users I draged to the "assigned as consultants"-table the first time (i.e. the users in the variable role_consultants) to show in that table when I open the task the second time. The users are stored in the variable correctly but I can't pass it in. I can only pass in the expression. My idea was something like this:


<activiti:formProperty  id="role_consultants" name="Chose consultants (C)" type="doubleTable">
          <activiti:value id="leftTableCaption" name="Available users"/>
          <activiti:value id="rightTableCaption" name="Assigned as consultants"/>
          <activiti:value id="availableUsers" name="${formDataService.getUsers(tenantid)}"/>
        </activiti:formProperty>


i.e. pass in the expression with available users as an additional value but I noticed that activiti:value does not support expressions. The only thing that is passed in is the actual string "${formDataService.getUsers(tenantid)}" and that does me no good :)
So, can I evaluate this string that is passed in as an expression in the form type or can I solve this problem another way?

Very greatful for any help.

Rgds
Johan

Outcomes