|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectwt.projmgmt.monitor.SchedulerHelper
Supported API: false
Extendable: false
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 |
private static final String RESOURCE
private static final String CLASSNAME
static final long serialVersionUID
public static final long EXTERNALIZATION_VERSION_UID
protected static final long OLD_FORMAT_VERSION_UID
public static final StandardProjMonitorService service
private static final boolean VERBOSE
private static final boolean VERBOSE_SCHEDULE
private static final boolean USE_QUEUE
Constructor Detail |
public SchedulerHelper()
Method Detail |
public void writeExternal(ObjectOutput output) throws IOException
writeExternal
in interface Externalizable
output
-
IOException
public void readExternal(ObjectInput input) throws IOException, ClassNotFoundException
readExternal
in interface Externalizable
input
-
IOException
ClassNotFoundException
protected boolean readVersion(SchedulerHelper thisObject, ObjectInput input, long readSerialVersionUID, boolean passThrough, boolean superDone) throws IOException, ClassNotFoundException
thisObject
- input
- readSerialVersionUID
- passThrough
- superDone
-
IOException
ClassNotFoundException
private boolean readOldVersion(ObjectInput input, long readSerialVersionUID, boolean passThrough, boolean superDone) throws IOException, ClassNotFoundException
input
- readSerialVersionUID
- passThrough
- superDone
-
IOException
ClassNotFoundException
public static ExecutionObject changeActualFinish(ExecutionObject exec_obj, Timestamp actual_finish) throws WTException
exec_obj
- actual_finish
-
WTException
public static ExecutionObject changeActualStart(ExecutionObject exec_obj, Timestamp actual_start) throws WTException
exec_obj
- actual_start
-
WTException
public static ExecutionObject changeStart(ExecutionObject exec_obj, ExecutionObject source, Timestamp time, int direction) throws WTException
exec_obj
- source
- time
- direction
-
WTException
ProjectState
,
ExecutionObject
,
ProjectNode
public static ExecutionObject changeTimeToStart(ExecutionObject exec_obj, Timestamp new_start) throws WTException
ExecutionObject
to the time passed as argument. If the time passed as argument is
'null' the time is set to the earliest possible date.
exec_obj
- new_start
-
WTException
public static ExecutionObject changeTimeToStart(ExecutionObject exec_obj, ExecutionObject source, Timestamp time, int direction) throws WTException
exec_obj
- source
- time
- direction
-
WTException
ProjectState
,
ExecutionObject
,
ProjectNode
public static Timestamp computeFinish(ExecutionObject exec_obj, ExecutionObject skip_obj) throws WTException
exec_obj
- skip_obj
-
WTException
public static Timestamp getEarliestTimeToStart(ExecutionObject exec_obj) throws WTException
This method only takes into account FINISH-START dependencies.
Supported API: false
exec_obj
-
WTException
ProjectState
,
ExecutionObject
,
ProjectNode
public static boolean isEarliestNode(ProjectNode node) throws WTException
node
-
WTException
public static boolean isPropagateFinish(ExecutionObject exec_obj, ExecutionObject from_obj, Timestamp old_date, boolean is_removal) throws WTException
This method serves as a quick test in order to skip computing
the new finish date from component objects.
Supported API: false
exec_obj
- from_obj
- old_date
- is_removal
-
WTException
public static ExecutionObject processPerformedWork(ExecutionObject exec_obj, MonitorInfo oldInfo, MonitorInfo newInfo, boolean is_propagate) throws WTException
exec_obj
- oldInfo
- newInfo
- is_propagate
-
WTException
public static void propagateFinishDate(ExecutionObject exec_obj, Timestamp old_finish) throws WTException
exec_obj
- old_finish
-
WTException
public static void propagateTimeToFinish(ProjectNode node) throws WTException
This method only takes into account FINISH-START dependencies.
Supported API: false
node
-
WTException
ProjectNode
public static void propagateTimeToStart(ExecutionObject exec_obj, ExecutionObject source, Timestamp old_start, int direction) throws WTException
This method only takes into account FINISH-START dependencies.
Supported API: false
exec_obj
- source
- old_start
- direction
-
WTException
ExecutionObject
,
ProjectNode
,
WfContainer
public static ProjectNode setEarliestTimeToStart(ProjectNode node) throws WTException
node
-
WTException
public static ExecutionObject setNewFinish(ExecutionObject exec_obj, Timestamp new_finish, Timestamp old_start, boolean override) throws WTException
exec_obj
- new_finish
- old_start
- override
-
WTException
public static Timestamp getEarliestStart(ExecutionObject exec_obj) throws WTException
WTException
public static String getDirection(int direction)
direction
-
private static void propagateActualStart(ExecutionObject exec_obj) throws WTException
WTException
private static void propagateActualFinish(ExecutionObject exec_obj) throws WTException
WTException
private static Timestamp getLatestFinishTime(ExecutionObject exec_obj) throws WTException
WTException
private static Timestamp getEarliestStartedTime(ExecutionObject holder, ExecutionObject contained) throws WTException
WTException
private static long getEarliestStartNode(WfContainer container) throws WTException
WTException
private static QuerySpec getQuerySpec(Class target_class, String attr_name, ObjectIdentifier container_id) throws WTException
WTException
private static QueryResult getComponentTimes(ExecutionObject exec_obj) throws WTException
WTException
private static QueryResult getDeliverableTimes(DeliverableHolder holder) throws WTException
WTException
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
WTException
private static QueryResult getContainedNodeTimes(WfContainer container) throws WTException
WTException
public static QuerySpec getTimesQs(Class target_class, ObjectIdentifier container_id) throws WTException
WTException
private static QueryResult getWorkItemTimes(ProjectActivity activity) throws WTException
WTException
private static QueryResult getProjectPlanDeliverableTimes(ProjectPlan plan) throws WTException
WTException
public static void propagateStart(ObjectIdentifier exec_obj_id, ObjectIdentifier source_id, Timestamp old_start, Integer direction) throws WTException
WTException
private static void propagateStart(ExecutionObject exec_obj, ExecutionObject source, Timestamp old_start, Integer direction) throws WTException
ProjMonitorServerHelper
class.
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.
WTException
public static void propagateFinish(ObjectIdentifier obj_id, Timestamp old_finish) throws WTException
WTException
private static void rescheduleStart(ExecutionObject exec_obj, Timestamp new_start) throws WTException
Note: This must be performed in the context of a transaction.
WTException
private static void propagateStartToDeliverables(ExecutionObject exec_obj, Timestamp old_start) throws WTException
exec_obj
must be a ProjectActivity
or a ProjectPlan
.
WTException
private static void propagateStartToDeliverable(Deliverable deliverable, Timestamp start, Timestamp old_start) throws WTException
WTException
private static boolean predecessorsComplete(ProjectNode node) throws WTException
WTException
private static void propagateFinishToDeliverables(ExecutionObject exec_obj) throws WTException
exec_obj
must be a ProjectActivity
or a ProjectPlan
.
WTException
private static void propagateFinishToDeliverable(Deliverable deliverable, Timestamp finish) throws WTException
WTException
private static void propagateFinishToHolders(ExecutionObject exec_obj, Timestamp old_finish) throws WTException
WTException
private static boolean propagateToHolder(ProjectNode current_node, List successor_nodes) throws WTException
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.
WTException
private static List filterConnectors(List nodes) throws WTException
WTException
private static HashSet getAncestors(ProjectNode node) throws WTException
WTException
private static void propagateFinish(ExecutionObject exec_obj, Timestamp old_finish) throws WTException
WTException
private static Timestamp rollUpStartTime(ExecutionObject exec_obj) throws WTException
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
WTException
public static Timestamp rollUpEndTime(ExecutionObject execObj) throws WTException
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.
WTException
private static Timestamp getFinish(ExecutionObject exec_obj)
private static void checkEnabledNotClosed(ExecutionObject exec_obj) throws WTException
WTException
private static ProjectHealthStatus computeStatus(ExecutionObject exec_obj) throws WTException
WTException
public static WfContainer changeStart(WfContainer container, Timestamp start) throws WTException
WTException
private static ExecutionObject setContainerDuration(ExecutionObject container, boolean empty, Timestamp new_start, boolean start_computed) throws WTException
WTException
private static Timestamp getLatestStart(Timestamp new_start, List pred_list, ObjectIdentifier container_id, HashMap all_nodes) throws WTException
WTException
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
WTException
private static HashMap getExtSuccMap(HashMap all_nodes) throws WTException
WTException
private static ObjectIdentifier getNodeToVisit(HashSet nodes, HashMap pred_map, HashMap containment_map) throws WTException
WTException
private static void setContainerTimes(ProjectNode node, ObjectIdentifier container_id, HashMap all_nodes) throws WTException
WTException
private static List getPredList(ProjectNode node, List containerList) throws WTException
WTException
private static void processDeliverables(ExecutionObject exec_obj, Timestamp old_start) throws WTException
WTException
private static QueryResult getDeliverables(ExecutionObject exec_obj) throws WTException
WTException
private static ExecutionObject setTimes(ExecutionObject exec_obj, Timestamp start, boolean change_computed) throws WTException
WTException
private static void propagateToExternalSuccessors(HashMap succ_map, HashMap all_nodes) throws WTException
WTException
private static ObjectIdentifier getOid(Object obj)
private static MonitorInfo getMonitorInfo(Timestamp finish) throws WTException
WTException
private static ObjectReference getRef(Object obj) throws WTException
WTException
private static long getId(Object obj)
private static boolean isStartComputed(Object object)
private static Timestamp getTimeToStart(Object object)
private static Timestamp getStartTime(ExecutionObject exec_obj)
private static boolean hasStarted(ExecutionObject exec_obj)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |