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();
}
08-10-2011 07:30 AM
08-10-2011 08:51 AM
if ${userChoiceFlow=='pathA'} then move on to TaskA
if ${userChoiceFlow=='pathB'} then move on to TaskB
<bpmn2:UserTask …>
<formProperties id="step1" name="step1" type="string" value="pathA,pathB" readable="true" />
</bpmn2:UserTask>
for (FormProperty prop : formService.getTaskFormData(task.getId())) {
String id = prop.getId();
String value = prop.getValue();
}
I've also check vars :
Map<String, Object> v1 = runtimeService.getVariables(processInstance.getId());
Map<String, Object> v2 = runtimeService.getVariablesLocal(task.getExecutionId());
Map<String, Object> v3 = taskService.getVariables(task.getId());
Map<String, Object> v4 = taskService.getVariablesLocal(task.getId());
But they're all empty.08-10-2011 09:47 AM
08-10-2011 10:03 AM
/**
* @author Tom Baeyens
*/
public class EnumFormType extends AbstractFormType {
protected Map<String, String> values;
public EnumFormType(Map<String, String> values) {
this.values = values;
}
public String getName() {
return "enum";
}
…
04-02-2014 03:12 PM
08-10-2011 11:15 AM
<activiti:formProperty id="direction" type="enum">
<activiti:value id="left" name="Go Left" />
<activiti:value id="right" name="Go Right" />
<activiti:value id="up" name="Go Up" />
<activiti:value id="down" name="Go Down" />
</activiti:formProperty>
<activiti:formProperty id="step2" name="step2" type="enum" variable="TaskA,TaskB" required="false" readable="true" writable="true"></activiti:formProperty>
08-16-2011 08:12 AM
12-22-2011 07:11 AM
04-07-2014 05:26 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.