cancel
Showing results for 
Search instead for 
Did you mean: 

Trouble Retrieving form properties in my test

kethur
Champ in-the-making
Champ in-the-making
Hi,

I am trying to get the form properties but, i am not getting any form properties in my test case.  Could you please let me know if i am missing anything?



<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:activiti="http://activiti.org/bpmn" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:omgdc="http://www.omg.org/spec/DD/20100524/DC" xmlns:omgdi="http://www.omg.org/spec/DD/20100524/DI" typeLanguage="http://www.w3.org/2001/XMLSchema" expressionLanguage="http://www.w3.org/1999/XPath" targetNamespace="http://www.activiti.org/test">
  <process id="document_workflow" name="Document workflow">
    <startEvent id="starteventDocumentWorkflow" name="Start"></startEvent>
   <userTask id="usertaskRegistration" name="Registration">
    <extensionElements>
           <activiti:formProperty id="booleanProperty" name="Property" type="boolean" required="true" readable="true" writable="true" default="true"/>
           <activiti:formProperty id="stringProperty" name="Property" type="string" required="true" readable="true" writable="true" default="someString"/>
           <activiti:formProperty id="longProperty" name="Property" type="long" required="true" readable="true" writable="true" default="42"/>
           <activiti:formProperty id="longExpressionProperty" name="Property" type="long" required="true" readable="true" writable="true" default="${12 * 2 - 1}"/>
      </extensionElements>
   </userTask>
…………….
…………….



        Task task = taskService.createTaskQuery().processInstanceId(processInstance.getId()).singleResult();

        TaskFormData formData = formService.getTaskFormData(task.getId());
        List<FormProperty> formProperties = formData.getFormProperties();
         –>empty list


Thanks,
Raj
3 REPLIES 3

kethur
Champ in-the-making
Champ in-the-making
And By the way, I am looking at the right user task usertaskRegistration.

Raj

jbarrez
Star Contributor
Star Contributor
Don't see anything wrong at first sight. Do you have a simple unit test with that code that I can run to verify?

kethur
Champ in-the-making
Champ in-the-making
Sorry, that was my problem.  I was pointing to the wrong workflow.

Thanks,
Raj