public static PropertyTree toPropertyTree(Workflow wf, String agent) { PropertyTree pt = toBasicPropertyTree(PropertyNames.WORKFLOW_OBJECT, getUIDAsString(wf.getUID()), agent); pt.put(PropertyNames.WORKFLOW_PARENT_TASK_UID, getUIDAsString(wf.getParentTask().getUID())); Enumeration tasks = wf.getTasks(); StringBuffer sb = new StringBuffer(100); while (tasks.hasMoreElements()) { Task task = (Task)tasks.nextElement(); sb.append(getUIDAsString(task.getUID())); sb.append(","); } int n = sb.length(); if (n > 0)  { pt.put(PropertyNames.WORKFLOW_TASK_UIDS, sb.substring(0, n-1)); } return pt;
public static PropertyTree toPropertyTree(Object o, String agent) { return (o instanceof UniqueObject) ?  toPropertyTree((UniqueObject)o, agent) : null;
  public static PropertyTree toPropertyTree(Workflow wf, String agent) {    PropertyTree pt =       toBasicPropertyTree(PropertyNames.WORKFLOW_OBJECT,			  getUIDAsString(wf.getUID()),			  agent);    pt.put(PropertyNames.WORKFLOW_PARENT_TASK_UID,	   getUIDAsString(wf.getParentTask().getUID()));    Enumeration tasks = wf.getTasks();    StringBuffer sb = new StringBuffer(100);    while (tasks.hasMoreElements()) {      Task task = (Task)tasks.nextElement();      sb.append(getUIDAsString(task.getUID()));      sb.append(",");    }    int n = sb.length();    if (n > 0)  {      pt.put(PropertyNames.WORKFLOW_TASK_UIDS, sb.substring(0, n-1));    }    return pt;  }