wt.projmgmt.monitor
Class SchedulerHelper

java.lang.Object
  extended bywt.projmgmt.monitor.SchedulerHelper
All Implemented Interfaces:
Externalizable, Serializable

public class SchedulerHelper
extends Object
implements Externalizable



Supported API: false

Extendable: false

See Also:
Serialized Form

Field Summary
private static String CLASSNAME
           
static long EXTERNALIZATION_VERSION_UID
           
protected static long OLD_FORMAT_VERSION_UID
           
private static String RESOURCE
           
(package private) static long serialVersionUID
           
static StandardProjMonitorService service
           
private static boolean USE_QUEUE
           
private static boolean VERBOSE
           
private static boolean VERBOSE_SCHEDULE
           
 
Constructor Summary
SchedulerHelper()
           
 
Method Summary
private static void appendJoin(QuerySpec qs, Class link_class, Class role_a_class, Class role_b_class, int lnk_indx, int a_indx, int b_indx)
           
static ExecutionObject changeActualFinish(ExecutionObject exec_obj, Timestamp actual_finish)
          Implements ProjMonitorService.changeActualFinish.
static ExecutionObject changeActualStart(ExecutionObject exec_obj, Timestamp actual_start)
          Implements ProjMonitorService.changeActualStart.
static ExecutionObject changeStart(ExecutionObject exec_obj, ExecutionObject source, Timestamp time, int direction)
          Changes the time to start of an execution object to the date passed as argument.
static WfContainer changeStart(WfContainer container, Timestamp start)
          Changes the time to start of the container passed as argument.
static ExecutionObject changeTimeToStart(ExecutionObject exec_obj, ExecutionObject source, Timestamp time, int direction)
          Changes the time to start of an execution object to the date passed as argument.
static ExecutionObject changeTimeToStart(ExecutionObject exec_obj, Timestamp new_start)
          Changes the time to start of an ExecutionObject to the time passed as argument.
private static void checkEnabledNotClosed(ExecutionObject exec_obj)
          Throws an exception if object is not enaled or it's state is closed (COMPLETED or CANCELLED).
static Timestamp computeFinish(ExecutionObject exec_obj, ExecutionObject skip_obj)
          Compute finish date of execution object based on its components.
private static ProjectHealthStatus computeStatus(ExecutionObject exec_obj)
          Throws an exception if object is not enaled or it's state is closed (COMPLETED or CANCELLED).
private static void constructMaps(WfContainer container, HashMap pred_map, HashSet not_visited, HashMap all_nodes, HashMap containment_map, HashMap container_map, HashMap initial_starts)
          Returns the various maps to be used in the scheduling algorithm.
private static List filterConnectors(List nodes)
          Removes WfConnector objects from list.
private static HashSet getAncestors(ProjectNode node)
          Retrieves all ancestors of the node according to the containment hierarchy.
private static QueryResult getComponentTimes(ExecutionObject exec_obj)
          Returns times of components of execution object.
private static QueryResult getContainedNodeTimes(WfContainer container)
          Returns times of nodes contained in the object passed as argument.
private static QueryResult getDeliverables(ExecutionObject exec_obj)
          Returns deliverables associated to execution object.
private static QueryResult getDeliverableTimes(DeliverableHolder holder)
          Returns times of deliverables associated with an object passed as argument through the DeliverableLink association.
static String getDirection(int direction)
          Returns String representation of the direction code: 0: "DOWN" 1: "UP" 2: "BOTH" "UNKNOWN DIRECTION"

Supported API: false
static Timestamp getEarliestStart(ExecutionObject exec_obj)
           
private static Timestamp getEarliestStartedTime(ExecutionObject holder, ExecutionObject contained)
           
private static long getEarliestStartNode(WfContainer container)
           
static Timestamp getEarliestTimeToStart(ExecutionObject exec_obj)
          Returns the earliest time that an execution object can start without violating a timing constraint.
private static HashMap getExtSuccMap(HashMap all_nodes)
          Returns a map containing for each object the list of successors not in the set passed as argument.
private static Timestamp getFinish(ExecutionObject exec_obj)
          Returns actual finish if not null; otherwise retruns estimated finish.
private static long getId(Object obj)
           
private static Timestamp getLatestFinishTime(ExecutionObject exec_obj)
          Return null if any component's EndTime is null, otherwise return the latest component's EndTime.
private static Timestamp getLatestStart(Timestamp new_start, List pred_list, ObjectIdentifier container_id, HashMap all_nodes)
          Returns the latest time amongst the finish dates/actual end dates of the nodes in the list.
private static MonitorInfo getMonitorInfo(Timestamp finish)
           
private static ObjectIdentifier getNodeToVisit(HashSet nodes, HashMap pred_map, HashMap containment_map)
          Returns node so that all dependenct nodes have already been assigned a finish.
private static ObjectIdentifier getOid(Object obj)
           
private static List getPredList(ProjectNode node, List containerList)
          Returns list of nodes to which this one depends.
private static QueryResult getProjectPlanDeliverableTimes(ProjectPlan plan)
          Returns times of deliverables directly associated with the plan passed as argument.
private static QuerySpec getQuerySpec(Class target_class, String attr_name, ObjectIdentifier container_id)
           
private static ObjectReference getRef(Object obj)
           
private static Timestamp getStartTime(ExecutionObject exec_obj)
          Returns time to start.
static QuerySpec getTimesQs(Class target_class, ObjectIdentifier container_id)
           
private static Timestamp getTimeToStart(Object object)
          Returns time to start.
private static QueryResult getWorkItemTimes(ProjectActivity activity)
          Returns times of work items associated with the activity passed as argument.
private static boolean hasStarted(ExecutionObject exec_obj)
          Returns time to start.
static boolean isEarliestNode(ProjectNode node)
          Returns if a given node is the earliest node on its container.
static boolean isPropagateFinish(ExecutionObject exec_obj, ExecutionObject from_obj, Timestamp old_date, boolean is_removal)
          Determines whether an object change or removal may cause propagation.
private static boolean isStartComputed(Object object)
          Returns start computed flag.
private static boolean predecessorsComplete(ProjectNode node)
          Determines if all predecessors of the given node have "completed." Use in manual mode only.
private static void processDeliverables(ExecutionObject exec_obj, Timestamp old_start)
          Rolls up duration/finish date from contained deliverables.
static ExecutionObject processPerformedWork(ExecutionObject exec_obj, MonitorInfo oldInfo, MonitorInfo newInfo, boolean is_propagate)
          Process scheduling of changes triggered by changes in performed work in manual mode.
private static void propagateActualFinish(ExecutionObject exec_obj)
          Propagates changes of actual finish to holder objects.
private static void propagateActualStart(ExecutionObject exec_obj)
          Propagates the "unstarting" of a project node to container objects.
private static void propagateFinish(ExecutionObject exec_obj, Timestamp old_finish)
          Performs the propagation of a finish date to other nodes.
static void propagateFinish(ObjectIdentifier obj_id, Timestamp old_finish)
          Performs the propagation of a finish date to its successor nodes.
static void propagateFinishDate(ExecutionObject exec_obj, Timestamp old_finish)
          Propagates to containing objects a change in an execution object.
private static void propagateFinishToDeliverable(Deliverable deliverable, Timestamp finish)
          Performs the propagation of the finish time to deliverables in manual mode.
private static void propagateFinishToDeliverables(ExecutionObject exec_obj)
          Performs the propagation of the finish date to deliverables in manual mode.
private static void propagateFinishToHolders(ExecutionObject exec_obj, Timestamp old_finish)
          Performs the propagation of a finish date to holders.
private static void propagateStart(ExecutionObject exec_obj, ExecutionObject source, Timestamp old_start, Integer direction)
          Performs the propagation of a start date in the given direction.
static void propagateStart(ObjectIdentifier exec_obj_id, ObjectIdentifier source_id, Timestamp old_start, Integer direction)
           
private static void propagateStartToDeliverable(Deliverable deliverable, Timestamp start, Timestamp old_start)
          Performs the propagation of a start to deliverables in manual mode.
private static void propagateStartToDeliverables(ExecutionObject exec_obj, Timestamp old_start)
          Performs the propagation of a start to deliverables in manual mode.
static void propagateTimeToFinish(ProjectNode node)
          Propagates the time to finish of the object to dependent nodes.
static void propagateTimeToStart(ExecutionObject exec_obj, ExecutionObject source, Timestamp old_start, int direction)
          Propagates the time to start of the object to container node and contained nodes, in case it is a summary or plan.
private static void propagateToExternalSuccessors(HashMap succ_map, HashMap all_nodes)
          Sets the new finish date for an execution object passed as argument.
private static boolean propagateToHolder(ProjectNode current_node, List successor_nodes)
          Returns whether finish date should be propagated to holder.
 void readExternal(ObjectInput input)
          Reads the non-transient fields of this class from an external source.
private  boolean readOldVersion(ObjectInput input, long readSerialVersionUID, boolean passThrough, boolean superDone)
          Reads the non-transient fields of this class from an external source, which is not the current version.
protected  boolean readVersion(SchedulerHelper thisObject, ObjectInput input, long readSerialVersionUID, boolean passThrough, boolean superDone)
          Reads the non-transient fields of this class from an external source.
private static void rescheduleStart(ExecutionObject exec_obj, Timestamp new_start)
          Reschedules the start of the object to the time passed as argument.
static Timestamp rollUpEndTime(ExecutionObject execObj)
          Get the (actual) end time of a ExecutionObject based on its contained objects.
private static Timestamp rollUpStartTime(ExecutionObject exec_obj)
          Get the (actual) start time of a ExecutionObject based on its components.
private static ExecutionObject setContainerDuration(ExecutionObject container, boolean empty, Timestamp new_start, boolean start_computed)
          Sets time to start and duration.
private static void setContainerTimes(ProjectNode node, ObjectIdentifier container_id, HashMap all_nodes)
          Sets finish of the container.
static ProjectNode setEarliestTimeToStart(ProjectNode node)
          Sets the earliest time to start and propagates in both directions.
static ExecutionObject setNewFinish(ExecutionObject exec_obj, Timestamp new_finish, Timestamp old_start, boolean override)
          Sets the new finish date for an execution object passed as argument.
private static ExecutionObject setTimes(ExecutionObject exec_obj, Timestamp start, boolean change_computed)
          Sets the new finish date for an execution object passed as argument.
 void writeExternal(ObjectOutput output)
          Writes the non-transient fields of this class to an external source.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

RESOURCE

private static final String RESOURCE
See Also:
Constant Field Values

CLASSNAME

private static final String CLASSNAME

serialVersionUID

static final long serialVersionUID
See Also:
Constant Field Values

EXTERNALIZATION_VERSION_UID

public static final long EXTERNALIZATION_VERSION_UID
See Also:
Constant Field Values

OLD_FORMAT_VERSION_UID

protected static final long OLD_FORMAT_VERSION_UID
See Also:
Constant Field Values

service

public static final StandardProjMonitorService service

VERBOSE

private static final boolean VERBOSE

VERBOSE_SCHEDULE

private static final boolean VERBOSE_SCHEDULE

USE_QUEUE

private static final boolean USE_QUEUE
Constructor Detail

SchedulerHelper

public SchedulerHelper()
Method Detail

writeExternal

public void writeExternal(ObjectOutput output)
                   throws IOException
Writes the non-transient fields of this class to an external source.

Supported API: false

Specified by:
writeExternal in interface Externalizable
Parameters:
output -
Throws:
IOException

readExternal

public void readExternal(ObjectInput input)
                  throws IOException,
                         ClassNotFoundException
Reads the non-transient fields of this class from an external source.

Supported API: false

Specified by:
readExternal in interface Externalizable
Parameters:
input -
Throws:
IOException
ClassNotFoundException

readVersion

protected boolean readVersion(SchedulerHelper thisObject,
                              ObjectInput input,
                              long readSerialVersionUID,
                              boolean passThrough,
                              boolean superDone)
                       throws IOException,
                              ClassNotFoundException
Reads the non-transient fields of this class from an external source.

Supported API: false

Parameters:
thisObject -
input -
readSerialVersionUID -
passThrough -
superDone -
Returns:
boolean
Throws:
IOException
ClassNotFoundException

readOldVersion

private boolean readOldVersion(ObjectInput input,
                               long readSerialVersionUID,
                               boolean passThrough,
                               boolean superDone)
                        throws IOException,
                               ClassNotFoundException
Reads the non-transient fields of this class from an external source, which is not the current version.

Parameters:
input -
readSerialVersionUID -
passThrough -
superDone -
Returns:
boolean
Throws:
IOException
ClassNotFoundException

changeActualFinish

public static ExecutionObject changeActualFinish(ExecutionObject exec_obj,
                                                 Timestamp actual_finish)
                                          throws WTException
Implements ProjMonitorService.changeActualFinish.

Supported API: false

Parameters:
exec_obj -
actual_finish -
Returns:
ExecutionObject
Throws:
WTException

changeActualStart

public static ExecutionObject changeActualStart(ExecutionObject exec_obj,
                                                Timestamp actual_start)
                                         throws WTException
Implements ProjMonitorService.changeActualStart.

Supported API: false

Parameters:
exec_obj -
actual_start -
Returns:
ExecutionObject
Throws:
WTException

changeStart

public static ExecutionObject changeStart(ExecutionObject exec_obj,
                                          ExecutionObject source,
                                          Timestamp time,
                                          int direction)
                                   throws WTException
Changes the time to start of an execution object to the date passed as argument. This method doesn't apply to deliverables and project wotk items. The state of the object must be DEFINED (that is not started yet) otherwise an exception is thrown. In all other cases the time to start is set to the date passed as argument or to the earliest date that doesn't violate a constraint. The time to start flag is set to "computed." The new start time is propagated to the container of the object if there are no predecessors that belong to the same container. Also new estimated finish is computed and propagated to successor nodes and to the container if there are no successor nodes that belong to the same container.

Supported API: false

Parameters:
exec_obj -
source -
time -
direction -
Returns:
ExecutionObject
Throws:
WTException
See Also:
ProjectState, ExecutionObject, ProjectNode

changeTimeToStart

public static ExecutionObject changeTimeToStart(ExecutionObject exec_obj,
                                                Timestamp new_start)
                                         throws WTException
Changes the time to start of an ExecutionObject to the time passed as argument. If the time passed as argument is 'null' the time is set to the earliest possible date.

Supported API: false

Parameters:
exec_obj -
new_start -
Returns:
ExecutionObject
Throws:
WTException

changeTimeToStart

public static ExecutionObject changeTimeToStart(ExecutionObject exec_obj,
                                                ExecutionObject source,
                                                Timestamp time,
                                                int direction)
                                         throws WTException
Changes the time to start of an execution object to the date passed as argument. This method doesn't apply to deliverables and project wotk items. The object mustn't have started yet otherwise an exception is thrown. Nothing happens in the following cases: In all other cases the time to start is set to the date passed as argument or to the earliest date that doesn't violate a constraint. The time to start flag is set to "computed." The new start time is propagated to the container of the object if there are no predecessors that belong to the same container. Also new estimated finish is computed and propagated to successor nodes and to the container if there are no successor nodes that belong to the same container.

Supported API: false

Parameters:
exec_obj -
source -
time -
direction -
Returns:
ExecutionObject
Throws:
WTException
See Also:
ProjectState, ExecutionObject, ProjectNode

computeFinish

public static Timestamp computeFinish(ExecutionObject exec_obj,
                                      ExecutionObject skip_obj)
                               throws WTException
Compute finish date of execution object based on its components. In the computation don't use the values from object referred to by the 'skip_object' parameter.
Assumes exec_obj is a Milestone, ProjectActivity, SummaryActivity or a ProjectPlan. (Excluded are ProjectWorkItem, ProjectProxy, and Deliverable objects).

Supported API: false

Parameters:
exec_obj -
skip_obj -
Returns:
Timestamp
Throws:
WTException

getEarliestTimeToStart

public static Timestamp getEarliestTimeToStart(ExecutionObject exec_obj)
                                        throws WTException
Returns the earliest time that an execution object can start without violating a timing constraint. Timing constraints come from its predecessors or, if the object has no predecessor, from its container. This method doesn't apply to deliverables and project wotk items. Also returns null if the object has already started, that is.

Note:

This method only takes into account FINISH-START dependencies.

Supported API: false

Parameters:
exec_obj -
Returns:
Timestamp
Throws:
WTException
See Also:
ProjectState, ExecutionObject, ProjectNode

isEarliestNode

public static boolean isEarliestNode(ProjectNode node)
                              throws WTException
Returns if a given node is the earliest node on its container.

Supported API: false

Parameters:
node -
Returns:
boolean
Throws:
WTException

isPropagateFinish

public static boolean isPropagateFinish(ExecutionObject exec_obj,
                                        ExecutionObject from_obj,
                                        Timestamp old_date,
                                        boolean is_removal)
                                 throws WTException
Determines whether an object change or removal may cause propagation. Returns 'true' if this is the case; 'false' otherwise. The arguments are as follows.

This method serves as a quick test in order to skip computing the new finish date from component objects.

Supported API: false

Parameters:
exec_obj -
from_obj -
old_date -
is_removal -
Returns:
boolean
Throws:
WTException

processPerformedWork

public static ExecutionObject processPerformedWork(ExecutionObject exec_obj,
                                                   MonitorInfo oldInfo,
                                                   MonitorInfo newInfo,
                                                   boolean is_propagate)
                                            throws WTException
Process scheduling of changes triggered by changes in performed work in manual mode. For example, when performed work is changed for the first time then this is interpreted as the object starting. When performedwork equals actualwork then as its completion.

Supported API: false

Parameters:
exec_obj -
oldInfo -
newInfo -
is_propagate -
Returns:
ExecutionObject
Throws:
WTException

propagateFinishDate

public static void propagateFinishDate(ExecutionObject exec_obj,
                                       Timestamp old_finish)
                                throws WTException
Propagates to containing objects a change in an execution object.

Supported API: false

Parameters:
exec_obj -
old_finish -
Throws:
WTException

propagateTimeToFinish

public static void propagateTimeToFinish(ProjectNode node)
                                  throws WTException
Propagates the time to finish of the object to dependent nodes.

Note:

This method only takes into account FINISH-START dependencies.

Supported API: false

Parameters:
node -
Throws:
WTException
See Also:
ProjectNode

propagateTimeToStart

public static void propagateTimeToStart(ExecutionObject exec_obj,
                                        ExecutionObject source,
                                        Timestamp old_start,
                                        int direction)
                                 throws WTException
Propagates the time to start of the object to container node and contained nodes, in case it is a summary or plan. This method doesn't apply to deliverables and project wotk items.

Note:

This method only takes into account FINISH-START dependencies.

Supported API: false

Parameters:
exec_obj -
source -
old_start -
direction -
Throws:
WTException
See Also:
ExecutionObject, ProjectNode, WfContainer

setEarliestTimeToStart

public static ProjectNode setEarliestTimeToStart(ProjectNode node)
                                          throws WTException
Sets the earliest time to start and propagates in both directions.

Supported API: false

Parameters:
node -
Returns:
ProjectNode
Throws:
WTException

setNewFinish

public static ExecutionObject setNewFinish(ExecutionObject exec_obj,
                                           Timestamp new_finish,
                                           Timestamp old_start,
                                           boolean override)
                                    throws WTException
Sets the new finish date for an execution object passed as argument. This operation happens when the start time is changed. Changes both the finish date of the object as its duration (when it is appropriate).

Supported API: false

Parameters:
exec_obj -
new_finish -
old_start -
override -
Returns:
ExecutionObject
Throws:
WTException

getEarliestStart

public static Timestamp getEarliestStart(ExecutionObject exec_obj)
                                  throws WTException
Throws:
WTException

getDirection

public static String getDirection(int direction)
Returns String representation of the direction code:

Supported API: false

Parameters:
direction -
Returns:
String

propagateActualStart

private static void propagateActualStart(ExecutionObject exec_obj)
                                  throws WTException
Propagates the "unstarting" of a project node to container objects. This method is called from 'changeActualStart'. The propagation happens in the following way if start is null:
  1. Get holder.
  2. Get the time of the earliest contained node that has started and is different from the node passed as argument.
  3. If no contained node has started, unstart container and return.
  4. If start time of holder is different from earliest, then change start of container to earliest and return.
If start is not null, the following happens:
  1. If holder hasn't started, start container and return.
  2. Get the time of the earliest contained node that has started and is different from the node passed as argument.
  3. If no contained node has started, start container and return.
  4. If start time of earliest contained node is after new start, then start holder and return.
  5. If start time of earliest contained node is not after new start, then do nothing.

Throws:
WTException

propagateActualFinish

private static void propagateActualFinish(ExecutionObject exec_obj)
                                   throws WTException
Propagates changes of actual finish to holder objects. This method is called from 'changeActualFinish'. The propagation happens in the following way:
  1. Compute "latest time to finish" for the holder.
  2. If it is null, it means that there are unfinished contained nodes: just return.
  3. Compare with current finish time; if the same then there is nothing to do: just return.
  4. Call changeActualFinish for the container with the computed time.

Throws:
WTException

getLatestFinishTime

private static Timestamp getLatestFinishTime(ExecutionObject exec_obj)
                                      throws WTException
Return null if any component's EndTime is null, otherwise return the latest component's EndTime.

Throws:
WTException

getEarliestStartedTime

private static Timestamp getEarliestStartedTime(ExecutionObject holder,
                                                ExecutionObject contained)
                                         throws WTException
Throws:
WTException

getEarliestStartNode

private static long getEarliestStartNode(WfContainer container)
                                  throws WTException
Throws:
WTException

getQuerySpec

private static QuerySpec getQuerySpec(Class target_class,
                                      String attr_name,
                                      ObjectIdentifier container_id)
                               throws WTException
Throws:
WTException

getComponentTimes

private static QueryResult getComponentTimes(ExecutionObject exec_obj)
                                      throws WTException
Returns times of components of execution object. The list of components depend on the class of the execution object in the following way. Each item returned contains the end time, the estimated finish date and the id of the object.

Throws:
WTException

getDeliverableTimes

private static QueryResult getDeliverableTimes(DeliverableHolder holder)
                                        throws WTException
Returns times of deliverables associated with an object passed as argument through the DeliverableLink association.

Throws:
WTException

appendJoin

private static void appendJoin(QuerySpec qs,
                               Class link_class,
                               Class role_a_class,
                               Class role_b_class,
                               int lnk_indx,
                               int a_indx,
                               int b_indx)
                        throws WTException
Throws:
WTException

getContainedNodeTimes

private static QueryResult getContainedNodeTimes(WfContainer container)
                                          throws WTException
Returns times of nodes contained in the object passed as argument.

Throws:
WTException

getTimesQs

public static QuerySpec getTimesQs(Class target_class,
                                   ObjectIdentifier container_id)
                            throws WTException
Throws:
WTException

getWorkItemTimes

private static QueryResult getWorkItemTimes(ProjectActivity activity)
                                     throws WTException
Returns times of work items associated with the activity passed as argument.

Throws:
WTException

getProjectPlanDeliverableTimes

private static QueryResult getProjectPlanDeliverableTimes(ProjectPlan plan)
                                                   throws WTException
Returns times of deliverables directly associated with the plan passed as argument.

Throws:
WTException

propagateStart

public static void propagateStart(ObjectIdentifier exec_obj_id,
                                  ObjectIdentifier source_id,
                                  Timestamp old_start,
                                  Integer direction)
                           throws WTException
Throws:
WTException

propagateStart

private static void propagateStart(ExecutionObject exec_obj,
                                   ExecutionObject source,
                                   Timestamp old_start,
                                   Integer direction)
                            throws WTException
Performs the propagation of a start date in the given direction. To avoid unnecessary computations (and prevent loops as well), the source of the change is passed as argument. The direction argument can be either UP, DOWN, or BOTH. These are defined as int constants in the ProjMonitorServerHelper class.

Note:

This propagation method only looks into FINISH-START dependencies. To extend it to START-START dependencies it should be propagated to successors for which the link type is START-START.

Throws:
WTException

propagateFinish

public static void propagateFinish(ObjectIdentifier obj_id,
                                   Timestamp old_finish)
                            throws WTException
Performs the propagation of a finish date to its successor nodes.

Throws:
WTException

rescheduleStart

private static void rescheduleStart(ExecutionObject exec_obj,
                                    Timestamp new_start)
                             throws WTException
Reschedules the start of the object to the time passed as argument. Checks if there are scheduled starts. If this is the case, deletes these entries and queues starts with the time passed as argument.

Note: This must be performed in the context of a transaction.

Throws:
WTException

propagateStartToDeliverables

private static void propagateStartToDeliverables(ExecutionObject exec_obj,
                                                 Timestamp old_start)
                                          throws WTException
Performs the propagation of a start to deliverables in manual mode.

exec_obj must be a ProjectActivity or a ProjectPlan.

Throws:
WTException

propagateStartToDeliverable

private static void propagateStartToDeliverable(Deliverable deliverable,
                                                Timestamp start,
                                                Timestamp old_start)
                                         throws WTException
Performs the propagation of a start to deliverables in manual mode.

Throws:
WTException

predecessorsComplete

private static boolean predecessorsComplete(ProjectNode node)
                                     throws WTException
Determines if all predecessors of the given node have "completed." Use in manual mode only. Complete in this case means end time not null.

Throws:
WTException

propagateFinishToDeliverables

private static void propagateFinishToDeliverables(ExecutionObject exec_obj)
                                           throws WTException
Performs the propagation of the finish date to deliverables in manual mode.

exec_obj must be a ProjectActivity or a ProjectPlan.

Throws:
WTException

propagateFinishToDeliverable

private static void propagateFinishToDeliverable(Deliverable deliverable,
                                                 Timestamp finish)
                                          throws WTException
Performs the propagation of the finish time to deliverables in manual mode.

Throws:
WTException

propagateFinishToHolders

private static void propagateFinishToHolders(ExecutionObject exec_obj,
                                             Timestamp old_finish)
                                      throws WTException
Performs the propagation of a finish date to holders.

Throws:
WTException

propagateToHolder

private static boolean propagateToHolder(ProjectNode current_node,
                                         List successor_nodes)
                                  throws WTException
Returns whether finish date should be propagated to holder.

This happens when there are no project node successors or there is no node in the successor list that share a common ancestor with the current node that is not the plan.

Throws:
WTException

filterConnectors

private static List filterConnectors(List nodes)
                              throws WTException
Removes WfConnector objects from list.

Throws:
WTException

getAncestors

private static HashSet getAncestors(ProjectNode node)
                             throws WTException
Retrieves all ancestors of the node according to the containment hierarchy. The node itself and the hostplan are not included.

Throws:
WTException

propagateFinish

private static void propagateFinish(ExecutionObject exec_obj,
                                    Timestamp old_finish)
                             throws WTException
Performs the propagation of a finish date to other nodes.

Throws:
WTException

rollUpStartTime

private static Timestamp rollUpStartTime(ExecutionObject exec_obj)
                                  throws WTException
Get the (actual) start time of a ExecutionObject based on its components.

For the project management containers, that is, ProjectPlan and SummaryActivity, the start time is computed from the contained project nodes.

NOTE: This method is used by processManualExecObj: If the exec_obj is a container then roll up the actual start time from its children rather than setting it to the current time. This supports the use case involving importing actual start dates from Microsoft Project described in SPR 1019322. The actual dates in Microsoft project do not necessarily correspond to the current time. When the sumamry percent complete is imported from Microsoft project, its parent's % complete is also changed. This causes this method to set the parent's start time. This method sets the start time to the current time (now) which may not be compatible with the start times that were imported from MS Project for the children. So, instead of setting the start time to the current time, roll it up from the children. This comment is a little out of date now

Returns:
Timestamp
Throws:
WTException

rollUpEndTime

public static Timestamp rollUpEndTime(ExecutionObject execObj)
                               throws WTException
Get the (actual) end time of a ExecutionObject based on its contained objects.

For the project management containers, that is, ProjectPlan and SummaryActivity, the end time is computed from the contained project nodes.

NOTE: This method is used by processManualExecObj For reason similar to those described in the "rollUpStartTime", roll up the container's end time rather than setting it to the current time.

Returns:
Timestamp
Throws:
WTException

getFinish

private static Timestamp getFinish(ExecutionObject exec_obj)
Returns actual finish if not null; otherwise retruns estimated finish.


checkEnabledNotClosed

private static void checkEnabledNotClosed(ExecutionObject exec_obj)
                                   throws WTException
Throws an exception if object is not enaled or it's state is closed (COMPLETED or CANCELLED).

Throws:
WTException

computeStatus

private static ProjectHealthStatus computeStatus(ExecutionObject exec_obj)
                                          throws WTException
Throws an exception if object is not enaled or it's state is closed (COMPLETED or CANCELLED).

Throws:
WTException

changeStart

public static WfContainer changeStart(WfContainer container,
                                      Timestamp start)
                               throws WTException
Changes the time to start of the container passed as argument. All contained nodes are updated according to the dependency and containment releationships. Changes in finish dates are propagated to nodes outside the container.

Throws:
WTException

setContainerDuration

private static ExecutionObject setContainerDuration(ExecutionObject container,
                                                    boolean empty,
                                                    Timestamp new_start,
                                                    boolean start_computed)
                                             throws WTException
Sets time to start and duration. Assumes finish has been set previously.

Throws:
WTException

getLatestStart

private static Timestamp getLatestStart(Timestamp new_start,
                                        List pred_list,
                                        ObjectIdentifier container_id,
                                        HashMap all_nodes)
                                 throws WTException
Returns the latest time amongst the finish dates/actual end dates of the nodes in the list.

Throws:
WTException

constructMaps

private static void constructMaps(WfContainer container,
                                  HashMap pred_map,
                                  HashSet not_visited,
                                  HashMap all_nodes,
                                  HashMap containment_map,
                                  HashMap container_map,
                                  HashMap initial_starts)
                           throws WTException
Returns the various maps to be used in the scheduling algorithm. These maps are as follows: Additionally, the set of the ids of the nodes still to be visited is produced. This set ccorresponds to the keys of the all nodes map.

Throws:
WTException

getExtSuccMap

private static HashMap getExtSuccMap(HashMap all_nodes)
                              throws WTException
Returns a map containing for each object the list of successors not in the set passed as argument. This is used to propagate the dates after the start is changed.

Throws:
WTException

getNodeToVisit

private static ObjectIdentifier getNodeToVisit(HashSet nodes,
                                               HashMap pred_map,
                                               HashMap containment_map)
                                        throws WTException
Returns node so that all dependenct nodes have already been assigned a finish. In case of summaries, make sure all contained nodes have already been visited. Also removes node from list.

Throws:
WTException

setContainerTimes

private static void setContainerTimes(ProjectNode node,
                                      ObjectIdentifier container_id,
                                      HashMap all_nodes)
                               throws WTException
Sets finish of the container.

Throws:
WTException

getPredList

private static List getPredList(ProjectNode node,
                                List containerList)
                         throws WTException
Returns list of nodes to which this one depends.

Throws:
WTException

processDeliverables

private static void processDeliverables(ExecutionObject exec_obj,
                                        Timestamp old_start)
                                 throws WTException
Rolls up duration/finish date from contained deliverables.

Throws:
WTException

getDeliverables

private static QueryResult getDeliverables(ExecutionObject exec_obj)
                                    throws WTException
Returns deliverables associated to execution object.

Throws:
WTException

setTimes

private static ExecutionObject setTimes(ExecutionObject exec_obj,
                                        Timestamp start,
                                        boolean change_computed)
                                 throws WTException
Sets the new finish date for an execution object passed as argument.

Throws:
WTException

propagateToExternalSuccessors

private static void propagateToExternalSuccessors(HashMap succ_map,
                                                  HashMap all_nodes)
                                           throws WTException
Sets the new finish date for an execution object passed as argument.

Throws:
WTException

getOid

private static ObjectIdentifier getOid(Object obj)

getMonitorInfo

private static MonitorInfo getMonitorInfo(Timestamp finish)
                                   throws WTException
Throws:
WTException

getRef

private static ObjectReference getRef(Object obj)
                               throws WTException
Throws:
WTException

getId

private static long getId(Object obj)

isStartComputed

private static boolean isStartComputed(Object object)
Returns start computed flag. Assumes argument is a WfExecutionObject.


getTimeToStart

private static Timestamp getTimeToStart(Object object)
Returns time to start. Assumes argument is a WfExecutionObject.


getStartTime

private static Timestamp getStartTime(ExecutionObject exec_obj)
Returns time to start. Assumes argument is a WfExecutionObject.


hasStarted

private static boolean hasStarted(ExecutionObject exec_obj)
Returns time to start. Assumes argument is a WfExecutionObject.