|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Defines the interface for a work item, or the smallest unit of work definable in the Process Manager world. A work item that belongs to an active process instance exists at a particular node at a particular point in time. Once the work required of the node has been completed, the work item is removed and another work item is created at another node; work items are created and removed in this manner until the process instance has completed at an exit point.
The work item interface is the focus of user interactions both from the Express UI and from the API. The work item is used to access the process instance, modify the assignee list, alter the expiration properties and alert the engine as to how to complete and route the item itself.
The work item object that implements this interface may not be instantiated manually, rather the IPMApplication and IFinder interfaces may be used to obtain a handle on a work item object.
// The localName is the name of the application, "myApp" for instance. // javax.naming.Context cxt = new javax.naming.InitialContext(); String jndiName = "java:comp/env/" + IPMApplication.DEFAULT_JNDI_ROOT + "/" + localName; IPMApplicationHome home = (IPMApplicationHome) cxt.lookup( jndiName ); IPMApplication app = home.create(); // Fetch a handle to a work item for update // IWorkItemPK pk = WorkItemPKFactory.create( 100, "0", "Activity1" ); pk.setEditable( true ); IWorkItem wi = app.findWorkItem( pk );
IFinder
,
IPMApplication
,
IProcessInstance
Field Summary | |
static java.lang.String |
DEFAULT_FORK_ID
The default fork id value for a newly created work item. |
static int |
STATE_ACTIVE
State value for a work item that is assigned to a single user and is currently being worked upon. |
static int |
STATE_COMPLETED
State value for a work item that has just been completed. |
static int |
STATE_RUNNING
State value for a work item that has been assigned to a single user but has not been started yet. |
static int |
STATE_RUNNING_TO_GROUP
State value for a work item that has been assigned to a group of users but has not been accepted by a member of that group yet. |
static int |
STATE_SUSPENDED
State value for a work item that has been suspended. |
static int |
STATE_TERMINATED
State value for a work item that has just been terminated. |
Method Summary | |
void |
addAssignee(IParticipant user)
Adds the specified user onto the list of current assignees for this work item. |
void |
addAssignee(IRole role)
Adds the specified role onto the list of current assignees for this work item. |
java.util.Enumeration |
assignees()
Returns an enumeration of the current assignees for this work item. |
void |
deleteSiblings()
Deletes all of a work item's sibling work items. |
void |
expire()
Expires the work item by seting the expiration flag of the work item to true and executing the expiration handler script associated with the node the work item is currently positioned at. |
void |
extend(java.util.Date newDate)
Sets a new expiration date for the work item and resets the work item's expiration flag to false. |
java.lang.String |
getApplicationName()
Returns the common name of the application this work item belongs to. |
IProcessInstancePK |
getChildPrimaryKey()
Returns the primary key of the child process instance that this work item spawned. |
java.lang.String |
getClusterName()
Returns the name of the cluster this work item belongs to. |
java.lang.String |
getComment()
Returns the history comment as specified by the user. |
ITransition |
getConclusion()
Returns the current transition being used to complete the work item. |
java.util.Date |
getCreationDate()
Returns the creation date of this work item. |
java.lang.String |
getErrorMessage()
Returns the attached error message as specified by the user from a completion script. |
java.util.Date |
getExpirationDate()
Returns the current expiration date of the work item, or null if the work item does not have an expiration date. |
INodeElement |
getNode()
Returns the node element that the work item is currently positioned at. |
IWorkItemPK |
getPrimaryKey()
Returns the primary key for this work item. |
IProcessInstance |
getProcessInstance()
Returns the process instance this work item belongs to. |
java.lang.String |
getRedirectionURL()
Returns the attached redirection URL as specified by the user from a completion script. |
int |
getState()
Returns the state of the work item. |
INodeElement |
getTargetNode()
Returns the original node the exception occurred at. |
boolean |
hasExpired()
Returns true if the work item has already been expired, that is if the work item's expiration flag has been set to true. |
boolean |
hasSiblings()
Returns true if the work item has sibling work items that have not completed yet. |
boolean |
isAutomated()
Returns true if the node the work item is currently positioned at is automated. |
boolean |
isExceptionWorkItem()
Returns true if the work item is positioned at an exception node. |
boolean |
isUserAssignee(IParticipant p)
Returns true is the given corporate directory user is in the list of assignees for this work item. |
void |
release(boolean commit)
Commit/rollback the work item changes to the back-end store. |
void |
removeAssignees()
Removes the current list of assignees for this work item. |
void |
resume()
Resumes a suspended work item. |
void |
save()
Save the work item and its associated process instance. |
void |
setComment(java.lang.String comment)
Sets the history comment specified by the user. |
void |
setConclusion(ITransition action)
Specifies the transition to use to complete the work item. |
void |
setExpirationDate(java.util.Date expDate)
Sets a new expiration date for the work item but does not reset the work item's expiration flag. |
void |
suspend()
Suspends the work item - no actions can be performed on the work item until it is resumed. |
Field Detail |
public static final int STATE_RUNNING
getState()
public static final int STATE_RUNNING_TO_GROUP
STATE_ACTIVE
.STATE_RUNNING
,
getState()
public static final int STATE_ACTIVE
STATE_RUNNING
.STATE_RUNNING
,
STATE_RUNNING_TO_GROUP
,
getState()
public static final int STATE_SUSPENDED
getState()
,
suspend()
public static final int STATE_COMPLETED
getState()
public static final int STATE_TERMINATED
getState()
public static final java.lang.String DEFAULT_FORK_ID
IWorkItemPK.getForkId()
Method Detail |
public IWorkItemPK getPrimaryKey()
IWorkItemPK
public IProcessInstance getProcessInstance() throws PMException
PMException
- if there is a problem loading the process
instance.IProcessInstance
public java.util.Date getCreationDate()
public boolean isUserAssignee(IParticipant p) throws PMException
p
- a corporate directory usertrue
if the given user has been assigned
the work item; false
otherwise.PMException
- if there is problem resolving the assignee
list for this work item.IParticipant
public java.util.Enumeration assignees() throws PMException
IParticipant
and
IRole
objects.
for( Enumeration as = wi.assignees(); as.hasMoreElements(); ) { Object o = as.nextElement(); if( o instanceof IParticipant ) System.out.println( "User: " + ((IParticipant) o).getUserId() ); else if( o instanceof IRole ) System.out.println( "Role: " + ((IRole) o).getName() ); }
PMException
- if there is a problem resolving the assignee
list for this work item.IParticipant
,
IRole
public void addAssignee(IParticipant user) throws PMException
user
- a corporate directory userPMException
- if there is a problem resolving the assignee
list for this work item.addAssignee( IRole )
,
IParticipant
public void addAssignee(IRole role) throws PMException
By adding the specified role onto the current assignees list, all
of the current members of the given role are assigned the work item.
This is not the same however, as assigning the work item to each
member of the role using addAssignee( IParticipant )
since assigning to a role will properly resolve a role with a
dynamic membership list. For instance, if group A initially
contains users x and y, and user z is added
after the work item has been assigned to group A, user
z will be assigned the work item. Whereas explicitly assigning
the work item to users x and y will not assign the
work item to user z later on.
role
- a role defined in the current applicationPMException
- if there is a problem resolving the assignee
list for this work item.addAssignee( IParticipant )
,
IRole
public void removeAssignees() throws PMException
PMException
- if there is a problem resolving the assignee
list for this work item.public void expire() throws PMException
PMException
- if there is problem with invoking the
expiration handler script of the node.extend
public void extend(java.util.Date newDate)
This method may be invoked before a work item is expired. In this case, the work item's expiration date is set to a date further in the future.
newDate
- the work item's new expiration dateexpire
public void setExpirationDate(java.util.Date expDate)
expDate
- the work's item new expiration dateexpire()
,
extend(java.util.Date)
public java.util.Date getExpirationDate()
setExpirationDate(java.util.Date)
public boolean hasExpired()
expire
method has
been invoked on the current work item, as this method is the only
means of changing a work item's expiration flag to true.true
if the work item has already been
expired; false
otherwise.getExpirationDate()
,
expire()
public IProcessInstancePK getChildPrimaryKey()
IProcessInstancePK
,
IProcessInstance.getParentPrimaryKey()
public void suspend()
There is no effect by calling this method if the work item is already suspended.
STATE_SUSPENDED
,
resume()
public void resume() throws PMException
There is no effect by calling this method if the work item is not currently suspended.
PMException
- if there is a problem accessing the back-end
database where the work item is stored.STATE_RUNNING
,
STATE_RUNNING_TO_GROUP
,
STATE_ACTIVE
,
STATE_SUSPENDED
public int getState()
STATE_RUNNING
,
STATE_RUNNING_TO_GROUP
,
STATE_ACTIVE
,
STATE_SUSPENDED
,
STATE_COMPLETED
,
STATE_TERMINATED
,
#STATE_EXCEPTION
public void save() throws PMException
IProcessInstance
interface,
this method saves both the work item and the process instance. This
method should be used when the desired effect is to save any changes
made to the work item and not ask the engine to transition it to the
next activity. For example, delegating a work item or just changing
its state.PMException
- if there is a problem accessing the back-end
database where the work item is stored.IProcessInstance.save()
public void release(boolean commit) throws PMException
The effect this method will have on the work item depends upon two factors: the value of the commit parameter and whether the work item has been loaded for update or read-only.
commit | |||
---|---|---|---|
editable | T | F | |
T | commit | rollback | |
F | noop | noop |
Note: the IProcessInstance version of this method cannot be called in lieu of this method. Calling release from IProcessInstance will simply release database resources, while this version will cause newly generated workitems to be routed internally in the engine.
commit
- set to true
if want to commit
work item changes; otherwise false
to rollback changesPMException
- is a problem accessing the back-end
database where the work item is
stored.IProcessInstance.release(boolean)
public java.lang.String getClusterName()
IPMApplication
public java.lang.String getApplicationName()
IPMApplication
public INodeElement getNode() throws PMException
getTargetNode
will
return the node element that the work item originally failed at.PMException
- if there is a problem accessing the
application's process definition.getTargetNode()
,
INodeElement
public java.lang.String getComment()
setComment(java.lang.String)
,
IHistoryEvent.getComment()
,
IProcessInstance.getHistoryEvents()
public void setComment(java.lang.String comment)
comment
- a comment to include in the history loggetComment()
,
IHistoryEvent.getComment()
,
IProcessInstance.getHistoryEvents()
public INodeElement getTargetNode() throws PMException
This method only applies to work items that are in an exception state. If the work item is not in an exception state, this method will return null.
PMException
- if there is a problem accessing the
application's process definition.getNode()
,
INodeElement
public boolean isExceptionWorkItem()
true
if this work item is positioned at an
exception node; false
otherwise.getTargetNode()
public boolean hasSiblings() throws PMException
true
if the work item has sibling work items;
false
otherwise.PMException
- is a problem accessing the back-end
database where the work item is
stored.IWorkItemPK.getForkId()
public void deleteSiblings() throws PMException
A parallel block can be nested within another parallel block, thus if parallel block X is contained with parallel block Y, all work items contained in X are siblings to the work items in Y, but not vice versa.
By removing all of a work item's siblings, the process instance will be able to exit the current parallel block once this work item is complete.
PMException
- if there is a problem accessing the back-end
database where the work item is
stored.hasSiblings()
public java.lang.String getRedirectionURL()
setRedirectionURL
JavaScript method; in the Process Manager
UI layer, this value is used to redirect the user's browser to the
specified location.
This action is typically used for multiple screen data entry where the same person may enter data across several screens in a row (and also several user activities) within Process Manager. By doing this the process takes on a wizard like forms entry screen. To accomplish this specific example, the completion steps of each user activity needs to redirect the user's browser to the same process instance.
public java.lang.String getErrorMessage()
setErrorMessage
JavaScript method; in the Process Manager
UI layer, this value is used to provide additional context for error
messages displayed to end-users via the browser.public void setConclusion(ITransition action)
action
- a transition element extending from the current
nodegetConclusion()
,
ITransition
public ITransition getConclusion()
setConclusion(com.netscape.pm.model.ITransition)
,
ITransition
public boolean isAutomated()
true
if the node the work item is positioned
at is automated; false
otherwise.INodeElement.isAutomated()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |