001: /*
002: * <copyright>
003: *
004: * Copyright 1997-2004 BBNT Solutions, LLC
005: * under sponsorship of the Defense Advanced Research Projects
006: * Agency (DARPA).
007: *
008: * You can redistribute this software and/or modify it under the
009: * terms of the Cougaar Open Source License as published on the
010: * Cougaar Open Source Website (www.cougaar.org).
011: *
012: * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
013: * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
014: * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
015: * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
016: * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
017: * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
018: * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
019: * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
020: * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
021: * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
022: * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
023: *
024: * </copyright>
025: */
026:
027: package org.cougaar.planning.ldm.plan;
028:
029: import java.util.Date;
030: import java.util.Enumeration;
031:
032: import org.cougaar.core.util.UID;
033: import org.cougaar.planning.ldm.asset.Asset;
034:
035: /** NewTask Interface
036: * Provide setters for building Task objects.
037: * Task is the essential "execute" directive,
038: * instructing a subordinate or service provider
039: * to plan and eventually accomplish a task.
040: * A the general form of a task is:
041: * Verb <em>DirectObject</em> {<em>PrepositionalPhrase<em>}* per <em>Schedule</em> per <em>Constraints</em>
042: * <p>
043: * Note that these accessors are only well defined with respect to threading and
044: * Blackboard transactions prior to the close of the transaction in which the
045: * Task is added.
046: **/
047: public interface NewTask extends Task, NewPlanningDirective {
048:
049: void setParentTask(Task pt);
050:
051: /**
052: * Sets the base or parent task of
053: * a given task, where the given task is
054: * an expansion of the base task. The
055: * parent task could be "move vehicles
056: * from point a to point b ...". An
057: * expanded task could be "fuel vehicles ...".
058: * @param ptuid - Task that is the "parenttask"
059: **/
060: void setParentTaskUID(UID ptuid);
061:
062: /** Set the Workflow that the task is a member of.
063: * All Tasks are members of
064: * a Workflow. The tasks that are expansions
065: * of a basetask are placed in one workflow.
066: * For example, the fueltask will be a member
067: * of a workflow that contains all of the tasks
068: * and constraints needed to complete the basetask.
069: * @param aWorkflow - The Workflow of the Task.
070: **/
071: void setWorkflow(Workflow aWorkflow);
072:
073: /**
074: * Sets the prepositional phrases of the Task.
075: * A PrepositionalPhrase object contains a String
076: * representation of the preposition (from, to, with, etc.)
077: * and an object representing the indirect object. The indirect
078: * object can be an Asset (or AssetGroup), a Location (or two) or
079: * a Capabiltiy.
080: * For example, in the task
081: * "UnitA requisitions commodityB from UnitC"...
082: * the PrepositionalPhrase is "from UnitC".
083: * @param enumOfPrepPhrase - The Prep Phrases of the Task.
084: **/
085: void setPrepositionalPhrases(Enumeration enumOfPrepPhrase);
086:
087: /**
088: * Makes the parameter the single prepositional phrase
089: * of the task. Any previously-set prepositional phrases
090: * are dropped. <p>
091: * A PrepositionalPhrase object contains a String
092: * representation of the preposition (from, to, with, etc.)
093: * and an object representing the indirect object. The indirect
094: * object can be an Asset (or AssetGroup), a Location (or two) or
095: * a Capabiltiy.
096: * For example, in the task
097: * "UnitA requisitions commodityB from UnitC"...
098: * the PrepositionalPhrase is "from UnitC".
099: * @param aPrepPhrase - The Prep Phrase of the Task.
100: **/
101: void setPrepositionalPhrases(PrepositionalPhrase aPrepPhrase);
102:
103: /**
104: * Makes the parameter the single prepositional phrase
105: * of the task. Any previously-set prepositional phrases
106: * are dropped. <p>
107: * A PrepositionalPhrase object contains a String
108: * representation of the preposition (from, to, with, etc.)
109: * and an object representing the indirect object. The indirect
110: * object can be an Asset (or AssetGroup), a Location (or two) or
111: * a Capabiltiy.
112: * For example, in the task
113: * "UnitA requisitions commodityB from UnitC"...
114: * the PrepositionalPhrase is "from UnitC".
115: * @param aPrepPhrase - The Prep Phrase of the Task.
116: * @deprecated Use setPrepositionalPhrases(PrepositionalPhrase) or addPrepositionalPhrase(PrepositionalPhrase) instead.
117: **/
118: void setPrepositionalPhrase(PrepositionalPhrase aPrepPhrase);
119:
120: /**
121: * Adds a PrepositionalPhrase to the existing set of
122: * PrepositionalPhrases of the task - an existing PrepositionalPhrases
123: * with the same Preposition will be replaced.
124: * @param aPrepPhrase - The Prep Phrase of the Task.
125: **/
126: void addPrepositionalPhrase(PrepositionalPhrase aPrepPhrase);
127:
128: /**
129: * The setVerb method sets the verb of the Task.
130: * For example, in the Task "fuel vehicles...", the
131: * Verb is the object represented by "fuel".
132: * @param aVerb - The verb of the Task.
133: **/
134: void setVerb(Verb aVerb);
135:
136: /**
137: * Sets the Asset (or AssetGroup) that is being acted upon
138: * by the Task. For example, in the task "fuel
139: * vehicle 14 ..." the direct object is "vehicle 14".
140: * @param dobj - The DirectObject of the Task.
141: **/
142: void setDirectObject(Asset dobj);
143:
144: /**
145: * The Plan slot is unused and will be removed.
146: **/
147: void setPlan(Plan aPlan);
148:
149: /** set the preferences on this task.
150: * Implicit collection of generic Task.PreferenceChangeReport instances.
151: * Implicit collection of detailed ChangeReports without old value.
152: * @param thepreferences
153: */
154: void setPreferences(Enumeration thepreferences);
155:
156: /** Set just one preference in the task's preference list.
157: * Implicit collection of detailed Task.PreferenceChangeReport instances.
158: **/
159: void setPreference(Preference thePreference);
160:
161: /** alias for setPreference. Multiple preferences of the same type are
162: * not allowed so setPreference and addPreference are equivalent.
163: **/
164: void addPreference(Preference aPreference);
165:
166: /** Set the priority of this task.
167: * Note that this should only be used when there are competing tasks
168: * from the SAME customer.
169: * @param thepriority
170: * @see org.cougaar.planning.ldm.plan.Priority
171: */
172: void setPriority(byte thepriority);
173:
174: /** Set the Commitment date of this task.
175: * After this date, the task is not allowed to be rescinded
176: * or re-planned (change in preferences).
177: * @param commitDate
178: */
179: void setCommitmentDate(Date commitDate);
180:
181: /**
182: * Set the deleted status of this task
183: **/
184: void setDeleted(boolean newDeleted);
185:
186: /**
187: * Add to the collection of observable aspect types
188: **/
189: void addObservableAspect(int aspectType);
190:
191: /** Set the collection of AuxiliaryQueryTypes that the task is
192: * requesting information on. This information will be returned in
193: * the AllocationResult of this task's disposition.
194: * Note that this method clears all previous types.
195: * @param thetypes A collection of defined AuxiliaryQueryTypes
196: * @see org.cougaar.planning.ldm.plan.AuxiliaryQueryType
197: */
198: void setAuxiliaryQueryTypes(int[] thetypes);
199:
200: /**
201: * Set the problem Context of this task.
202: * @see org.cougaar.planning.ldm.plan.Context
203: **/
204: void setContext(Context context);
205: }
|