com.bea.b2b.wlpi
Class WorkflowInstance

java.lang.Object
  |
  +--com.bea.b2b.wlpi.WorkflowInstance

public final class WorkflowInstance
extends java.lang.Object

The WorkflowInstance class represents a running workflow instance.

Author:
Copyright © 2000 BEA Systems, Inc. All Rights Reserved.

Field Summary
 java.util.Hashtable rnMsgIds
          Table to stored RN msg ids received for this instance.
 
Method Summary
static WorkflowInstance getInstanceForId(java.lang.String id)
          Gets the workflow instance object for the specified instance ID.
 java.lang.String getInstanceId()
          Gets the instance ID of this workflow instance, or null if the workflow instance is not running.
 MessageToken getMsgToken()
          Gets the message token created when the last message was sent.
 boolean getTerminateStatus()
          Gets the terminate status (true or false).
 java.lang.Object getVariable(java.lang.String name)
          Gets the value of the specified instance variable for this workflow instance.
 boolean isCompleted()
          Determines whether this workflow instance is completed (true) or not (false).
 void setTerminateStatus(boolean status)
          Sets the termination status (true or false).
 void setVariable(java.lang.String name, java.lang.Object value)
          Sets an instance variable for this workflow instance.
 void start()
          Starts the workflow instance.
 void waitForCompletion()
          Waits for this workflow instance to complete.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

rnMsgIds

public java.util.Hashtable rnMsgIds
Table to stored RN msg ids received for this instance. Used to process possibility of duplicate messages. (From Rosettanet spec: a unique id is a combination of the process Instance Indentifier and the Global Business Indicator Code (DUNS number) for the partner that initiated a process) The stored ID is made up of the above combination and the document id. NOTE: this table can potentially grow to a large size since it is not cleaned up for the life time of the workflow. However, it is not expected that a specific standard PIP workflow will receive that many messages (as this is limited by the specification).
Method Detail

start

public void start()
           throws WLPIException
Starts the workflow instance.

Throws:
WLPIException - If an error occurred when starting the workflow instance.

getInstanceId

public java.lang.String getInstanceId()
Gets the instance ID of this workflow instance, or null if the workflow instance is not running.

Returns:
String Workflow Instance ID.

setVariable

public void setVariable(java.lang.String name,
                        java.lang.Object value)
                 throws WLPIException
Sets an instance variable for this workflow instance.

Parameters:
name - Variable name.
value - Variable value.
Throws:
WLPIException - If an error occurred when setting the instance variable.

getVariable

public java.lang.Object getVariable(java.lang.String name)
                             throws WLPIException
Gets the value of the specified instance variable for this workflow instance.

Parameters:
name - Variable name.
Returns:
Object - Variable value.
Throws:
WLPIException - If an error occurred when getting the instance variable.

getMsgToken

public MessageToken getMsgToken()
Gets the message token created when the last message was sent.

Returns:
MessageToken - Message token.

getInstanceForId

public static WorkflowInstance getInstanceForId(java.lang.String id)
Gets the workflow instance object for the specified instance ID.

Parameters:
id - WLPI instance ID of the workflow.
Returns:
WorkFlowInstance Workflow instance object.

waitForCompletion

public void waitForCompletion()
                       throws WLPIException
Waits for this workflow instance to complete.

Throws:
WLPIException - If an error occurred when waiting for the workflow instance to complete.

isCompleted

public boolean isCompleted()
Determines whether this workflow instance is completed (true) or not (false).

Returns:
boolean - true if the workflow has completed, or false if not.

setTerminateStatus

public void setTerminateStatus(boolean status)
Sets the termination status (true or false).

Parameters:
status - true to change the termination status to true, or false to set it to false.

getTerminateStatus

public boolean getTerminateStatus()
Gets the terminate status (true or false).

Returns:
boolean - true or false.