}
private void updateSelf() {
Set availableWorkItems = _engineClient.getAvailableWorkItems();
for (Iterator iterator = availableWorkItems.iterator(); iterator.hasNext();) {
YWorkItem item = (YWorkItem) iterator.next();
if (item.getStatus().equals(YWorkItem.statusEnabled)) {
addEnabledWorkItem(item);
} else if (item.getStatus().equals(YWorkItem.statusFired)) {
addFiredWorkItem(item);
}
}
Set allWorkItems = _engineClient.getAllWorkItems();
for (Iterator iterator = allWorkItems.iterator(); iterator.hasNext();) {
YWorkItem item = (YWorkItem) iterator.next();
if (item.getStatus().equals(YWorkItem.statusExecuting)) {
if (item.getUserWhoIsExecutingThisItem().equals(_username)) {
addStartedWorkItem(item);
}
}
if (_paramsDefinitions.getParamsForTask(item.getTaskID()) == null) {
YTask task = _engineClient.getTaskDefinition(item.getSpecificationID(), item.getTaskID());
String paramsAsXML = task.getInformation();
TaskInformation taskInfo = Marshaller.unmarshalTaskInformation(paramsAsXML);
YParametersSchema paramsForTask = taskInfo.getParamSchema();
_paramsDefinitions.setParamsForTask(item.getTaskID(), paramsForTask);
}
}
}