|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectwt.projmgmt.resource.ProjResourceServiceFwd
The ProjResourceService
class contains the definition of
remotely accessible wt.projmgmt.resource API. The access is made through
the ProjResourceHelper.service variable.
Supported API: false
Extendable: false
wt.projmgmt.execution.ProResourceHelper
,
Serialized FormField Summary | |
private static String |
CLASSNAME
|
private static String |
FC_RESOURCE
|
(package private) static boolean |
SERVER
|
Fields inherited from interface wt.method.RemoteAccess |
versionID |
Constructor Summary | |
ProjResourceServiceFwd()
|
Method Summary | |
ProjectActivity |
addResources(ProjectActivity act,
Vector resources,
Vector max_units)
Add the resources to the ProjectActivity . |
ProjectActivity |
changeResource(ProjectActivity projectActivity,
ProjectResource old_resource,
ProjectResource new_resource)
This method replaces one ProjectResource
with another ProjectResource in a ProjectActivity . |
ProjectResource |
changeResourceCost(ProjectResource resource,
Currency use,
CurrencyRate std,
CurrencyRate ovt)
Changes cost properties of the ProjectResource
passed as argument. |
QueryResult |
createPersonResources(ProjectPlan plan,
Vector assignees)
Creates person resources for a list of WTUser passed
as argument. |
void |
delegate(ProjectWorkItem workItem,
WTPrincipal principal)
Changes the owner of the ProjectWorkItem
to user passed as argument. |
ProjectActivity |
getActivityHolder(Deliverable deliverable)
Returns the ProjectActivity that holds
the Deliverable passed as argument. |
QueryResult |
getActivityResources(ProjectActivity activity)
Return all enabled ProjectResource associated
with a given ProjectActivity . |
QueryResult |
getAllActivityResources(ProjectActivity activity)
Return all enabled and disabled ProjectResource
objects associated with a given ProjectActivity . |
QueryResult |
getAllProjectResources(ProjectPlan plan)
Return all enabled and disabled ProjectResource
associated with a given ProjectPlan
passed as arguent. |
QueryResult |
getAllResourceAssignments(ProjectPlan plan,
ResourceHolder holder,
ProjectResource resource)
Returns resource assignments ( ResourceAssignmentLink )
for a ProjectPlan , ResourceHolder ,
and ProjectResource passed as arguments. |
QueryResult |
getAssignees(ProjectActivity activity)
Returns the assignees for the activity passed as argument. |
Currency |
getCurrentCost(ExecutionObject exec_obj,
Timestamp time)
Returns the total cost incurred in the execution of the object up to the time passed as argument. |
Currency |
getCurrentCost(ProjectResource resource,
ProjectActivity activity,
Timestamp time)
Returns the current cost spent by a ProjectResource
in a ProjectActivity up to the time
passed as argument. |
Currency |
getCurrentResourceCost(ProjectResource resource,
Timestamp time)
Returns the cost spent so far for a given ProjectResource
in the plan up to the time passed as argument. |
double |
getCurrentResourceUnits(ProjectResource resource,
Timestamp time)
Returns the number of resources (units) consumed so far for a given ProjectResource in the plan up to the
time passed as argument. |
double |
getCurrentUnits(ProjectResource resource,
ProjectActivity activity,
Timestamp time)
Returns the current units spent by a ProjectResource
in a ProjectActivity up to the time
passed as argument. |
QueryResult |
getDeliverables(ExecutionObject exec_obj)
Returns all Deliverable s associated to
n {@link wt.projmgmt.execution. |
QueryResult |
getDeliverables(WTUser user)
Returns all Deliverable objects owner
by the WTUser passed as argument. |
private static Manager |
getManager()
|
QueryResult |
getMilestoneHolders(Deliverable deliverable)
Returns a list of Milestone that hold
for the Deliverable passed as argument. |
PersonResource |
getPersonResource(ProjectPlan plan,
WTUser person)
Returns the PersonResource for a plan
given a WTUser . |
QueryResult |
getProjectResources(ProjectPlan plan)
Return all enabled ProjectResource associated
with a given ProjectPlan passed as argument. |
ProjectResource |
getResource(ProjectPlan plan,
String resource_name)
Returns a ProjectResource given the host
ProjectPlan and the resource name. |
QueryResult |
getResourceAssignments(ProjectPlan plan,
ResourceHolder holder,
ProjectResource resource)
Returns resource assignments ( ResourceAssignmentLink )
for a ProjectPlan , ResourceHolder ,
and ProjectResource passed as arguments. |
Currency |
getTotalCost(ExecutionObject exec_obj)
Returns the total cost incurred in the execution of the object passed as argument. |
Currency |
getTotalCost(ProjectResource resource,
ProjectActivity activity)
Returns the total cost to be spent by a ProjectResource
in a ProjectActivity . |
Currency |
getTotalResourceCost(ProjectResource resource)
Returns the total cost for a given ProjectResource
in the ProjectPlan that contains the
resource This method may return a non-zero value only for CostResource
objects. |
double |
getTotalResourceUnits(ProjectResource resource)
Returns the total resources (or units) to be spent for a given ProjectResource . |
double |
getTotalUnits(ProjectResource resource,
ProjectActivity activity)
Returns the total units to be spent by a ProjectResource . |
QueryResult |
getUserDeliverables(WTUser user,
ProjectPlan plan,
ProjectState state)
Returns all Deliverable that belong to
a given WTUser . |
QueryResult |
getUserDeliverables(WTUser user,
ProjectPlan plan,
ProjectState state,
Integer queryLimit,
String orderByStr)
Returns all Deliverable that belong to
a given WTUser . |
ProjectActivity |
removeResources(ProjectActivity act,
Vector resources)
Removes the resource assignments ( ResourceAssignmentLink )
that correspond to the ProjectActivity .and
ProjectResource s passed as arguments. |
void |
replaceUser(WTContainer container,
WTUser replacedUser,
WTUser newUser)
Replaces the replaced user with the new user for resource objects. |
void |
setMilestones(Deliverable deliverable,
Vector milestones)
Adds the Deliverable to each be contained
in each Milestone passed as argument
as a list. |
ProjectActivity |
setResources(ProjectActivity act,
Vector resources,
Vector max_units)
Sets initial ProjectResource s for a ProjectActivity , given the resources and associated
maximum units. |
Deliverable |
setTarget(Deliverable deliverable,
Persistable target,
boolean latest)
Sets the target of a Deliverable as the
Persistable passed as argument. |
ProjectActivity |
updateResources(ProjectActivity act,
Vector resources,
Vector max_units)
Updates project resources for an activity, given the resources and associated maximum units. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
static final boolean SERVER
private static final String FC_RESOURCE
private static final String CLASSNAME
Constructor Detail |
public ProjResourceServiceFwd()
Method Detail |
private static Manager getManager() throws WTException
WTException
public ProjectActivity addResources(ProjectActivity act, Vector resources, Vector max_units) throws WTException
ProjectActivity
.
The resources and their corresponding maximum units are given as
two lists (Vector
) of ProjectResource
and Integer
, respectively. If the resource assignment
already exists and if the current maximum units resources is the same
as the maximum units resources passed as argument nothing happens.
Otherwise the maximum units that differ are updated.
addResources
in interface ProjResourceService
act
- resources
- max_units
-
WTException
public ProjectActivity changeResource(ProjectActivity projectActivity, ProjectResource old_resource, ProjectResource new_resource) throws WTException
ProjectResource
with another ProjectResource
in a ProjectActivity
.
changeResource
in interface ProjResourceService
projectActivity
- old_resource
- new_resource
-
WTException
public ProjectResource changeResourceCost(ProjectResource resource, Currency use, CurrencyRate std, CurrencyRate ovt) throws WTException
ProjectResource
passed as argument. For PersonResource
objects the method propagates changes as they affect work cost.
changeResourceCost
in interface ProjResourceService
resource
- use
- std
- ovt
-
WTException
public QueryResult createPersonResources(ProjectPlan plan, Vector assignees) throws WTException
WTUser
passed
as argument. Returns the list of PersonResource
just created. A resource is created for a specific user only if it
doesn't exist already.
createPersonResources
in interface ProjResourceService
plan
- assignees
-
WTException
public void delegate(ProjectWorkItem workItem, WTPrincipal principal) throws WTException
ProjectWorkItem
to user passed as argument. Updates the resource assignment and calls
the workflow method of the same name in the work service.
delegate
in interface ProjResourceService
workItem
- principal
-
WTException
public ProjectActivity getActivityHolder(Deliverable deliverable) throws WTException
ProjectActivity
that holds
the Deliverable
passed as argument.
Returns 'null' if deliverable is not held by any activity.
getActivityHolder
in interface ProjResourceService
deliverable
-
WTException
public QueryResult getActivityResources(ProjectActivity activity) throws WTException
ProjectResource
associated
with a given ProjectActivity
.
getActivityResources
in interface ProjResourceService
activity
-
WTException
public QueryResult getAllActivityResources(ProjectActivity activity) throws WTException
ProjectResource
objects associated with a given ProjectActivity
.
getAllActivityResources
in interface ProjResourceService
activity
-
WTException
public QueryResult getAllProjectResources(ProjectPlan plan) throws WTException
ProjectResource
associated with a given ProjectPlan
passed as arguent.
getAllProjectResources
in interface ProjResourceService
plan
-
WTException
public QueryResult getAllResourceAssignments(ProjectPlan plan, ResourceHolder holder, ProjectResource resource) throws WTException
ResourceAssignmentLink
)
for a ProjectPlan
, ResourceHolder
,
and ProjectResource
passed as arguments.
If the resource holder is not null, only resource assignments for
the holder are returned. Similarly, if the resource is not null,
only assignments for the given resource are returned. If the resource
is null, assignments for both enabled and disabled resources are returned.
getAllResourceAssignments
in interface ProjResourceService
plan
- holder
- resource
-
WTException
public QueryResult getAssignees(ProjectActivity activity) throws WTException
getAssignees
in interface ProjResourceService
activity
-
WTException
public Currency getCurrentCost(ExecutionObject exec_obj, Timestamp time) throws WTException
ProjectActivity
,
SummaryActivity
, ProjectProxy
and ProjectPlan
.
getCurrentCost
in interface ProjResourceService
exec_obj
- time
-
WTException
public Currency getCurrentCost(ProjectResource resource, ProjectActivity activity, Timestamp time) throws WTException
ProjectResource
in a ProjectActivity
up to the time
passed as argument.
getCurrentCost
in interface ProjResourceService
resource
- activity
- time
-
WTException
public Currency getCurrentResourceCost(ProjectResource resource, Timestamp time) throws WTException
ProjectResource
in the plan up to the time passed as argument.
This method may return a non-zero value only for CostResource
objects. For non-cost resources this method returns 0.0.
The current cost for a single activity is the cost per use plus a cost that depends on the type of the resource, as follows.
PersonResource
this is equal
to the current units multiplied by the resource standard rate.
getCurrentResourceCost
in interface ProjResourceService
resource
- time
-
WTException
public double getCurrentResourceUnits(ProjectResource resource, Timestamp time) throws WTException
ProjectResource
in the plan up to the
time passed as argument.
PersonResource
the number of
units is equal to the performed work for the workitem owned by the
user. If there are no tasks, the performed work for the activity
is divided among the resources proportionally to the resource participation.
TimeResource
(EquipmentResource
and FacilityResource
), the assignment
total resources is interpreted as a percentage. The current resource
units are computed as this percentage multiplied by the current duration
of the activity.
MaterialResource
, the
current resources is equal to the assignment total resources multiplied
by the ration of the current duration over the total duration.
getCurrentResourceUnits
in interface ProjResourceService
resource
- time
-
WTException
public double getCurrentUnits(ProjectResource resource, ProjectActivity activity, Timestamp time) throws WTException
ProjectResource
in a ProjectActivity
up to the time
passed as argument.
getCurrentUnits
in interface ProjResourceService
resource
- activity
- time
-
WTException
public QueryResult getDeliverables(ExecutionObject exec_obj) throws WTException
Deliverable
s associated to
n ExecutionObject
. If the execution
object is a deliverable holder (milestone or project activity) it
navigates the deliverable holding association. If it is a project
plan, it returns all deliverables in the plan. If it is a summary
activity, it returns all deliverables held by objects contained in
the summary. Otherwise an empty list is returned. Only enabled deliverables
are returned.
getDeliverables
in interface ProjResourceService
exec_obj
-
WTException
wt.projmgmtexecution.Milestone
,
wt.projmgmtexecution.ProjectActivity
,
wt.projmgmtexecution.ProjectPlan
,
wt.projmgmtexecution.ProjectProxy
,
wt.projmgmtexecution.SummaryActivity
,
Deliverable
,
DeliverableHolder
public QueryResult getDeliverables(WTUser user) throws WTException
Deliverable
objects owner
by the WTUser
passed as argument. Only deliverables
belonging to running projects are returned. The user passed as argument
can not be 'null'
getDeliverables
in interface ProjResourceService
user
-
WTException
public QueryResult getMilestoneHolders(Deliverable deliverable) throws WTException
Milestone
that hold
for the Deliverable
passed as argument.
getMilestoneHolders
in interface ProjResourceService
deliverable
-
WTException
public PersonResource getPersonResource(ProjectPlan plan, WTUser person) throws WTException
PersonResource
for a plan
given a WTUser
.
getPersonResource
in interface ProjResourceService
plan
- person
-
WTException
public QueryResult getProjectResources(ProjectPlan plan) throws WTException
ProjectResource
associated
with a given ProjectPlan
passed as argument.
getProjectResources
in interface ProjResourceService
plan
-
WTException
public ProjectResource getResource(ProjectPlan plan, String resource_name) throws WTException
ProjectResource
given the host
ProjectPlan
and the resource name.
Returns 'null' if this resource can't be found.
getResource
in interface ProjResourceService
plan
- resource_name
-
WTException
public QueryResult getResourceAssignments(ProjectPlan plan, ResourceHolder holder, ProjectResource resource) throws WTException
ResourceAssignmentLink
)
for a ProjectPlan
, ResourceHolder
,
and ProjectResource
passed as arguments.
If the resource holder is not null, only resource assignments for
the holder are returned. Similarly, if the resource is not null,
only assignments for the given resource are returned. If the resource
is null, assignments for only enabled are returned.
getResourceAssignments
in interface ProjResourceService
plan
- holder
- resource
-
WTException
public Currency getTotalCost(ExecutionObject exec_obj) throws WTException
ProjectActivity
,
SummaryActivity
, ProjectProxy
and ProjectPlan
.
getTotalCost
in interface ProjResourceService
exec_obj
-
WTException
public Currency getTotalCost(ProjectResource resource, ProjectActivity activity) throws WTException
ProjectResource
in a ProjectActivity
.
getTotalCost
in interface ProjResourceService
resource
- activity
-
WTException
public Currency getTotalResourceCost(ProjectResource resource) throws WTException
ProjectResource
in the ProjectPlan
that contains the
resource This method may return a non-zero value only for CostResource
objects. For non-cost resources this method returns 0.0. The total cost for a single activity is the cost per use plus a cost that depends on the type of the resource, as follows.
PersonResource
this is equal
to the total units multiplied by the resource standard rate.
getTotalResourceCost
in interface ProjResourceService
resource
-
WTException
public double getTotalResourceUnits(ProjectResource resource) throws WTException
ProjectResource
.
The total units depends on the type of the resource, as follows. It is a sum of the units for each activity in the plan.
PersonResource
this is equal
to the total work for the workitem owned by the user if the activity
has started. Otherwise the total work for the activity is divided
among the person resources proportionally to the participation.
TimeResource
(EquipmentResource
and FacilityResource
), the assignment
total resources is interpreted as a percentage. The total resources
is computed as this percentage of the total duration of the activity.
MaterialResource
, it
is equal to the assignment total resources.
getTotalResourceUnits
in interface ProjResourceService
resource
-
WTException
public double getTotalUnits(ProjectResource resource, ProjectActivity activity) throws WTException
ProjectResource
.
in a ProjectActivity
.
getTotalUnits
in interface ProjResourceService
resource
- activity
-
WTException
public QueryResult getUserDeliverables(WTUser user, ProjectPlan plan, ProjectState state) throws WTException
Deliverable
that belong to
a given WTUser
. If the plan passed as argument is 'null',
deliverables from all ProjectPlan
objects
are returned. Only plans in the state (ProjectState
)
passed as argument are considered. If the state is null, however,
all states are considered.
The deliverables are returned ordered by their deadlines (sooner
first) and then by their names.
Supported API: false
getUserDeliverables
in interface ProjResourceService
user
- plan
- state
-
WTException
public ProjectActivity removeResources(ProjectActivity act, Vector resources) throws WTException
ResourceAssignmentLink
)
that correspond to the ProjectActivity
.and
ProjectResource
s passed as arguments.
This method doesn't remove the resources from the plan just their
assignments in the activity.
removeResources
in interface ProjResourceService
act
- resources
-
WTException
public void replaceUser(WTContainer container, WTUser replacedUser, WTUser newUser) throws WTException
replaceUser
in interface ProjResourceService
container
- replacedUser
- newUser
-
WTException
public void setMilestones(Deliverable deliverable, Vector milestones) throws WTException
Deliverable
to each be contained
in each Milestone
passed as argument
as a list. Removes the deliverable from all milestones not in the
list.
setMilestones
in interface ProjResourceService
deliverable
- milestones
-
WTException
public ProjectActivity setResources(ProjectActivity act, Vector resources, Vector max_units) throws WTException
ProjectResource
s for a ProjectActivity
, given the resources and associated
maximum units. Assumes no resources has been set for the activity.
To update resources use ProjResourceService.updateResources(wt.projmgmt.execution.ProjectActivity, java.util.Vector, java.util.Vector)
setResources
in interface ProjResourceService
act
- resources
- max_units
-
WTException
public Deliverable setTarget(Deliverable deliverable, Persistable target, boolean latest) throws WTException
Deliverable
as the
Persistable
passed as argument. In case of iterated
object targets, the association between a deliverable is established
between the deliverable and the master if latest is 'true' or with
the iteration itself if not.
setTarget
in interface ProjResourceService
deliverable
- target
- latest
-
WTException
public ProjectActivity updateResources(ProjectActivity act, Vector resources, Vector max_units) throws WTException
updateResources
in interface ProjResourceService
act
- resources
- max_units
-
WTException
public QueryResult getUserDeliverables(WTUser user, ProjectPlan plan, ProjectState state, Integer queryLimit, String orderByStr) throws WTException
Deliverable
that belong to
a given WTUser
. If the plan passed as argument is 'null',
deliverables from all ProjectPlan
objects
are returned. Only plans in the state (ProjectState
)
passed as argument are considered. If the state is null, however,
all states are considered.
The deliverables are returned ordered by their deadlines (sooner
first) and then by their names.
Supported API: false
getUserDeliverables
in interface ProjResourceService
user
- plan
- state
- queryLimit
- orderByStr
-
WTException
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |