oracle.apps.fnd.wf.engine
Class WorkItem

java.lang.Object
  |
  +--oracle.apps.fnd.wf.common.Element
        |
        +--oracle.apps.fnd.wf.common.BaseComponent
              |
              +--oracle.apps.fnd.wf.engine.EngineBaseComponent
                    |
                    +--oracle.apps.fnd.wf.engine.WorkItem

public class WorkItem
extends EngineBaseComponent

This is the container component that holds all runtime components for a given itemtype and itemkey. It is registered in a store and is created by a factory. For example, to create a new WorkItem, WorkItemFactory

   itemFactory = WorkItemFactory.getInstance(); 
WorkItem item = itemFactory.createWorkItem(rctx,mItemType,mItemKey,mProcessName);

Its id takes format of "<ItemType>:<ItemKey>".

It holds a reference to a WorkflowContext instance and a root process. The root process interfaces with a workflow engine while the WorkflowContext contains the contextual information for engine and data loader to use. This class is not responsible for creating nor destroying context object. It simply releases the reference once it is done with it.


Field Summary
static java.lang.String RCS_ID
           
static boolean RCS_ID_RECORDED
           
 
Fields inherited from class oracle.apps.fnd.wf.engine.EngineBaseComponent
ACTIVE, BLOCK, CANCELLED, COMPLETE, ERROR, FORCED_COMPLETE, NOT_INITIALIZED, SUSPENDED, WAITING
 
Fields inherited from class oracle.apps.fnd.wf.common.Element
ELEMENT_DB_CREATED, ELEMENT_DB_CREATING, ELEMENT_DB_DIRTY, ELEMENT_DB_LOADED, ELEMENT_DB_LOADING, ELEMENT_DB_NOT_INITIALIZED, ELEMENT_DB_SAVED, ELEMENT_DB_SAVING
 
Method Summary
 java.lang.Object[] getAttributeValueArray()
          Returns an array of item attributes
 java.lang.String getItemKey()
          Returns item key of this instnace
 java.lang.String getItemType()
          Returns item type of this instnace
 DesignBaseComponent getMetaType()
          Returns ItemType on which this workitem is based
 java.lang.String getOwner()
          Returns owner of of this item instnace
 java.lang.String getParentContext()
          Returns item parent context
 java.lang.String getParentKey()
          Gets parent item key
 java.lang.String getParentType()
          Returns item parent type
 WorkItemProcess getProcess()
          Returns root process of this instnace.
 java.lang.String getStatusInXML()
          Return runtime status of this component in xml
 java.lang.String getUserKey()
          Returns user defined key of this instnace
 void setAttributeValues(java.util.Map values)
          Sets attribute values for this workitem.
 void setOwner(java.lang.String pOwner)
          Sets new owner of this item instnace.
 void setParentContext(java.lang.String pParentType, java.lang.String pParentKey, java.lang.String pParentContext)
          Sets context information for its parent workitem.
 void setUserKey(java.lang.String pUserKey)
          Sets a user defined key of this instnace
 
Methods inherited from class oracle.apps.fnd.wf.engine.EngineBaseComponent
addChild, getAttributeValue, getAttributeValues, getEndDate, getInstancePath, getStartDate, getStatus, getWorkItem, isActive, isComplete, save, setAttributeValue, setMetaType, setStatus
 
Methods inherited from class oracle.apps.fnd.wf.common.BaseComponent
getChildByTypeAndName, getChildren, getChildrenByName, getChildrenByType, getName, getParent, removeChild, removeChildren
 
Methods inherited from class oracle.apps.fnd.wf.common.Element
create, getDBStatus, getId, load, setStore, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

RCS_ID

public static final java.lang.String RCS_ID

RCS_ID_RECORDED

public static final boolean RCS_ID_RECORDED
Method Detail

getProcess

public WorkItemProcess getProcess()
                           throws WorkflowException
Returns root process of this instnace. If a root process has not been created yet, it will be created here.
Returns:
return-value
Throws:
WorkflowException - when failed to create a process
See Also:
WorkItemProcess

getItemType

public java.lang.String getItemType()
Returns item type of this instnace
Returns:
Item Type

getItemKey

public java.lang.String getItemKey()
Returns item key of this instnace
Returns:
Item Key

setUserKey

public void setUserKey(java.lang.String pUserKey)
                throws WorkflowException
Sets a user defined key of this instnace
Parameters:
pUserKey - new user reference key for this item instance
Throws:
WorkflowException - Exception

getUserKey

public java.lang.String getUserKey()
Returns user defined key of this instnace
Returns:
userKey:String

setOwner

public void setOwner(java.lang.String pOwner)
              throws WorkflowException
Sets new owner of this item instnace. Business logic for changing owner of a workitem is default to none. Owner field is a purely for client reference to this item instance.
Parameters:
pOwner - new owner for this item instance
Throws:
WorkflowException - Exception

getOwner

public java.lang.String getOwner()
                          throws WorkflowException
Returns owner of of this item instnace
Returns:
owner:String
Throws:
WorkflowException - Exception

setParentContext

public void setParentContext(java.lang.String pParentType,
                             java.lang.String pParentKey,
                             java.lang.String pParentContext)
                      throws WorkflowException
Sets context information for its parent workitem. This is used when the workitem is owned by another workitem.
Parameters:
pParentType - type of the parent workitem
pParentKey - id of the parent workitem
pParentContext - context information for the parent workitem
Throws:
WorkflowException - when failes persistent data operation

getParentType

public java.lang.String getParentType()
                               throws WorkflowException
Returns item parent type
Returns:
parentType:String item type of the parent workitem
Throws:
WorkflowException - when failes persistent data operation

getParentKey

public java.lang.String getParentKey()
                              throws WorkflowException
Gets parent item key
Returns:
parentKey : String parent workitem key
Throws:
WorkflowException - when failes persistent data operation

getParentContext

public java.lang.String getParentContext()
                                  throws WorkflowException
Returns item parent context
Returns:
parantContext:String context information of this workitem.
Throws:
WorkflowException - when failes persistent data operation

setAttributeValues

public void setAttributeValues(java.util.Map values)
                        throws WorkflowException
Sets attribute values for this workitem. A hashtable of attribute values are passed and all name matched attributes will be set to the values passed in.
Overrides:
setAttributeValues in class EngineBaseComponent
Parameters:
values - Hashtable new attribute values
Throws:
WorkflowException - when failes persistent data operation

getAttributeValueArray

public java.lang.Object[] getAttributeValueArray()
                                          throws WorkflowException
Returns an array of item attributes
Returns:
attributeArray : Object[] list of attribute values of this workitem
Throws:
WorkflowException - when failes to retieve the attribute list

getMetaType

public DesignBaseComponent getMetaType()
Returns ItemType on which this workitem is based
Overrides:
getMetaType in class EngineBaseComponent
Returns:
itemType : ItemType
Throws:
WorkflowRuntimeException - when failes to loaded the definition of the named item type.

getStatusInXML

public java.lang.String getStatusInXML()
Return runtime status of this component in xml
Returns:
XML string in a schema given by Oracle Workflow