* @throws ItemNotFoundException
* @throws RepositoryException
*/
public WorkflowDefinition retrieveWorkflowDefinition(String id) throws ItemNotFoundException, RepositoryException {
log.fine("JCRManager.retrieveWorkflowDefinition()");
WorkflowDefinition _retVal = null;
try {
this.getSession();
String _queryString = "//WorkflowDefinition[@id=\"" + id + "\"]";
log.fine("Query string:" + _queryString);
NodeIterator _nodes = this.executeQuery(_queryString);
if (_nodes.getSize() == 0) {
log.fine("No WorkflowDefinition with id " + id + " found");
throw new ItemNotFoundException("WorkflowDefinition id = " + id + " was not found");
}
else {
Node _node = _nodes.nextNode();
Property _propId = _node.getProperty("id");
Property _propOwner = _node.getProperty("owner");
Property _propVersion = _node.getProperty("version");
Property _propDescription = _node.getProperty("description");
Property _propDate = _node.getProperty("date");
_retVal = new WorkflowDefinition(_propId.getString(), _propOwner.getString(), null);
_retVal.setDate(_propDate.getDate().getTime());
_retVal.setDescription(_propDescription.getString());
_retVal.setVersion(_propVersion.getString());
}
} finally {
log.fine("logging out session");
session.logout();
}