com.waveset.object
Class TaskResult

java.lang.Object
  extended bycom.waveset.object.PersistentObject
      extended bycom.waveset.object.TaskResult
All Implemented Interfaces:
java.lang.Comparable, javax.naming.Referenceable, XmlObject

public class TaskResult
extends PersistentObject

This class represents the result of an individual operation within the execution of a larger task.

Previously, a TaskInstance contained its entire WavesetResult. However, this made the task instance large, and this meant that the entire (increasingly large) task instance had to be serialized and re-written into the repository in order to add and persist another individual result. By separating the result from the task, and by separating each item of the result, we can make it easier to incrementally update (and to incrementally display) large results.

An instance ordinarily contains a WavesetResult object.


Nested Class Summary
 
Nested classes inherited from class com.waveset.object.PersistentObject
PersistentObject.Comparator, PersistentObject.InitialInstance
 
Field Summary
static java.lang.String code_id
           
static java.lang.String EL_TASKREF
           
static java.lang.String FROM_SEQUENCE
          Option key to specify the start of a sequence number range.
static java.lang.String JUST_LIST_THEM
          Option key to specify the end of a sequence number range.
static java.lang.String TO_SEQUENCE
          Option key to specify the end of a sequence number range.
 
Fields inherited from class com.waveset.object.PersistentObject
_trace, trace
 
Constructor Summary
TaskResult()
          Create an empty task result, ready to be filled.
TaskResult(org.w3c.dom.Element e)
          Build a work item from its XML representation.
TaskResult(TaskInstance task)
          Build a result for one part of a task.
TaskResult(TaskInstance task, int sequence)
          Build a result for one part of a task.
 
Method Summary
protected  void addSubclassAttributes(java.lang.StringBuffer buf)
          Each concrete subclass may append to the buffer an XML representation of any fields it adds to PersistentObject (if those field values must persist).
protected  void addSubclassElements(java.lang.StringBuffer buf)
          Each concrete subclass may append to the buffer an XML representation of any fields it adds to PersistentObject (if those field values must persist).
static AttributeCondition[] forTask(java.lang.String taskId)
           
static AttributeCondition[] forTask(TaskInstance ti)
           
protected  WSAttribute getAttributeValues(java.lang.String attrName)
           
static java.lang.String getName(java.lang.String taskId, int sequence)
           
static java.lang.String getName(TaskInstance task, int sequence)
           
static java.lang.String getNameBase(java.lang.String taskId)
           
static java.lang.String getParentTaskId(java.lang.String taskResultName)
           
 WavesetResult getResult()
           
 int getSequence()
           
 TaskInstance getTask()
          Get the resolved TaskInstance to which this result belongs.
 ObjectRef getTaskRef()
          Get a reference to the TaskInstance that contains our WorkflowCase.
 Type getType()
          Returns the associated Type object.
 java.util.List listQueryableAttributes()
           
 java.util.List listSummaryAttributes()
          Returns the complete list of defined attributes that this type of persistent object exposes as summary attributes (regardless of whether this particular object has a value for each).
protected  void parseSubclassAttributes(org.w3c.dom.Element e)
          Each concrete subclass should parse from the XML buffer any persisted subclass-specific fields (generally, the same ones that it writes into the buffer).
protected  void parseSubclassElements(org.w3c.dom.Element e)
          Each concrete subclass should parse from the XML buffer any persisted subclass-specific elements (generally, the same ones that it writes into the buffer).
 void setResult(WavesetResult result)
          Embed a WavesetResult in this extended result.
 void setSequence(int sequence)
          Set the sequence number for this extended result.
 
Methods inherited from class com.waveset.object.PersistentObject
addCommonElements, addEndTag, addMemberObjectGroup, addMemberObjectGroup, addPersistentAttributes, addStartTag, addSummaryAttributes, addXmlHeader, attributesMatch, attributesMatch, attributesMatch, checkReference, checkReferences, clearId, cloneAs, cloneObject, compareTo, create, create, create, create, createLastModItem, createLastModItem, createLastModItemList, directObjectGroupMember, dump, dumpFile, equals, fakeId, getAttribute, getAttributeValues, getAuthReferences, getAuthType, getBasicAttributes, getBasicAttributes, getBasicAttributes, getCache, getCounterValue, getCreateDate, getCreator, getDisplayableName, getDisplayName, getElementName, getEncryptedValues, getId, getIdOrName, getInitialInstances, getLastMod, getLastModDate, getLastModifier, getLastModItemId, getLockInfo, getMemberObjectGroupRefs, getMemberObjectGroupRefsUpTo, getMemberObjectGroups, getName, getNameOrId, getProperties, getProperty, getPropertyAsString, getPropertyList, getQueryableAttributes, getReference, getReferences, getRuleDrivenMemberObjectGroupRefs, getRuleDrivenMemberObjectGroupRefsUpTo, getRuleDrivenMemberObjectGroups, getSubtype, getSummaryAttributes, getSummaryString, hasEncryptedData, hashCode, identityEquals, isAlias, isHidden, isId, isProtected, isProtectedFromDelete, isReferencedIn, listOperationalAttributes, listQueryableReferenceAttributes, objectGroupMember, objectGroupMemberRef, parseCommonElement, parseCommonElements, parsePersistentAttributes, parseXml, parseXml, prepareForSerialization, prepareToSerialize, println, reEncrypt, reEncryptSubclassAttributes, removeMemberObjectGroup, removeProperty, resolve, resolve, resolve, resolveArray, resolveArrayByFetching, resolveObjectReference, resolveObjectReferences, resolveReference, resolveSummaryAttributes, resolveSummaryAttributes, ruleDrivenObjectGroupMemberRef, setAuthType, setAuthType, setCache, setCreateDate, setCreator, setDisplayName, setDisplayName, setHidden, setIsAlias, setLastMod, setLastMod, setLastModDate, setLastModifier, setMemberObjectGroupRef, setMemberObjectGroupRefs, setMemberObjectGroups, setName, setProperties, setProperty, setPropertyList, setProtected, setProtectedFromDelete, setRuleDrivenMembersCache, setSubtype, setTrace, toString, toXml, toXml, toXml, toXmlFile, visit
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

code_id

public static final java.lang.String code_id
See Also:
Constant Field Values

FROM_SEQUENCE

public static final java.lang.String FROM_SEQUENCE
Option key to specify the start of a sequence number range.

See Also:
Constant Field Values

TO_SEQUENCE

public static final java.lang.String TO_SEQUENCE
Option key to specify the end of a sequence number range.

See Also:
Constant Field Values

JUST_LIST_THEM

public static final java.lang.String JUST_LIST_THEM
Option key to specify the end of a sequence number range.

See Also:
Constant Field Values

EL_TASKREF

public static final java.lang.String EL_TASKREF
See Also:
Constant Field Values
Constructor Detail

TaskResult

public TaskResult()
Create an empty task result, ready to be filled.


TaskResult

public TaskResult(TaskInstance task)
Build a result for one part of a task.


TaskResult

public TaskResult(TaskInstance task,
                  int sequence)
Build a result for one part of a task.


TaskResult

public TaskResult(org.w3c.dom.Element e)
           throws WavesetException
Build a work item from its XML representation.

Method Detail

getType

public Type getType()
Returns the associated Type object.

Specified by:
getType in class PersistentObject

getTaskRef

public ObjectRef getTaskRef()
Get a reference to the TaskInstance that contains our WorkflowCase.


getTask

public TaskInstance getTask()
                     throws WavesetException
Get the resolved TaskInstance to which this result belongs.

Throws:
WavesetException

setSequence

public void setSequence(int sequence)
Set the sequence number for this extended result. Sequence numbers should increase monotonically.

This mutator allows the same TaskResult object to be re-used.


getSequence

public int getSequence()
Returns:
the sequence number for this extended result.

setResult

public void setResult(WavesetResult result)
Embed a WavesetResult in this extended result.

This allows the same TaskResult object to be re-used.


getResult

public WavesetResult getResult()
Returns:
the WavesetResult from this extended result.

getName

public static java.lang.String getName(TaskInstance task,
                                       int sequence)
Returns:
a generated task result name.

getName

public static java.lang.String getName(java.lang.String taskId,
                                       int sequence)
Returns:
a generated task result name.

getNameBase

public static java.lang.String getNameBase(java.lang.String taskId)
Returns:
a generated task result name.

getParentTaskId

public static java.lang.String getParentTaskId(java.lang.String taskResultName)
                                        throws InvalidArgument
Returns:
the id of the parent task from a generated task result name, or null if it cannot parse an id from the task result name.

In effect, an inverse of getName().

Throws:
InvalidArgument
See Also:
getName(String,int)

forTask

public static AttributeCondition[] forTask(TaskInstance ti)

forTask

public static AttributeCondition[] forTask(java.lang.String taskId)

listSummaryAttributes

public java.util.List listSummaryAttributes()
Description copied from class: PersistentObject
Returns the complete list of defined attributes that this type of persistent object exposes as summary attributes (regardless of whether this particular object has a value for each).

Any subclass of PersistentObject that overrides this method should first invoke super.listSummaryAttributes() to ensure that the subclass includes summary attributes that are common to all PersistentObjects.

Any subclass that overrides this implementation must also consider the length of the summary string that will be generated from these attributes.

Overrides:
listSummaryAttributes in class PersistentObject
Returns:
the complete list of defined attributes that this type of persistent object exposes as summary attributes (regardless of whether this particular object has a value for each).

Any subclass of PersistentObject that overrides this method should first invoke super.listSummaryAttributes() to ensure that the subclass includes summary attributes that are common to all PersistentObjects.

See Also:
Constants.MAX_SUMMARY_STRING_LENGTH, PersistentObject.getSummaryString()

listQueryableAttributes

public java.util.List listQueryableAttributes()
Overrides:
listQueryableAttributes in class PersistentObject
Returns:
the complete list of defined attributes that this type of persistent object exposes as queryable attributes (regardless of whether this particular object has a value for each).

Any subclass of PersistentObject that overrides this method should first invoke super.listQueryableAttributes() to ensure that the subclass includes queryable attributes that are common to all PersistentObjects.


getAttributeValues

protected WSAttribute getAttributeValues(java.lang.String attrName)
Overrides:
getAttributeValues in class PersistentObject
Parameters:
attrName - - the name of the attribute for which to return values.
Returns:
a WSAttribute that represents the value (or values) that this object contains for the specified attribute.


addSubclassAttributes

protected void addSubclassAttributes(java.lang.StringBuffer buf)
Description copied from class: PersistentObject
Each concrete subclass may append to the buffer an XML representation of any fields it adds to PersistentObject (if those field values must persist). PersistentObject's default implementation is a no-op.

NOTE: Any subclass that overrides this method must similarly override parseSubclassAttributes() so that the subclass attributes are restored.

Overrides:
addSubclassAttributes in class PersistentObject
See Also:


addSubclassElements

protected void addSubclassElements(java.lang.StringBuffer buf)
Description copied from class: PersistentObject
Each concrete subclass may append to the buffer an XML representation of any fields it adds to PersistentObject (if those field values must persist). PersistentObject's default implementation is a no-op.

NOTE: Any subclass that overrides this method must similarly override parseSubclassElements() so that the subclass elements are restored.

Overrides:
addSubclassElements in class PersistentObject
See Also:


parseSubclassAttributes

protected void parseSubclassAttributes(org.w3c.dom.Element e)
                                throws WavesetException
Description copied from class: PersistentObject
Each concrete subclass should parse from the XML buffer any persisted subclass-specific fields (generally, the same ones that it writes into the buffer).

Overrides:
parseSubclassAttributes in class PersistentObject
Throws:
WavesetException
See Also:

PersistentObject's default implementation is a no-op.

, PersistentObject.parseXml(Element)

parseSubclassElements

protected void parseSubclassElements(org.w3c.dom.Element e)
                              throws WavesetException
Description copied from class: PersistentObject
Each concrete subclass should parse from the XML buffer any persisted subclass-specific elements (generally, the same ones that it writes into the buffer).

Overrides:
parseSubclassElements in class PersistentObject
Throws:
WavesetException
See Also:

PersistentObject's default implementation is a no-op.

, PersistentObject.parseXml(Element)