AnsweredAssumed Answered

activity:formProperty predefined value

Question asked by artur.karczmarczyk on Oct 4, 2011
Latest reply on Oct 4, 2011 by ruben1
Hi,

I've created a process definition using Activiti Eclipse BPMN 2.0 Designer 5.7.0. The process definition contains a following user task:


<userTask id="UT1" name="User task name" activiti:candidateGroups="GROUP_ADMIN">
   <extensionElements>
      <activiti:formProperty id="url" name="url" type="string" variable="abc" required="true" readable="true" writable="true">
      </activiti:formProperty>
   </extensionElements>
</userTask>

Although I set the value parameter (value="abc") of the formProperty url in the activiti designer, and as you see in the code above the variable parameter is set to "abc", when I execute the following code in my app:


TaskQuery taskQuery = activitiTaskService.createTaskQuery();
List<Task> qtasks = taskQuery.list();
Assert.assertTrue(qtasks.size() > 0);
Task task1 = qtasks.get(0);
List<FormProperty> formProperties = activitiService.getFormService().getTaskFormData(task1.getId()).getFormProperties();
Assert.assertNotNull(formProperties.get(0).getValue());

the last assertion fails. Can anyone show me what I am doing wrong? Is it possible to create a process with a predefined form property value?

In my app I am going to create the bpmn20.xml file dynamically and then parse it, deploy and run. Every usertask in the process is going to contain title and an URL to some action on the website. Optionally, it will also contain some description. Then the task assignee will read the description, click on the link and be redirected to the URL. I somehow need to inject the URL to the usertask during the dynamic creation of the bpmn20.xml file. Any ideas how to do it, in case the above idea with activiti:formProperty fails?

Outcomes