bea.com | products | dev2dev | support | askBEA |
![]() |
![]() |
|
![]() |
e-docs > WebLogic Platform > WebLogic Integration > BPM Topics > Programming BPM Client Apps > Monitoring Run-Time Variables |
Programming BPM Client Apps
|
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.
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: 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. 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.
String value=new String((byte[])variable.getValue())List list = admin.getInstanceVariables(instance.getId());
Setting Workflow Instance Variables
To set variables associated with a workflow instance, use one of the following com.bea.wlpi.server.admin.Admin methods:
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
public void setInstanceVariables(
java.lang.String templateDefinitionId,
java.lang.String instanceId,
java.lang.String variables
) throws java.rmi.RemoteException,
com.bea.wlpi.common.WorkflowException
The following table describes the setInstanceVariable() method parameters for which you must specify values.
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. 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() and setInstanceVariables() methods, see the com.bea.wlpi.server.admin.Admin Javadoc.
admin.setInstanceVariable(
instance.getTemplateDefinitionId(),
instance.getInstanceId(),
variable.getName(),
value
);
![]() |
![]() |
![]() |
![]() |
||
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |