com.ibm.task.clientmodel.bean
Class WorkItemBean

java.lang.Object
  extended bycom.ibm.task.clientmodel.bean.WorkItemBean

public class WorkItemBean
extends java.lang.Object

Accesses the properties of the original WorkItem object and adds metadata for national language support and converters.

A work item represents a relationship between a person or group of persons and an object, typically an activity or task instance. The relationship is described by attributes such as the type of the associated object and the reason why the object is assigned.

A WorkItemBean object can be instantiated from a QueryResultSet object.
Only the following properties are going to be loaded from the query result set:

If the property was not found in the query result set, the property will remain empty. Accessing an empty property requires the bean to load the missing information from the server.

Use the static method getLabel(String, Locale) to retrieve the localized label for a property. Use the static method getConverter(String) to retrieve a converter for a property. The return value may be null because converters are optional.

See Also:
WorkItem, QueryResultSet

Field Summary
static java.lang.String ASSIGNEDTOEVERYBODY_PROPERTY
          Use the property name to determine labels and converters for the property assignedToEverybody.
static java.lang.String COPYRIGHT
          (C) Copyright IBM Corporation 2005.
static java.lang.String CREATIONIME_PROPERTY
          Use the property name to determine labels and converters for the property creationTime.
static java.lang.String ID_PROPERTY
          Use the property name to determine labels and converters for the property ID.
static java.lang.String OBJECTID_PROPERTY
          Use the property name to determine labels and converters for the property objectID.
static java.lang.String OBJECTTYPE_PROPERTY
          Use the property name to determine labels and converters for the property objectType.
static java.lang.String OWNER_PROPERTY
          Use the property name to determine labels and converters for the property owner.
static java.lang.String REASON_PROPERTY
          Use the property name to determine labels and converters for the property reason.
static java.lang.String TASKDISPLAYNAME_PROPERTY
          Use the property name to determine labels and converters for the property taskDisplayName.
static java.lang.String TASKNAME_PROPERTY
          Use the property name to determine labels and converters for the property taskName.
 
Constructor Summary
WorkItemBean(com.ibm.task.api.QueryResultSet resultSet, HTMConnection htmConnection)
          Constructs a new WorkItemBean from a QueryResultSet.
 
Method Summary
static SimpleConverter getConverter(java.lang.String propertyName)
          Returns the default converter for a given property.
 java.util.Calendar getCreationTime()
          Returns the property creationTime.
 com.ibm.bpe.api.WIID getID()
          Returns the property ID.
static java.lang.String getLabel(java.lang.String propertyName)
          Returns the resource bundle key for a property
static java.lang.String getLabel(java.lang.String propertyName, java.util.Locale locale)
          Returns the label for a property from the resource bundle.
 com.ibm.bpe.api.OID getObjectID()
          Returns the property objectID.
 int getObjectType()
          Returns the property objectType.
 java.lang.String getOwner()
          Returns the property owner.
 int getReason()
          Returns the property reason.
 com.ibm.bpc.clientcore.util.LocalisedString getTaskDisplayName()
          Returns the property taskDisplayName.
 java.lang.String getTaskDisplayName(java.util.Locale locale)
          Returns the property taskDisplayName.
 boolean isAssignedToEverybody()
          Returns the property assignedToEverybody.
static boolean isValid(java.lang.String propertyName)
          Checks if the property is valid.
 void setAssignedToEverybody(boolean newAssignedToEverybody)
          Sets the property assignedToEverybody.
 void setCreationTime(java.util.Calendar newCreationTime)
          Sets the property creationTime.
 void setID(com.ibm.bpe.api.WIID newWorkitemID)
          Sets the property ID.
 void setObjectID(com.ibm.bpe.api.OID newObjectID)
          Sets the property objectID.
 void setObjectType(int newObjectType)
          Sets the property objectType.
 void setOwner(java.lang.String newOwner)
          Sets the property owner.
 void setReason(int newReason)
          Sets the property reason.
 java.lang.String toString()
          Returns all properties in a printable format
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

COPYRIGHT

public static final java.lang.String COPYRIGHT
(C) Copyright IBM Corporation 2005.

See Also:
Constant Field Values

CREATIONIME_PROPERTY

public static java.lang.String CREATIONIME_PROPERTY
Use the property name to determine labels and converters for the property creationTime.


ID_PROPERTY

public static java.lang.String ID_PROPERTY
Use the property name to determine labels and converters for the property ID.


OBJECTID_PROPERTY

public static java.lang.String OBJECTID_PROPERTY
Use the property name to determine labels and converters for the property objectID.


OBJECTTYPE_PROPERTY

public static java.lang.String OBJECTTYPE_PROPERTY
Use the property name to determine labels and converters for the property objectType.


OWNER_PROPERTY

public static java.lang.String OWNER_PROPERTY
Use the property name to determine labels and converters for the property owner.


REASON_PROPERTY

public static java.lang.String REASON_PROPERTY
Use the property name to determine labels and converters for the property reason.


ASSIGNEDTOEVERYBODY_PROPERTY

public static java.lang.String ASSIGNEDTOEVERYBODY_PROPERTY
Use the property name to determine labels and converters for the property assignedToEverybody.


TASKNAME_PROPERTY

public static java.lang.String TASKNAME_PROPERTY
Use the property name to determine labels and converters for the property taskName.


TASKDISPLAYNAME_PROPERTY

public static java.lang.String TASKDISPLAYNAME_PROPERTY
Use the property name to determine labels and converters for the property taskDisplayName.

Constructor Detail

WorkItemBean

public WorkItemBean(com.ibm.task.api.QueryResultSet resultSet,
                    HTMConnection htmConnection)
Constructs a new WorkItemBean from a QueryResultSet.

Parameters:
resultSet - The result object of a query.
htmConnection - The connection to the HumanTaskManagerService API.
Method Detail

getConverter

public static SimpleConverter getConverter(java.lang.String propertyName)
Returns the default converter for a given property.

Parameters:
propertyName - The name for the property.
Returns:
The converter instance if one has been registered with propertyName, null otherwise.

getLabel

public static java.lang.String getLabel(java.lang.String propertyName)
Returns the resource bundle key for a property

Parameters:
propertyName - The name for the property.
Returns:
The resource bundle key for the property.

getLabel

public static java.lang.String getLabel(java.lang.String propertyName,
                                        java.util.Locale locale)
Returns the label for a property from the resource bundle. If no label is found in the resource bundle the resource bundle key for the property is returned.

Parameters:
propertyName - The name for the property.
locale - The locale.
Returns:
The label or the resource bundle key for the property.

isValid

public static boolean isValid(java.lang.String propertyName)
Checks if the property is valid.

Parameters:
propertyName - The name of the property to be checked.
Returns:
True, if the propertyName is a known property for an object of this class.

getCreationTime

public java.util.Calendar getCreationTime()
Returns the property creationTime.

Returns:
the time of the creation

getID

public com.ibm.bpe.api.WIID getID()
Returns the property ID.

Returns:
the id of the work item

getObjectID

public com.ibm.bpe.api.OID getObjectID()
Returns the property objectID.

Returns:
the id of the object

getObjectType

public int getObjectType()
Returns the property objectType.

Returns:
the type of the object

getTaskDisplayName

public com.ibm.bpc.clientcore.util.LocalisedString getTaskDisplayName()
Returns the property taskDisplayName.

Returns:
the display name of the task

getTaskDisplayName

public java.lang.String getTaskDisplayName(java.util.Locale locale)
Returns the property taskDisplayName.

Returns:
the display name of the task

getOwner

public java.lang.String getOwner()
Returns the property owner.

Returns:
the owener of the work item

getReason

public int getReason()
Returns the property reason.

Returns:
the reason of this work item

isAssignedToEverybody

public boolean isAssignedToEverybody()
Returns the property assignedToEverybody.

Returns:
true if this work item is assigend to everybody; false otherwise

setAssignedToEverybody

public void setAssignedToEverybody(boolean newAssignedToEverybody)
Sets the property assignedToEverybody.

Parameters:
newAssignedToEverybody - true if the work item should be assigned to everybody

setCreationTime

public void setCreationTime(java.util.Calendar newCreationTime)
Sets the property creationTime.

Parameters:
newCreationTime - the time of the object creation

setID

public void setID(com.ibm.bpe.api.WIID newWorkitemID)
Sets the property ID.

Parameters:
newWorkitemID - the id of the work item

setObjectID

public void setObjectID(com.ibm.bpe.api.OID newObjectID)
Sets the property objectID.

Parameters:
newObjectID - the object id

setObjectType

public void setObjectType(int newObjectType)
Sets the property objectType.

Parameters:
newObjectType - the type of the work item

setOwner

public void setOwner(java.lang.String newOwner)
Sets the property owner.

Parameters:
newOwner - the owner of the work item

setReason

public void setReason(int newReason)
Sets the property reason.

Parameters:
newReason - the reason of this work item

toString

public java.lang.String toString()
Returns all properties in a printable format

Returns:
the attributes in a printable format