public class WorkAssignment extends BaseMetadata implements Serializable
The operating times and resource allocation for a WorkAssignment are defined via a Workshift definition. One or more Workshift definitions can be associated with the WorkAssignment definition.
Once a WorkAssignment is defined, it can then be associated with a Request Processor at runtime. A definition of a WorkAssignment can be bound to one or more Request Processors and a Request Processor can have multiple WorkAssignment definitions bound to it.
Modifier and Type | Class and Description |
---|---|
static class |
WorkAssignment.SpecializationNode
Enumerates the supported nodes for WorkAssignment specialization.
|
static class |
WorkAssignment.SpecializationProperty
Enumerates the supported property names for WorkAssignment
specialization.
|
Constructor and Description |
---|
WorkAssignment(String name,
String description)
Constructor with the name and description.
|
WorkAssignment(String name,
String description,
Document specialization,
Collection workshifts,
boolean active)
Constructor to create a fully-defined WorkAssignment.
|
WorkAssignment(String name,
String displayNameKey,
String descriptionKey,
Document specialization,
Collection workshifts,
boolean active,
String[] resourceBundleIDs)
Constructor to create a fully-defined WorkAssignment and
associated resource bundles.
|
WorkAssignment(String name,
String displayNameKey,
String descriptionKey,
String[] resourceBundleIDs)
Constructor with the name and description and associated resource
bundles.
|
Modifier and Type | Method and Description |
---|---|
void |
addWorkshift(MetadataObjectId objectId)
Adds a workshift to this WorkAssignment.
|
void |
addWorkshifts(Collection objectIds)
Adds a collection of workshifts to this WorkAssignment.
|
WorkAssignment |
clone(String newName) |
boolean |
equals(Object obj)
Compares an object for equality with this WorkAssignment object.
|
BaseMetadataType |
getBaseMetadataType()
Gets the intended type of this metadata.
|
Document |
getSpecializationRules()
Retrieves the specialization rules defined in this WorkAssignment.
|
Collection |
getWorkshifts()
Returns the workshifts that are associated with this WorkAssignment.
|
boolean |
isActive()
Deprecated.
Replaced by
WorkAssignment.isEnabled() |
boolean |
isEnabled()
Checks if the work assignment definition is enabled.
|
void |
removeWorkshift(MetadataObjectId objectId)
Removes a workshift from this WorkAssignment.
|
void |
setActive(boolean value)
Deprecated.
Replaced by
WorkAssignment.setEnabled(boolean) |
void |
setEnabled(boolean value)
Enables or disables the work assignment.
|
void |
setSpecializationRules(Document doc)
Sets the specialization rules for this WorkAssignment.
|
String |
toString()
Same value as
BaseMetadata.getName() . |
void |
validateBound()
Validates this as a bound WorkAssignment.
|
getDescription, getDescriptionKey, getDisplayName, getDisplayNameKey, getMetadataObjectId, getName, getResourceBundles, hashCode, setDescription, setDescriptionKey, setDisplayName, setDisplayNameKey, setResourceBundles, validate
public WorkAssignment(String name, String description)
name
- name to be assigned to this WorkAssignment. Name is also
used as the default display name unless otherwise specifically set.description
- description for this WorkAssignment, or
null
if none.public WorkAssignment(String name, String displayNameKey, String descriptionKey, String[] resourceBundleIDs)
name
- name of the WorkAssignment. Name is also
used as the default display name unless otherwise specifically set.displayNameKey
- the resource bundle key for the display name.
Optional.descriptionKey
- the resource bundle key for the description.
Optional.resourceBundleIDs
- optional array of resource bundle id.public WorkAssignment(String name, String description, Document specialization, Collection workshifts, boolean active)
name
- name of the WorkAssignment. Name is also
used as the default display name unless otherwise specifically set.description
- the description for this WorkAssignment, or
null
if none.specialization
- XML fragment that defines the
specialization rules for this WorkAssignment.workshifts
- collection of the names of one or more
Workshift definitions to be associated with this WorkAssignment.active
- true
if the work assignment is active;
false
if it is not active.public WorkAssignment(String name, String displayNameKey, String descriptionKey, Document specialization, Collection workshifts, boolean active, String[] resourceBundleIDs)
name
- name of the WorkAssignment. Name is also
used as the default display name unless otherwise specifically set.displayNameKey
- the resource bundle key for the display name.
Optional.descriptionKey
- the resource bundle key for the description.
Optional.specialization
- the XML fragment that defines the
specialization rules for this WorkAssignment.workshifts
- a collection of the names of one or more
Workshift definitions to be associated with this WorkAssignment.active
- true
if the work assignment is active;
false
if it is not active.resourceBundleIDs
- optional array of resource bundle id.public void addWorkshifts(Collection objectIds)
When this WorkAssignment definition is persisted in the metadata repository using the metadata services, the metadata service validates that the workshifts referred by the names in the argument exist in the system.
objectIds
- list of workshifts to be associated to
this WorkAssignment.public void addWorkshift(MetadataObjectId objectId)
When this WorkAssignment definition is persisted in the metadata repository using the metadata services, the metadata service validates that the workshift referred by the name in the argument exist in the system.
objectId
- identifier of a workshift to be associated
with this WorkAssignment.public Collection getWorkshifts()
The actual Workshift definitions can be retrieved by calling the appropriate methods in the metdata services.
public void removeWorkshift(MetadataObjectId objectId)
objectId
- identifier of the Workshift to be removed.public Document getSpecializationRules()
public void setSpecializationRules(Document doc)
These rules are specified as an XML fragment that must comply with the specified XML schema. The enforcement and validation of the XML fragment against the schema is done when the WorkAssignment is persisted using the metadata services.
doc
- XML fragment that contains the specialization rule.public boolean isEnabled()
true
if enabled, or {code false} is disabled.public void setEnabled(boolean value)
value
- true
to enable; false
to disable.@Deprecated public boolean isActive()
WorkAssignment.isEnabled()
true
if enabled, or {code false} otherwise.@Deprecated public void setActive(boolean value)
WorkAssignment.setEnabled(boolean)
value
- true
to enable, false
to disable.public void validateBound() throws ValidationException
The method performs checks that are possible on this object.
It does not ensure the existence of objects referenced by this
definition. Such references and related validations are done by
the MetadataService
at the time of object persistence.
MetadataService
also calls this method to ensure only
valid objects are persisted.
ValidationException
- thrown if any invalid data is detected.public boolean equals(Object obj)
public String toString()
BaseMetadata
BaseMetadata.getName()
.toString
in class BaseMetadata
public BaseMetadataType getBaseMetadataType()
BaseMetadata
getBaseMetadataType
in class BaseMetadata
public WorkAssignment clone(String newName)
clone
in class BaseMetadata