Asset prototype = parent_task.getDirectObject(); NewTask subtask = ldmFactory_.newTask();  subtask.setDirectObject( prototype); subtask.setParentTask( parent_task ); subtask.setPlan( parent_task.getPlan() ); subtask.setPrepositionalPhrases( parent_task.getPrepositionalPhrases() ); subtask.setPriority(parent_task.getPriority()); subtask.setSource( clusterId_ ); if (parent_task.getVerb().equals(Constants.Verb.PROJECTSUPPLY)) { subtask.setVerb(PROJECTWITHDRAWVERB); } else { subtask.setVerb(WITHDRAWVERB); }  Vector prefs = new Vector(); int aspect_type; Preference pref; Enumeration preferences = parent_task.getPreferences(); while (preferences.hasMoreElements()) { pref = (Preference)preferences.nextElement(); aspect_type = pref.getAspectType();   if ((aspect_type != AspectType.QUANTITY) && (aspect_type != AspectType.INTERVAL) && (aspect_type != AlpineAspectType.DEMANDRATE)) { prefs.addElement(pref); } } subtask.setPreferences(prefs.elements()); return subtask;
Asset prototype = parent_task.getDirectObject(); NewTask subtask = ldmFactory_.newTask();  subtask.setDirectObject(prototype); subtask.setParentTask(parent_task); subtask.setPlan(parent_task.getPlan()); subtask.setPrepositionalPhrases(parent_task.getPrepositionalPhrases()); subtask.setPriority(parent_task.getPriority()); subtask.setSource(clusterId_); if (parent_task.getVerb().equals(Constants.Verb.PROJECTSUPPLY)) { subtask.setVerb(PROJECTWITHDRAWVERB); } else { subtask.setVerb(WITHDRAWVERB);
    protected NewTask createWithdrawTask(Task parent_task) {	// Create new task	Asset prototype = parent_task.getDirectObject();	NewTask subtask = ldmFactory_.newTask();	// attach withdraw task to parent and fill it in	subtask.setDirectObject( prototype);	subtask.setParentTask( parent_task );	subtask.setPlan( parent_task.getPlan() );	subtask.setPrepositionalPhrases( parent_task.getPrepositionalPhrases() );	subtask.setPriority(parent_task.getPriority());	subtask.setSource( clusterId_ );	if (parent_task.getVerb().equals(Constants.Verb.PROJECTSUPPLY)) {	    subtask.setVerb(PROJECTWITHDRAWVERB);	} else {	    subtask.setVerb(WITHDRAWVERB);	}	// Copy all preferences that aren't used for repetitive tasks	Vector prefs = new Vector();	int aspect_type;	Preference pref;	Enumeration preferences = parent_task.getPreferences();	while (preferences.hasMoreElements()) {	    pref = (Preference)preferences.nextElement();	    aspect_type = pref.getAspectType();	    // Quanity added to withdraw by task specific method.	    // Inerval and DemandRate are not added to withdraw task.	    if ((aspect_type != AspectType.QUANTITY) && 		(aspect_type != AspectType.INTERVAL) &&		(aspect_type != AlpineAspectType.DEMANDRATE)) {		prefs.addElement(pref);	    }	}	subtask.setPreferences(prefs.elements());	return subtask;    }