}
private void addTasksToDoc(Document doc, List tasks) {
if (tasks != null && tasks.size() > 0) {
for (Iterator i = tasks.iterator(); i.hasNext();) {
WorkflowTask task = (WorkflowTask) i.next();
doc.add(new Field("task_id", task.getTaskId(), Field.Store.YES,
Field.Index.UN_TOKENIZED));
doc.add(new Field("task_name", task.getTaskName(),
Field.Store.YES, Field.Index.NO));
doc.add(new Field("task_order",
String.valueOf(task.getOrder()), Field.Store.YES,
Field.Index.NO));
doc.add(new Field("task_class",
task.getTaskInstanceClassName(), Field.Store.YES,
Field.Index.NO));
addConditionsToDoc(task.getTaskId(), task.getConditions(), doc);
addTaskConfigToDoc(task.getTaskId(), task.getTaskConfig(), doc);
}
}
}