|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
The access point for worklists, searchlists (lists of work items queried from the search pages) and lists of process instances. The IFinder object is currently available from the IPMCluster bean interface.
The finder will return two types of objects:
IWorkItem
objects, and
IProcessInstance
objects.
IPMApplication
interface do.
The only difference is that work items and process instances fetched from
the finder are retrieved for read-only. If any modifications need to be
made to a work item, for instance, it must be retrieved from the application
bean interface instead.
javax.naming.Context cxt = new javax.naming.InitialContext(); String jndiName = "java:comp/env/" + IPMClusterManager.JNDI_ROOT; IPMClusterManagerHome home = (IPMClusterManagerHome) cxt.lookup( jndiName ); IPMClusterManager clusterManager = home.create(); IPMCluster cluster = clusterManager.getCluster( IPMCluster.DEFAULT ); ICorporateDirectory cd = cluster.getCorporateDirectory(); IParticipant u = cd.getUserById( "joe" ); IFinder f = cluster.getFinder(); Vector result = f.findWorkItems( u, IFinder.SORT_ID_ASC ); for( Enumeration e = result.elements(); e.hasMoreElements(); ) { IWorkItem wi = (IWorkItem) e.nextElement(); // do stuff with work item }
IPMCluster
,
IProcessInstance
,
IWorkItem
Field Summary | |
static int |
SORT_ACTIVITY_ASC
Query sorting indicator for ascending work item node name sorting. |
static int |
SORT_ACTIVITY_DESC
Query sorting indicator for descending work item node name sorting. |
static int |
SORT_APPLICATION_ASC
Query sorting indicator for ascending application name sorting. |
static int |
SORT_APPLICATION_DESC
Query sorting indicator for descending application name sorting. |
static int |
SORT_EXPIRATION_ASC
Query sorting indicator for ascending work item expiration date sorting. |
static int |
SORT_EXPIRATION_DESC
Query sorting indicator for descending work item expiration date sorting. |
static int |
SORT_ID_ASC
Query sorting indicator for ascending instance id sorting. |
static int |
SORT_ID_DESC
Query sorting indicator for descending instance id sorting. |
static int |
SORT_PRIORITY_ASC
Query sorting indicator for ascending process instance priority sorting. |
static int |
SORT_PRIORITY_DESC
Query sorting indicator for descending process instance priority sorting. |
static int |
SORT_TITLE_ASC
Query sorting indicator for ascending process instance title sorting. |
static int |
SORT_TITLE_DESC
Query sorting indicator for descending process instance title sorting. |
Method Summary | |
java.util.SortedMap |
findApplicationInstances(java.lang.String appName,
java.lang.String viewName,
java.lang.String condition,
java.util.Vector params,
int sortedBy)
Returns a list of process instances, belonging to a particular application, fetched using a given SQL condition. |
java.util.Vector |
findDeferredAutomatedActivities()
Returns a list of work items that are deferred. |
java.util.Vector |
findExpiredWorkItems()
Returns a list of work items to be expired. |
java.util.SortedMap |
findMyInstances(IParticipant u,
java.util.Date from,
java.util.Date to,
int sortedBy)
Returns a list of the process instances that were initiated by the given user between the given start and end dates. |
java.util.SortedMap |
findMyInstances(IParticipant u,
int sortedBy)
Returns a list of process instances that were initiated by the given user and are still open. |
java.util.SortedMap |
findMyInstances(IParticipant u,
int nbrInstances,
int sortedBy)
Returns a list of the last nbrInstances process instances
that were initiated by the given user. |
java.lang.String |
findProcessInstanceApplication(IProcessInstancePK pk)
Returns the name of the application the process instance belongs to. |
java.util.Vector |
findProcessInstances(java.lang.String condition,
java.util.Vector params,
int sortedBy)
Returns a list of process instances fetched using a given SQL condition. |
java.util.Vector |
findStrandedWorkItems()
Returns a list of work items that are stranded. |
java.util.Vector |
findWorkItem(IWorkItemPK wiPK)
Returns a workitem for a given work item primary key |
java.util.Vector |
findWorkItems(IParticipant u,
int sortedBy)
Returns a list of work items that belong to the current authenticated user, that is a user's worklist. |
java.util.Vector |
findWorkItems(IParticipant u,
int sortedBy,
int pageNo,
int pageSize)
Returns a list of work items that belong to the current authenticated user, that is a user's worklist. |
java.util.Vector |
findWorkItems(IProcessInstancePK pk)
Returns a list of work items that belong to the specified process instance. |
java.util.Vector |
findWorkItems(java.lang.String condition,
java.util.Vector params,
int sortedBy)
Returns a list of work items fetched using a given SQL condition. |
int |
getCurrentPageNo()
Returns the current page being displayed. |
int |
getTotalRows()
Returns the total number of rows retrieved from the database. |
Field Detail |
public static final int SORT_ID_ASC
sortedBy
parameter will attempt to sort
their results by ascending instance id values if applicable.SORT_ID_DESC
,
IProcessInstance.getInstanceId()
public static final int SORT_ID_DESC
sortedBy
parameter will attempt to sort
their results by descending instance id values if applicable.SORT_ID_ASC
,
IProcessInstance.getInstanceId()
public static final int SORT_TITLE_ASC
sortedBy
parameter will attempt
to sort their results by ascending process instance title values if
applicable.SORT_TITLE_DESC
,
IProcessInstance.getTitle()
public static final int SORT_TITLE_DESC
sortedBy
parameter will attempt
to sort their results by descending process instance title values if
applicable.SORT_TITLE_ASC
,
IProcessInstance.getTitle()
public static final int SORT_APPLICATION_ASC
sortedBy
parameter will attempt
to sort their results by ascending application name values if
applicable.SORT_APPLICATION_DESC
,
IProcessInstance.getApplicationName()
public static final int SORT_APPLICATION_DESC
sortedBy
parameter will attempt
to sort their results by descending application name values if
applicable.SORT_APPLICATION_ASC
,
IProcessInstance.getApplicationName()
public static final int SORT_PRIORITY_ASC
sortedBy
parameter
will attempt to sort their results by ascending process instance
priority values if applicable.SORT_PRIORITY_DESC
,
IProcessInstance.getPriority()
public static final int SORT_PRIORITY_DESC
sortedBy
parameter
will attempt to sort their results by descending process instance
priority values if applicable.SORT_PRIORITY_ASC
,
IProcessInstance.getPriority()
public static final int SORT_EXPIRATION_ASC
sortedBy
parameter
will attempt to sort their results by ascending work item expiration
date values if applicable.SORT_EXPIRATION_DESC
,
IWorkItem.getExpirationDate()
public static final int SORT_EXPIRATION_DESC
sortedBy
parameter
will attempt to sort their results by descending work item expiration
date values if applicable.SORT_EXPIRATION_ASC
,
IWorkItem.getExpirationDate()
public static final int SORT_ACTIVITY_ASC
sortedBy
parameter will
attempt to sort their results by ascending work item node name values
if applicable.SORT_ACTIVITY_DESC
,
IWorkItemPK.getNodeName()
public static final int SORT_ACTIVITY_DESC
sortedBy
parameter will
attempt to sort their results by descending work item node name values
if applicable.SORT_ACTIVITY_ASC
,
IWorkItemPK.getNodeName()
Method Detail |
public java.util.Vector findWorkItems(IParticipant u, int sortedBy) throws PMException
IWorkItem
objects.
The applicable values for the sortedBy
parameters are:
u
- the authenticated user for the current sessionsortedBy
- the sorting method to use for the results,
by default no sorting is performedPMException
- if there is a problem with retrieving the
work items from the back-end database.SORT_ID_ASC
,
SORT_ID_DESC
,
SORT_TITLE_ASC
,
SORT_TITLE_DESC
,
SORT_APPLICATION_ASC
,
SORT_APPLICATION_DESC
,
SORT_PRIORITY_ASC
,
SORT_PRIORITY_DESC
,
SORT_EXPIRATION_ASC
,
SORT_EXPIRATION_DESC
,
SORT_ACTIVITY_ASC
,
SORT_ACTIVITY_DESC
,
IWorkItem
public java.util.Vector findWorkItems(IParticipant u, int sortedBy, int pageNo, int pageSize) throws PMException
IWorkItem
objects.
While the other variant of this method -
findWorkItems( IParticipant, int )
- will return all the
work items belonging to the user, this method can allow the user to
only retrieve a subset of all the work items assigned to them. The
split worklist functionality found on the Express UI uses this
method to retrieve pages of work items. The pageNo
parameter allows the user to specify which page of work items
they wish returned; the pageSize
parameter is used to
specify how many work items constitute a page. If the
pageNo
parameter is less than 0, it is defaulted to 1; if
the pageSize
parameter is less than 0, it is defaulted to
100.
In most cases, front-end client users will want to know the total
number of work items that would have been retrieved from the worklist
without the paging mechanism in place. The method
getTotalRows
has been added for this purpose.
Additionally, the current page number can be retrieved via
getCurrentPageNo
; the current page will not match the
pageNo
parameter if the total number of pages is less than
the value of the page parameter.
The applicable values for the sortedBy
parameters are:
u
- the authenticated user for the current sessionsortedBy
- the sorting method to use for the results,
by default no sorting is performedpageNo
- the page number to retrievepageSize
- the size of a page in work itemsPMException
- if there is a problem with retrieving the
work items from the back-end database.SORT_ID_ASC
,
SORT_ID_DESC
,
SORT_TITLE_ASC
,
SORT_TITLE_DESC
,
SORT_APPLICATION_ASC
,
SORT_APPLICATION_DESC
,
SORT_PRIORITY_ASC
,
SORT_PRIORITY_DESC
,
SORT_EXPIRATION_ASC
,
SORT_EXPIRATION_DESC
,
SORT_ACTIVITY_ASC
,
SORT_ACTIVITY_DESC
,
getTotalRows()
,
getCurrentPageNo()
,
IWorkItem
public java.util.Vector findWorkItems(IProcessInstancePK pk) throws PMException
IWorkItem
objects.
The returned list will include user assigned work items (that is, work items positioned at user activities) and automated work items (that is, work items positioned at automated nodes that are assigned to the engine). The latter type of work item will most likely be deferred work items at automated nodes.
pk
- a process instance keyPMException
- if there is a problem with retrieving the
work items from the back-end database.IProcessInstancePK
,
IWorkItem
public java.util.Vector findWorkItems(java.lang.String condition, java.util.Vector params, int sortedBy) throws PMException
IWorkItem
objects.
This method is used internally by the Process Manager engine and
administrator to retrieve a particular set of work items according
to a variable set of conditions. The condition
parameter
provides the where portion of the SQL query and should be
formatted in the manner java.sql.PreparedStatement query strings are.
The params
parameter provides the IN parameter values
the query must specify for the input parameters defined in the
condition
string.
String condition = " wf_instance_id = ? AND " + " wf_fork_id = ? AND " + " wf_node_cn = ? AND " + " wf_user_dn = ? "; Vector params = new Vector(); params.addElement( new Integer( 100 ) ); // wf_instance_id params.addElement( new String( "0" ) ); // wf_fork_id params.addElement( new String( "Activity1" ) ); // wf_node_cn params.addElement( new String( "joe" ) ); // wf_user_dn Vector result = finder.findWorkItems( condition, params, IFinder.SORT_ID_ASC );
The elements in the params
list must have type that is
compatible with the defined SQL type of the input parameter. For
instance, the wf_instance_id IN parameter has SQL type Integer,
hence the first params
parameter must have type Integer.
This method should be used sparingly - database columns names must be used to construct the condition and the database schema may change in future releases.
The applicable values for the sortedBy
parameters are:
condition
- a SQL condition in PreparedStatement formatparams
- a list of IN parameter valuessortedBy
- the sorting method to use for the results,
by default no sorting is performedPMException
- if there is a problem with retrieving the
work items from the back-end database.SORT_ID_ASC
,
SORT_ID_DESC
,
SORT_TITLE_ASC
,
SORT_TITLE_DESC
,
SORT_APPLICATION_ASC
,
SORT_APPLICATION_DESC
,
SORT_PRIORITY_ASC
,
SORT_PRIORITY_DESC
,
SORT_EXPIRATION_ASC
,
SORT_EXPIRATION_DESC
public java.util.Vector findWorkItem(IWorkItemPK wiPK) throws PMException
wiPK
- the work item primary KeyPMException
- if there is a problem with retrieving the
work items from the back-end database.IWorkItem
public java.util.Vector findExpiredWorkItems() throws PMException
IWorkItem
method
hasExpired
.PMException
- if there is a problem with retrieving the
work items from the back-end database.IWorkItem
public java.util.Vector findDeferredAutomatedActivities() throws PMException
PMException
- if there is a problem with retrieving the
work items from the back-end database.IWorkItem
,
INodeElement.isDeferred()
public java.util.Vector findStrandedWorkItems() throws PMException
This method is used by the engine to find any work items that may have been lost due to internal problems and retry them.
PMException
- if there is a problem with retrieving the
work items from the back-end database.IWorkItem
public java.util.SortedMap findMyInstances(IParticipant u, int sortedBy) throws PMException
java.util.SortedMap
with the process instances as
keys and a java.util.Vector
of work items belonging to
each process instance as the value associated with each process
instance key.
The applicable values for the sortedBy
parameters are:
u
- the authenticated user for the current sessionsortedBy
- the sorting method to use for the results
by default no sorting is performedPMException
- if there is a problem with retrieving the
process instances from the back-end database.SORT_ID_ASC
,
SORT_ID_DESC
,
SORT_TITLE_ASC
,
SORT_TITLE_DESC
,
SORT_APPLICATION_ASC
,
SORT_APPLICATION_DESC
,
SORT_PRIORITY_ASC
,
SORT_PRIORITY_DESC
,
IParticipant
,
IProcessInstance
,
IWorkItem
public java.util.SortedMap findMyInstances(IParticipant u, int nbrInstances, int sortedBy) throws PMException
nbrInstances
process instances
that were initiated by the given user. This list includes both
process instances that are still open and those that have been
completed. The returned list is formatted as a
java.util.SortedMap
with the process instances as
keys and a java.util.Vector
of work items belonging to
each process instance as the value associated with each process
instance key.
The applicable values for the sortedBy
parameters are:
u
- the authenticated user for the current sessionnbrInstances
- the number of instances to returnsortedBy
- the sorting method to use for the results
by default no sorting is performedPMException
- if there is a problem with retrieving the
process instances from the back-end database.SORT_ID_ASC
,
SORT_ID_DESC
,
SORT_TITLE_ASC
,
SORT_TITLE_DESC
,
SORT_APPLICATION_ASC
,
SORT_APPLICATION_DESC
,
SORT_PRIORITY_ASC
,
SORT_PRIORITY_DESC
,
IParticipant
,
IProcessInstance
,
IWorkItem
public java.util.SortedMap findMyInstances(IParticipant u, java.util.Date from, java.util.Date to, int sortedBy) throws PMException
java.util.SortedMap
with the process instances as
keys and a java.util.Vector
of work items belonging to
each process instance as the value associated with each process
instance key.
If either the start or end dates are null, the search will not be
bound at the respective end points. The search is not inclusive with
respect to the given start and end dates; hence if the start date is
Jan 1, 2000 00:00:00
, the search will not return process
instances that were initiated exactly at Jan 1, 2000
00:00:00
.
The applicable values for the sortedBy
parameters are:
u
- the authenticated user for the current sessionfrom
- the start dateto
- the end datesortedBy
- the sorting method to use for the results
by default no sorting is performedPMException
- if there is a problem with retrieving the
process instances from the back-end database.SORT_ID_ASC
,
SORT_ID_DESC
,
SORT_TITLE_ASC
,
SORT_TITLE_DESC
,
SORT_APPLICATION_ASC
,
SORT_APPLICATION_DESC
,
SORT_PRIORITY_ASC
,
SORT_PRIORITY_DESC
,
IParticipant
,
IProcessInstance
,
IWorkItem
public java.util.SortedMap findApplicationInstances(java.lang.String appName, java.lang.String viewName, java.lang.String condition, java.util.Vector params, int sortedBy) throws PMException
java.util.SortedMap
with the process
instances as keys and a java.util.Vector
of work items
belonging to each process instance as the value associated with each
process instance key.
This method is used by the Process Manager engine to provide the
application search functionality seen from the Express UI. The
condition
parameter provides the where portion
of the SQL query and should be formatted in the manner
java.sql.PreparedStatement
query strings are.
The params
parameter provides the IN parameter values
the query must specify for the input parameters defined in the
condition
string.
String condition = " name = ? AND " + " manager = ? AND " + " price = ? "; SortedMap params = new Vector(); params.addElement( new String( "joe" ) ); // name params.addElement( new String( "bob" ) ); // manager params.addElement( new Float( 100.02 ) ); // price SortedMap result = finder.findApplicationInstances( "myApp", "myApp_vw", condition, params, IFinder.SORT_ID_ASC );
The elements in the params
list must have type that is
compatible with the defined SQL type of the input parameter. For
instance, the wf_instance_id IN parameter has SQL type Integer,
hence the first params
parameter must have type Integer.
The applicable values for the sortedBy
parameters are:
appName
- the name of the applicationviewName
- the name of the application's viewcondition
- a SQL condition in PreparedStatement formatparams
- a list of IN parameter valuessortedBy
- the sorting method to use for the results,
by default no sorting is performedPMException
- if there is a problem with retrieving the
process instances from the back-end database.SORT_ID_ASC
,
SORT_ID_DESC
,
SORT_TITLE_ASC
,
SORT_TITLE_DESC
,
SORT_PRIORITY_ASC
,
SORT_PRIORITY_DESC
,
IProcessInstance
,
IWorkItem
public java.util.Vector findProcessInstances(java.lang.String condition, java.util.Vector params, int sortedBy) throws PMException
IProcessInstance
objects.
This method is used internally by the Process Manager engine and
administrator to retrieve a particular set of process instances according
to a variable set of conditions. The condition
parameter
provides the where portion of the SQL query and should be
formatted in the manner java.sql.PreparedStatement query strings are.
The params
parameter provides the IN parameter values
the query must specify for the input parameters defined in the
condition
string.
String condition = " wf_instance_id = ? AND " Vector params = new Vector(); params.addElement( new Integer( 100 ) ); // wf_instance_id Vector result = finder.findProcessInstances( condition, params, IFinder.SORT_ID_ASC );
The elements in the params
list must have type that is
compatible with the defined SQL type of the input parameter. For
instance, the wf_instance_id IN parameter has SQL type Integer,
hence the first params
parameter must have type Integer.
This method should be used sparingly - database columns names must be used to construct the condition and the database schema may change in future releases.
The applicable values for the sortedBy
parameters are:
condition
- a SQL condition in PreparedStatement formatparams
- a list of IN parameter valuessortedBy
- the sorting method to use for the results,
by default no sorting is performedPMException
- if there is a problem with retrieving the
work items from the back-end database.SORT_ID_ASC
,
SORT_ID_DESC
,
SORT_TITLE_ASC
,
SORT_TITLE_DESC
,
SORT_APPLICATION_ASC
,
SORT_APPLICATION_DESC
,
SORT_PRIORITY_ASC
,
SORT_PRIORITY_DESC
,
SORT_EXPIRATION_ASC
,
SORT_EXPIRATION_DESC
public java.lang.String findProcessInstanceApplication(IProcessInstancePK pk) throws PMException
pk
- a process instance keyPMException
- if there is a problem with retrieving the
work items from the back-end database.IProcessInstancePK
public int getTotalRows()
findWorkItems( IParticipant, int, int, int )
method has been invoked (that is, the split worklist method).
In most cases, front-end client users will want to know the total number of work items that would have been retrieved from the worklist without the paging mechanism in place. This method can be used for that purpose.
findWorkItems( IParticipant, int, int, int )
public int getCurrentPageNo()
findWorkItems( IParticipant, int, int, int )
method
has been invoked (that is, the split worklist method).
This method should be used to verify the current page being returned
to the user from findWorkItems( IParticipant, int, int,
int )
since the current page will not match the
pageNo
parameter passed to findWorkItems
if the total number of pages is less than the value of the
pageNo
parameter.
findWorkItems( IParticipant, int, int, int )
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |