![]() |
![]() |
|
|
Monitoring Run-Time Variables
This section explains how to monitor run-time variables, including the following topics:
For information about monitoring run-time variables using the WebLogic Integration Studio, see Monitoring Workflows in Using the WebLogic Integration Studio.
Getting Workflow Instance Variables
To get a list of the variables associated with a workflow instance, use the following com.bea.wlpi.server.admin.Admin method:
public java.util.List getInstanceVariables(
java.lang.String instanceId
) throws java.rmi.RemoteException,
com.bea.wlpi.common.WorkflowException
The following table describes the getInstanceVariables() method parameter for which you must specify a value.
Table 23-1 getInstanceVariables() Method Parameter
The method returns a list of com.bea.wlpi.common.VariableInfo objects. To access information about each variable, use the VariableInfo object methods described in VariableInfo Object.
Note: For variables of type XML, the value returned is of type byte[]. In order to print or display the returned value, you must convert it to a String value. For example, the following code converts the variable value of type byte[] to a String value:
String value=new String((byte[])variable.getValue())
For example, the following code gets the variables for the workflow instance corresponding to the specified instance ID. In this example, admin represents the EJBObject reference to the Admin EJB.
List list = admin.getInstanceVariables(instance.getId());
The instance ID is obtained using the getInstanceId() method associated with the com.bea.wlpi.common.InstanceInfo object, instance. The instance object can be obtained using the methods described in Getting Workflow Instances.
For more information about the getInstanceVariables() method, see the com.bea.wlpi.server.admin.Admin Javadoc.
Setting Workflow Instance Variables
To set variables associated with a workflow instance, use the following com.bea.wlpi.server.admin.Admin method:
public void setInstanceVariable(
java.lang.String templateDefinitionId,
java.lang.String instanceId,
java.lang.String variable,
java.lang.Object value
) throws java.rmi.RemoteException,
com.bea.wlpi.common.WorkflowException
The following table describes the setInstanceVariable() method parameters for which you must specify values.
Table 23-2 setInstanceVariable() Method Parameters
For example, the following code updates the specified variable, setting it to the specified value. In this example, admin represents the EJBObject reference to the Admin EJB.
admin.setInstanceVariable(
instance.getTemplateDefinitionId(),
instance.getInstanceId(),
variable.getName(),
value
);
The variable name is obtained using the getName() method associated with the com.bea.wlpi.common.VariableInfo object, variable. The variable object can be obtained using the method described in Getting Workflow Instance Variables. The template definition and workflow instance IDs are obtained using the methods associated with the com.bea.wlpi.common.InstanceInfo object, instance. The instance object can be obtained using the methods described in Getting Workflow Instances.
For more information about the com.bea.wlpi.common.VariableInfo and com.bea.wlpi.common.TaskInfo methods, see Value Object Summary.
For more information about the setInstanceVariable() method, see the com.bea.wlpi.server.admin.Admin Javadoc
![]() |
![]() |
![]() |
|
Copyright © 2001 BEA Systems, Inc. All rights reserved.
|