|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Provides an access point for updatable process instances and work items. The methods off the application bean allow the user to initiate and edit process instances associated with the application. Additionally, this interface also provides methods to retrieve the application's definition and deployment parameters.
Process instances and work items may be retrieved via the
IFinder
interface, however only for read-only. The
application bean interface is the only means of retrieving a process
instance for update.
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 ); IPMApplication app = cluster.getApplication( "myApp" ); IProcessDefinition pd = app.getProcessDefinition(); INodeElement entryNode = pd.getProcessMap() .getNodeElement( "EntryPoint1" ); ITransition conclusion = entryNode.getTransition( "Action1" ); IWorkItem wi = app.initiateProcessInstance( entryNode ); IProcessInstance pi = wi.getProcessInstance(); IPMRequest req = PMRequestFactory.create( httpServletRequest ); IFormElement entryForm = pd.getFormDictionary() .getFormElement( "EntryForm" ); for( Enumeration e = entryForm.editables(); e.hasMoreElements(); ) { IPresentationElement ipe = (IPresentationElement) e.nextElement(); ipe.update( pi, req ); } wi.setConclusion( conclusion ); app.execute( wi ); wi.release( true );
IPMCluster
,
IPMApplicationHome
,
IProcessDefinition
,
IProcessInstance
,
IProcessInstancePK
,
IWorkItem
,
IWorkItemPK
,
EJBObject
,
Remote
Field Summary | |
static java.lang.String |
DEFAULT_JNDI_ROOT
The application bean prefix to use when constructing the JNDI name to use for looking up the application bean home. |
static int |
LOG_ERROR
Log type value for an error log message. |
static int |
LOG_INFORMATION
Log type value for an informational log message. |
static int |
LOG_SECURITY
Log type value for an security log message. |
Method Summary | |
java.util.Enumeration |
execute(IWorkItem wi)
Executes a series of actions required for the specified workitem. |
boolean |
existsImage()
Returns true if the application has been deployed with a copy of its process map image. |
IProcessInstance |
findProcessInstance(IProcessInstancePK pk)
Returns the process instance matching the given key parameters. |
IWorkItem |
findWorkItem(IWorkItemPK pk)
Returns the work item matching the given key parameters. |
IPMCluster |
getCluster()
Returns the cluster bean associated with this application. |
java.lang.String |
getClusterName()
Returns the name of the cluster to which this application belongs to. |
java.sql.Connection |
getConnection()
Returns a connection to the Process Manager database. |
IDeploymentDescriptor |
getDeploymentDescriptor()
Returns the deployment descriptor associated with this application. |
java.lang.String |
getHomePath()
Returns the absolute path name for the application's installation directory. |
java.lang.String |
getImageFileName()
Returns the name of the application's process map image file. |
java.util.Vector |
getLog(int logType,
int size)
Returns the contents of an application log file. |
java.lang.String |
getPageDataModel()
Returns a string (in the format of a JavaScript hashtable definition) of the properties of the application. |
IProcessDefinition |
getProcessDefinition()
Returns the process definition associated with this application. |
IWorkItem |
initiateProcessInstance(INodeElement entryNode)
Initiates a new process instance at a particular entry point node. |
void |
log(java.lang.Exception e)
Logs an exception to the error log of the application. |
void |
log(int logType,
java.lang.String msg,
java.util.Hashtable context)
Logs a message to an application log file. |
java.util.Enumeration |
moveTo(IWorkItem wi,
INodeElement targetNode)
Moves the work item to the specified node. |
Methods inherited from interface javax.ejb.EJBObject |
getEJBHome, getHandle, getPrimaryKey, isIdentical, remove |
Field Detail |
public static final java.lang.String DEFAULT_JNDI_ROOT
// 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();
public static final int LOG_INFORMATION
log( int, String, Hashtable )
public static final int LOG_ERROR
log( int, String, Hashtable )
public static final int LOG_SECURITY
log( int, String, Hashtable )
Method Detail |
public IWorkItem findWorkItem(IWorkItemPK pk) throws PMException, java.rmi.RemoteException
assignee | admin | ? | |
---|---|---|---|
for update | OK | OK | NO |
view only | OK | OK | OK |
If the current principal is neither the assignee nor an administrator (as specified by the cluster) then the only permitted access is read-only.
pk
- a work item primary keyPMException
- if the work item cannot be found or there is
a problem loading the work item from the
back-end database.java.rmi.RemoteException
- if there is an RMI-related problem.IWorkItem
,
IWorkItemPK.setEditable(boolean)
public IProcessInstance findProcessInstance(IProcessInstancePK pk) throws PMException, java.rmi.RemoteException
admin | ? | |
---|---|---|
for update | OK | NO |
view only | OK | OK |
If the current principal is not an administrator (as specified by the
cluster) then the only permitted access is read-only. If the user
wants to edit the process instance, a handle must be retrieved via
the getProcessInstance
method from the work item.
pk
- a process instance primary keyPMException
- if the process instance cannot be found or
there is a problem loading the process
instance from the back-end database.java.rmi.RemoteException
- if there is an RMI-related problem.IProcessInstance
,
IProcessInstancePK
public IWorkItem initiateProcessInstance(INodeElement entryNode) throws PMException, java.rmi.RemoteException
en
- an entry point nodePMException
- if the process instance cannot be initiated
at the given entry point node.java.rmi.RemoteException
- if there is an RMI-related problem.INodeElement
,
IWorkItem
public java.util.Enumeration execute(IWorkItem wi) throws PMException, java.rmi.RemoteException
save
method should be called on the work item object.
This method will return an enumeration of IWorkItemPK
s
for the next set of work items generated as a result of completing
the given work item.
Note: users must call the release
method on the work item object, not only to release any resources
obtained throughout the servicing of the request but also to
trigger the routing of any new work items created as a result of
this call.
for( Enumeration nextWIs = app.execute( wi ); nextWIs.hasMoreElements(); ) { IWorkItemPK pk = (IWorkItemPK) nextWIs.nextElement(); System.out.println( "Next workitem in line : " + pk ); }
wi
- the current work itemPMException
- if there is problem executing the work item
during any execution stage.java.rmi.RemoteException
- if there is an RMI-related problem.INodeElement.EXECUTION_STAGE_MANAGE
,
INodeElement.EXECUTION_STAGE_PERFORM
,
INodeElement.EXECUTION_STAGE_VERIFY
,
INodeElement.EXECUTION_STAGE_COMPLETE
,
IWorkItem
public java.util.Enumeration moveTo(IWorkItem wi, INodeElement targetNode) throws PMException, java.rmi.RemoteException
Additionally, if the work item is positioned at an exception node, the work item cannot be move to any other node. It is possible to move the work item to the same node it is currently positioned at however.
This method will return an enumeration of IWorkItemPK
s
for the next set of work items generated as a result of moving the
given work item to the specified node.
wi
- the current work itemtargetNode
- the node to move the work item toPMException
- if the work item cannot be moved to the
specified node.java.rmi.RemoteException
- if there is an RMI-related problem.INodeElement
,
IWorkItem
public java.lang.String getPageDataModel() throws PMException, java.rmi.RemoteException
PMException
- if there is a problem initializing the
application.java.rmi.RemoteException
- if there is an RMI-related problem.public java.sql.Connection getConnection() throws PMException, java.rmi.RemoteException
PMException
- if there is a problem initializing the
application.java.rmi.RemoteException
- if there is an RMI-related problem.Connection
public IProcessDefinition getProcessDefinition() throws PMException, java.rmi.RemoteException
PMException
- if there is a problem initializing the
application.java.rmi.RemoteException
- if there is an RMI-related problem.IProcessDefinition
public IPMCluster getCluster() throws PMException, java.rmi.RemoteException
PMException
- if there is a problem initializing the
application.java.rmi.RemoteException
- if there is an RMI-related problem.IPMCluster
public java.lang.String getClusterName() throws PMException, java.rmi.RemoteException
PMException
- if there is a problem initializing the
application.java.rmi.RemoteException
- if there is an RMI-related problem.IPMCluster
public IDeploymentDescriptor getDeploymentDescriptor() throws PMException, java.rmi.RemoteException
PMException
- if there is a problem initializing the
application.java.rmi.RemoteException
- if there is an RMI-related problem.IPMCluster
,
IDeploymentDescriptor
public java.lang.String getHomePath() throws java.rmi.RemoteException, PMException
D:\netscape\server4\bpm
, the application path for
the application ClaimProcess would be
D:\netscape\server4\bpm\applications\ClaimProcess
.PMException
- if there is a problem initializing the
application.java.rmi.RemoteException
- if there is an RMI-related problem.public void log(java.lang.Exception e) throws PMException, java.rmi.RemoteException
PMException
,
getExceptionType
, and
toHTML
.
java.lang.Exception
,
PMException.EXCEPTION_TYPE_ERROR
,
and
e
- a java.lang.Exception to logPMException
- if there is a problem writing to the
application log file.java.rmi.RemoteException
- if there is an RMI-related problem.#log( String, String, Hashtable )
public void log(int logType, java.lang.String msg, java.util.Hashtable context) throws PMException, java.rmi.RemoteException
LOG_INFORMATION
- an informational message
LOG_ERROR
- an error message
LOG_SECURITY
- a security-related message
The msg
parameter specifies the message to be written
to the log; the context is an optional object containing key/value
pairs of additional contextual information associated with the log
message that may be of use when viewing the entry.
The resulting log entry, when viewed from the Administrator UI, will resemble:
[Fri Oct 22 20:00:31 CDT 1999] PAGE_COUNT_TOO_LONG ------------ author : Ima Writer ------------ docName : PM Programmer's Guide ------------ pageCount : 7450
logType
- the type of the log message, can be one of:
LOG_INFORMATION
LOG_ERROR
LOG_SECURITY
msg
- the message to be written to the logcontext
- contains additional contextual infoPMException
- if there is a problem writing to the
application log file.java.rmi.RemoteException
- if there is an RMI-related problem.LOG_INFORMATION
,
LOG_ERROR
,
LOG_SECURITY
,
log( java.lang.Exception )
public java.util.Vector getLog(int logType, int size) throws PMException, java.rmi.RemoteException
size
parameter.
The returned list will contain log entries in ascending chronological order, that is the most recent log entries will be found at the end of the java.util.Vector.
logType
- the type of the log file to retrieve, can
be one of:
LOG_INFORMATION
LOG_ERROR
LOG_SECURITY
size
- the maximum number of entries to returnPMException
- if there is a problem reading the
application log file.java.rmi.RemoteException
- if there is an RMI-related problem.LOG_INFORMATION
,
LOG_ERROR
,
LOG_SECURITY
,
log( java.lang.Exception )
,
#log( String, String, java.util.Hashtable )
public boolean existsImage() throws PMException, java.rmi.RemoteException
true
if the application has been deployed
with a copy of its process map image; false
otherwise.PMException
- if there is a problem initializing the
application.java.rmi.RemoteException
- if there is an RMI-related problem.public java.lang.String getImageFileName() throws PMException, java.rmi.RemoteException
PMException
- if there is a problem initializing the
application, or if there is no process
map image found.java.rmi.RemoteException
- if there is an RMI-related problem.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |