![]() |
![]() |
|
|
Monitoring Run-Time Workflow Instances
This section describes how to monitor run-time workflow instances, including the following topics:
For information about monitoring run-time workflow instances using the WebLogic Integration Studio, see Monitoring Workflows in Using the WebLogic Integration Studio.
Getting Workflow Instances
To get a list of template and template definition instances in an organization, use the following com.bea.wlpi.server.admin.Admin methods, respectively.
Method 1
public java.util.List getTemplateInstances(
java.lang.String templateId,
java.lang.String orgID,
boolean bStarted,
java.util.Date from,
java.util.Date to,
int start,
int max
) throws java.rmi.RemoteException,
com.bea.wlpi.common.WorkflowException
Method 2
public java.util.List getTemplateDefinitionInstances(
java.lang.String templateDefinitionId,
java.lang.String orgID,
boolean bStarted,
java.util.Date from,
java.util.Date to,
int start,
int max
) throws java.rmi.RemoteException,
com.bea.wlpi.common.WorkflowException
The following table describes the getTemplateInstances() and getTemplateDefinitionInstances() method parameters for which you must specify values.
Table 22-1 getTemplateInstances() and getTemplateDefinitionInstances() Method Parameters
These methods return a list of com.bea.wlpi.common.InstanceInfo objects corresponding to the template and template definition instances, respectively. To access information about each instance, use the InstanceInfo object methods described in InstanceInfo Object.
For example, the following code gets all template and template definition instances, respectively, corresponding to the specified ID value, for the organization specified by the value of the activeOrgId variable. In this example, admin represents the EJBObject reference to the Admin EJB.
List tempinst = admin.getTemplateInstances(templateId,
activeOrgId, true, dateFrom, dateTo, 20, 20);
List tempdefinst = admin.getTemplateDefinitionInstances(
templatedefId, activeOrgId, true, dateFrom,
dateTo, 20, 20);
In the examples, the following parameters are set:
For more information about the getTemplateInstances() and getTemplateDefinitionInstances() methods, see the com.bea.wlpi.server.admin.Admin Javadoc.
Checking for Workflow Instances
This section describes the methods that you can use to check for a workflow template or template definition instance.
Checking for a Workflow Template Instance
To check for a workflow template instance, use the following com.bea.wlpi.server.admin.Admin method:
public boolean checkForTemplateInstances(
java.lang.String templateId
) throws java.rmi.RemoteException,
com.bea.wlpi.common.WorkflowException
The following table describes the checkForTemplateInstances() method parameter for which you must specify a value.
Table 22-2 checkForTemplateInstances() Method Parameter
The method returns a Boolean value indicating whether or not a template instance exists.
For example, the following code checks whether or not any template instances exist, respectively, corresponding to the specified ID value. admin represents the EJBObject reference to the Admin EJB.
boolean tempexists = admin.checkForTemplateInstances(templateId);
For more information about the checkForTemplateInstance() method, see the com.bea.wlpi.server.admin.Admin Javadoc.
Checking for a Workflow Template Definition
To check for a workflow template definition instance, use the following com.bea.wlpi.server.admin.Admin method:
public java.util.List getTemplateDefinitionInstances(
java.lang.String templateDefinitionId
) throws java.rmi.RemoteException,
com.bea.wlpi.common.WorkflowException
The following table describes the getTemplateDefinitionInstances() method parameter for which you must specify a value.
Table 22-3 checkForTemplateInstances() Method Parameter
The method returns a Boolean value indicating whether or not a template or template definition instance exists.
For example, the following code checks whether or not any template definition instances exist corresponding to the specified ID value. In this example, admin represents the EJBObject reference to the Admin EJB.
boolean tempexists = admin.checkForTemplateInstances(templateId);
boolean tempdefexists = admin.checkForTemplateDefinitionInstances(
templateDefinitionId);
For more information about the checkForTemplateDefinitionInstances() method, see the com.bea.wlpi.server.admin.Admin Javadoc.
Getting Workflow Instance Tasks
To get a list of tasks in a workflow instance, use the following com.bea.wlpi.server.admin.Admin method:
public java.util.List getInstanceTasks(
java.lang.String instanceId
) throws java.rmi.RemoteException,
com.bea.wlpi.common.WorkflowException
The following table describes the getInstanceTasks() method parameter for which you must specify a value.
Table 22-4 getInstanceTasks() Method Parameter
The method returns a list of com.bea.wlpi.common.TaskInfo objects. To access information about each task, use the TaskInfo object methods described in TaskInfo Object.
For example, the following code gets the tasks for the workflow instance specified by the value of the instanceId variable. admin represents the EJBObject reference to the Admin EJB.
List tasks = admin.getInstanceTasks(instanceId);
For more information about the getInstanceTasks() method, see the com.bea.wlpi.server.admin.Admin Javadoc.
Deleting Workflow Instances
Using the methods described in this section, you can delete:
Deleting a Specific Workflow Instance
To delete a specific workflow instance, use the following com.bea.wlpi.server.admin.Admin method:
public void deleteInstance(
java.lang.String instanceId
) throws java.rmi.RemoteException,
com.bea.wlpi.common.WorkflowException
The following table describes the deleteInstance() method parameter for which you must specify a value.
Table 22-5 deleteInstance() Method Parameter
For example, the following code deletes the instance specified by instanceId. In this example, admin represents the EJBObject reference to the Admin EJB.
admin.deleteInstance(instanceId);
Deleting All Instances of a Workflow Template or Template Definition
To delete instances of a workflow template or template definition in an organization, use the following com.bea.wlpi.server.admin.Admin methods, respectively.
Method 1
public void deleteTemplateInstances(
java.lang.String templateId,
java.lang.String orgID,
boolean bStarted,
java.util.Date from,
java.util.Date to
) throws java.rmi.RemoteException,
com.bea.wlpi.common.WorkflowException
Method 2
public void deleteTemplateDefinitionInstances(
java.lang.String templateDefinitionId,
java.lang.String orgID,
boolean bStarted,
java.util.Date from,
java.util.Date to
) throws java.rmi.RemoteException,
com.bea.wlpi.common.WorkflowException
The following table describes the deleteTemplateInstances() and deleteTemplateDefinitionInstances() method parameters for which you must specify values.
Table 22-6 deleteTemplateInstances() and deleteTemplateDefinitionInstances() Method Parameters
For example, the following code deletes all template instances or template definition instances, respectively, corresponding to the specified ID value, and for the organization specified by value of the activeOrgId variable. In this example:
In the following example, admin represents the EJBObject reference to the Admin EJB.
admin.deleteTemplateInstances(templateId, activeOrgId, true,
dateFrom, dateTo);
admin.deleteTemplateDefinitionInstances(
templatedefId, activeOrgId, true, dateFrom, dateTo);
For more information about the deleteInstance(), deleteTemplateInstances(), and deleteTemplateDefinitionInstances() methods, see the com.bea.wlpi.server.admin.Admin Javadoc.
Querying the Run-Time Workload
To query the run-time workload, use the following com.bea.wlpi.server.admin.Admin method:
public java.util.List workloadQuery(
java.lang.String xml
) throws java.rmi.RemoteException,
com.bea.wlpi.common.WorkflowException
The following table describes the workloadQuery() method parameter for which you must specify a value.
Table 22-7 workloadQuery() Method Parameter
Parameter |
Description |
Valid Values |
---|---|---|
xml |
Run-time workload query request. |
XML document that is compliant with the Workload Request DTD, as described in Workload Request DTD. |
This method returns a workload report in XML format that is compliant with the Workload Response DTD, as described in Workload Response DTD.
For example, the following code initiates a query on the run-time workload, based on the contents of the workloadReq XML document, which is compliant with the Workload Request DTD.
String workloadresp = workloadQuery(workloadReq);
This method writes its response in the file workloadresp, in a format that is compliant with the Workload Response DTD. For more information about the workloadQuery() method, see the com.bea.wlpi.server.admin.Admin Javadoc.
Querying the Run-Time Statistics
To query the run-time statistics, use the following com.bea.wlpi.server.admin.Admin method:
public java.util.List statisticsQuery(
java.lang.String xml
) throws java.rmi.RemoteException,
com.bea.wlpi.common.WorkflowException
The following table describes the statisticsQuery() method parameter for which you must specify a value.
Table 22-8 statisticsQuery() Method Parameter
Parameter |
Description |
Valid Values |
---|---|---|
xml |
Run-time statistics query request. |
XML document that is compliant with the Statistics Request DTD, as described in Statistics Request DTD. |
This method returns a statistics report in XML format that is compliant with the Statistics Response DTD, as described in Statistics Response DTD.
For example, the following code initiates a query on the run-time statistics, based on the contents of the statisticsReq XML document, which is compliant with the Statistics Request DTD.
java.lang.String statisticsresp = statisticsQuery(statisticsReq);
This method writes its response in the file statisticsresp, in a format that is compliant with the Statistics Response DTD. For more information about the statisticsQuery() method, see the com.bea.wlpi.server.admin.Admin Javadoc.
![]() |
![]() |
![]() |
|
Copyright © 2001 BEA Systems, Inc. All rights reserved.
|