08-09-2011 09:14 AM
<formProperties id="step1" name=" step1" type="enum" value="TaskA,TaskB" readable="true" />
<formProperties id="step2" name=" step2" type="string" value="TaskA,TaskB" readable="true" />
* List those values using List<FormProperty> formService.getTaskFormData(task.getId()).getFormProperties()
ProcessInstance processInstance = null;
try {
/**
* You must define "initiator" on StartEvent node
* FIXME Thead safe ?
*/
this.identityService.setAuthenticatedUserId("ofred");
processInstance = this.runtimeService.startProcessInstanceByKey("testGateway",
null,
new HashMap<String, Object>());
} finally {
this.identityService.setAuthenticatedUserId(null);
}
assertFalse(processInstance.isEnded());
//Step 1 : we should wait on usertask1
Task task = this.taskService.createTaskQuery()
.processInstanceId(processInstance.getId())
.singleResult();
assertEquals("User Task", task.getName());
//FORM
Object o = this.formService.getRenderedTaskForm(task.getId());
assertNull(o);
/**
* Get list of available user choice : pseudo out going transitions
* Process definition must be readable="true"
* ENUM types not yet supported see http://jira.codehaus.org/browse/ACT-882 as java enum (and sucks in designer)
*/
StartFormData startformData = this.formService.getStartFormData(processInstance.getProcessDefinitionId());
assertNotNull(startformData);
assertEquals(0, startformData.getFormProperties().size());
/**
* Only readable="true" will be visible
*/
TaskFormData formData = this.formService.getTaskFormData(task.getId());
List<FormProperty> data = formData.getFormProperties();
assertNotNull(data);
assertTrue(data.size() > 0);//FIXME fails !!
for (FormProperty prop : data) {
String id = prop.getId();
String value = prop.getValue();
}
03-18-2015 07:54 AM
03-24-2015 08:49 AM
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.