public class Shift
extends com.primavera.integration.client.bo.base.ShiftBase
Shifts are used to define shift calendars for resources. A shift is comprised of one or more shift periods. The total duration of all shift periods in a shift always adds up to 24 hours, with one hour being the minimum shift period.
Shift hours are considered when calculating units and prices during leveling. The resource calendar is used to determine when the resource can work; the limits for that period are determined from the shift definition for that resource. The minimum resource availability for every shift must satisfy the minimum demand for the resource so that the resource can be leveled properly. Limits defined outside the boundaries of the shift definition are ignored. Since shifts are defined at the resource level, all projects are leveled using that resource according to the shift definition.
Shift periods may not be directly created or deleted. To access or change the shift periods on a shift, use the shift methods getShiftPeriodStarts(), getShiftPeriodDurations(), addShiftPeriod(), removeShiftPeriod(), and removeAllShiftPeriods().
See Also: Quick reference of Shift fields
| Constructor and Description |
|---|
Shift(Session session)
Class constructor specifying the Session.
|
Shift(Session session,
ObjectId objId)
Class constructor specifying the Session and ObjectId of the object.
|
Shift(Session session,
com.primavera.infr.db.PrmRowSet rowSet,
int iIndex)
Class constructor called internally after objects are retrieved from the server.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addShiftPeriod(int iStartHour)
Add a shift period with the start hour.
|
ObjectId |
create()
Creates this Shift object in the database.
|
static ObjectId[] |
create(Session session,
Shift[] shifts)
Creates multiple Shift objects in the database.
|
void |
delete()
Deletes this Shift object from the database.
|
static void |
delete(Session session,
Shift[] shifts)
Deletes multiple Shift objects from the database.
|
static String[] |
getAllFields()
Gets all fields for this business object.
|
Date |
getCreateDate()
Gets the date this shift was created.
|
String |
getCreateUser()
Gets the name of the user that created this shift.
|
static String[] |
getDefaultXMLExportFields()
Deprecated.
|
static String[] |
getFilterableFields()
Gets all fields that can be filtered.
|
static String[] |
getInternalAllFields()
An internal method that should not be called directly by client code.
|
static Set<String> |
getInternalAllFieldsSet()
An internal method that should not be called directly by client code.
|
static String[] |
getInternalDefaultLoadFields()
An internal method that should not be called directly by client code.
|
Date |
getLastUpdateDate()
Gets the date this shift was last updated.
|
String |
getLastUpdateUser()
Gets the name of the user that last updated this shift.
|
static String[] |
getMinimumXMLExportFields()
Gets all fields that are always exported at a minimum by the
new flat XML exporter
|
String |
getName()
Gets the name of the shift.
|
ObjectId |
getObjectId()
Gets the unique ID generated by the system.
|
static String[] |
getRequiredCreateFields()
Gets all fields that must be set before calling create() on this business object.
|
int[] |
getShiftPeriodDurations()
Gets the durations of the shift periods in an array.
|
int[] |
getShiftPeriodStarts()
Gets the start hours of the shift periods in an array.
|
static String[] |
getWritableFields()
Gets all writable fields for this business object.
|
static Shift |
load(Session session,
String[] fields,
ObjectId objId)
Loads a single Shift object from the database.
|
static BOIterator<Shift> |
load(Session session,
String[] fields,
ObjectId[] objIds)
Loads multiple Shift objects from the database.
|
BOIterator<ShiftPeriod> |
loadShiftPeriods(String[] fields,
String sWhereClause,
String sOrderBy)
Loads multiple associated ShiftPeriod objects from the database.
|
void |
removeAllShiftPeriods()
Remove all the shift periods.
|
void |
removeShiftPeriod(int iStartHour)
Remove a shift period with the start hour.
|
void |
setName(String s)
Sets the name of the shift.
|
void |
setObjectId(ObjectId o)
Sets the unique ID generated by the system.
|
String |
toString()
Returns a string representation of the object.
|
void |
update()
Updates this Shift object in the database.
|
static void |
update(Session session,
Shift[] shifts)
Updates multiple Shift objects in the database.
|
equals, getMaxFieldLength, getValue, getValue, hashCode, isNull, setEarlyDate, setNullpublic Shift(Session session)
session - the Sessionpublic Shift(Session session, ObjectId objId) throws BusinessObjectException
session - the SessionobjId - the ObjectIdBusinessObjectException - if a problem occurred in the client-side business objectspublic Shift(Session session, com.primavera.infr.db.PrmRowSet rowSet, int iIndex) throws BusinessObjectException
session - the SessionrowSet - the PrmRowSet retrieved from the serveriIndex - the row index in the PrmRowSet associated with this business objectBusinessObjectException - if a problem occurred in the client-side business objectspublic BOIterator<ShiftPeriod> loadShiftPeriods(String[] fields, String sWhereClause, String sOrderBy) throws ServerException, NetworkException, BusinessObjectException
fields - fields to loadsWhereClause - where clausesOrderBy - order-by clauseServerException - if a problem occurred on the server-sideNetworkException - if a problem occurred in the network layerBusinessObjectException - if a problem occurred in the client-side business objectspublic int[] getShiftPeriodStarts()
throws BusinessObjectException
getShiftPeriodStarts in class com.primavera.integration.client.bo.base.ShiftBaseBusinessObjectException - if something was wrong in this Business objectpublic int[] getShiftPeriodDurations()
throws BusinessObjectException
getShiftPeriodDurations in class com.primavera.integration.client.bo.base.ShiftBaseBusinessObjectException - if something was wrong in this Business objectpublic void addShiftPeriod(int iStartHour)
throws BusinessObjectException
addShiftPeriod in class com.primavera.integration.client.bo.base.ShiftBaseiStartHour - the start hour of the shift periodBusinessObjectException - if something was wrong in this Business objectpublic void removeShiftPeriod(int iStartHour)
throws BusinessObjectException
removeShiftPeriod in class com.primavera.integration.client.bo.base.ShiftBaseiStartHour - the start hour of the shift periodBusinessObjectException - if something was wrong in this Business objectpublic void removeAllShiftPeriods()
throws BusinessObjectException
removeAllShiftPeriods in class com.primavera.integration.client.bo.base.ShiftBaseBusinessObjectException - if something was wrong in this Business objectpublic ObjectId getObjectId() throws BusinessObjectException
getObjectId in class BusinessObjectBusinessObjectException - if a problem occurred in the client-side business objectspublic void setObjectId(ObjectId o) throws BusinessObjectException
setObjectId in class BusinessObjecto - the value to set this field toBusinessObjectException - if a problem occurred in the client-side business objectspublic String getName() throws BusinessObjectException
BusinessObjectException - if a problem occurred in the client-side business objectspublic void setName(String s) throws BusinessObjectException
s - the value to set this field toBusinessObjectException - if a problem occurred in the client-side business objectspublic Date getCreateDate() throws BusinessObjectException
BusinessObjectException - if a problem occurred in the client-side business objectspublic Date getLastUpdateDate() throws BusinessObjectException
BusinessObjectException - if a problem occurred in the client-side business objectspublic String getCreateUser() throws BusinessObjectException
BusinessObjectException - if a problem occurred in the client-side business objectspublic String getLastUpdateUser() throws BusinessObjectException
BusinessObjectException - if a problem occurred in the client-side business objectspublic static String[] getRequiredCreateFields()
public static String[] getFilterableFields()
public static String[] getInternalDefaultLoadFields()
public static String[] getAllFields()
public static String[] getInternalAllFields()
public static Set<String> getInternalAllFieldsSet()
public static String[] getWritableFields()
@Deprecated public static String[] getDefaultXMLExportFields()
public static String[] getMinimumXMLExportFields()
public String toString()
public ObjectId create() throws ServerException, NetworkException, BusinessObjectException
ServerException - if a problem occurred on the server-sideNetworkException - if a problem occurred in the network layerBusinessObjectException - if a problem occurred in the client-side business objectspublic static ObjectId[] create(Session session, Shift[] shifts) throws ServerException, NetworkException, BusinessObjectException
session - the Session objectshifts - array of Shift objects to createServerException - if a problem occurred on the server-sideNetworkException - if a problem occurred in the network layerBusinessObjectException - if a problem occurred in the client-side business objectspublic static Shift load(Session session, String[] fields, ObjectId objId) throws ServerException, NetworkException, BusinessObjectException
session - the Session objectfields - fields to loadobjId - unique ID of the Shift objectServerException - if a problem occurred on the server-sideNetworkException - if a problem occurred in the network layerBusinessObjectException - if a problem occurred in the client-side business objectspublic static BOIterator<Shift> load(Session session, String[] fields, ObjectId[] objIds) throws ServerException, NetworkException, BusinessObjectException
session - the Session objectfields - fields to loadobjIds - object ids of the Shift objectsServerException - if a problem occurred on the server-sideNetworkException - if a problem occurred in the network layerBusinessObjectException - if a problem occurred in the client-side business objectspublic void update()
throws ServerException,
NetworkException,
BusinessObjectException
update in class com.primavera.integration.client.BOBaseServerException - if a problem occurred on the server-sideNetworkException - if a problem occurred in the network layerBusinessObjectException - if a problem occurred in the client-side business objectspublic static void update(Session session, Shift[] shifts) throws ServerException, NetworkException, BusinessObjectException
session - the Session objectshifts - array of Shift objects to updateServerException - if a problem occurred on the server-sideNetworkException - if a problem occurred in the network layerBusinessObjectException - if a problem occurred in the client-side business objectspublic void delete()
throws ServerException,
NetworkException,
BusinessObjectException
delete in class com.primavera.integration.client.BOBaseServerException - if a problem occurred on the server-sideNetworkException - if a problem occurred in the network layerBusinessObjectException - if a problem occurred in the client-side business objectspublic static void delete(Session session, Shift[] shifts) throws ServerException, NetworkException, BusinessObjectException
session - the Session objectshifts - array of Shift objects to deleteServerException - if a problem occurred on the server-sideNetworkException - if a problem occurred in the network layerBusinessObjectException - if a problem occurred in the client-side business objectsCopyright © 2003, 2020, Oracle and/or its affiliates.
Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their respective owners.