10-23-2013 06:28 PM
<userTask id="handleRequest" name="Handle request">
<extensionElements>
<activiti:formProperty id="requestApproved"
name="Do you approve this request" type="enum" required="true">
<activiti:value id="true" name="Approve" />
<activiti:value id="false" name="Reject" />
</activiti:formProperty>
<activiti:formProperty id="status" name="Status"
type="string" default="ACTIVE" readable="true" writable="false" />
</extensionElements>
<potentialOwner>
<resourceAssignmentExpression>
<formalExpression>approver</formalExpression>
</resourceAssignmentExpression>
</potentialOwner>
</userTask>
final FormProperty formProperty = formService.getTaskFormData(task.getId()).getFormProperties().get(1);
final String value = formProperty.getValue();
assertEquals("ACTIVE", value);
formService.submitTaskFormData(task.getId(), Collections.singletonMap("requestApproved", (Object) "true"));
if (!isWritable && properties.containsKey(id)) {
throw new ActivitiException("form property '"+id+"' is not writable");
}
if (propertyExits || (modelValue != null)) {
if (variableName != null) {
execution.setVariable(variableName, modelValue);
} else if (variableExpression != null) {
variableExpression.setValue(modelValue, execution);
} else {
execution.setVariable(id, modelValue);
}
}
if (propertyExits || (modelValue != null)) {
if (variableName != null) {
execution.setVariable(variableName, modelValue);
} else if (variableExpression != null) {
variableExpression.setValue(modelValue, execution);
} else if (isWritable) {
execution.setVariable(id, modelValue);
}
}
10-24-2013 05:58 PM
try {
properties = new HashMap<String, String>();
properties.put("speaker", "its not allowed to update speaker!");
formService.submitTaskFormData(taskId, properties);
fail("expected exception about a non writable form property 'speaker'");
} catch (ActivitiException e) {
// OK
}
10-25-2013 10:29 PM
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.