WebLogic Integration


com.bea.wlpi.server.common
Interface ExecutionContext


public interface ExecutionContext

Provides run-time support to plugin-supplied nodes and actions.

Since:
WebLogic Process Integrator 2.0
Author:
Copyright © 2000, 2001 BEA Systems, Inc. All Rights Reserved.

Field Summary
static java.lang.String AUDIT_HOME
          JNDI/EJB environment entry for the Audit bean.
static java.lang.String BUSINESS_CALENDAR_HOME
          JNDI/EJB environment entry for the BusinessCalendar bean.
static int CALTYPE_ASSIGNEE
          Use task assignee calendar when evaluating expressions.
static int CALTYPE_GREGORIAN
          Use Gregorian calendar when evaluating expressions.
static int CALTYPE_ORG
          Use instance org calendar when evaluating expressions.
static int CALTYPE_SPECIFIC
          Use specific calendar when evaluating expressions.
static int CONTINUE
          Return code to permit processing of subsequent operations.
static int EXIT_CONTINUE
          Return code to exit an error handler and permit processing of subsequent operations.
static int EXIT_RETRY
          Return code to exit an error handler and request retry of the failed operation.
static int EXIT_ROLLBACK
          Return code to exit an error handler and request rollback of user transaction.
static int STOP
          Return code to prevent processing of subsequent operations.
static java.lang.String TEMPLATE_DEFINITION_HOME
          JNDI/EJB environment entry for the TemplateDefinitionRO bean.
static java.lang.String WLPI_PRINCIPAL_HOME
          JNDI/EJB environment entry for the WLPIPrincipal bean.
static java.lang.String WORKFLOW_INSTANCE_HOME
          JNDI/EJB environment entry for the WorkflowInstance bean.
static java.lang.String XML_REPOSITORY_HOME
          JNDI/EJB environment entry for the XMLRepository bean.
 
Method Summary
 void addClientResponse(java.lang.String xml)
          Append an XML subdocument to the API method's return value.
 java.lang.String getErrorHandler()
          Return the name of the current error handler.
 EventData getEventData()
          Return the data associated with the current event, if any.
 int getExceptionNumber()
          Return the message number of the error being handled by the exception handler.
 java.lang.Exception getExceptionObject()
          Return the exception object being handled by the exception handler.
 int getExceptionSeverity()
          Return the severity code of the error being handled by the exception handler.
 java.lang.String getExceptionText()
          Return the message text of the error being handled by the exception handler.
 java.lang.String getExceptionType()
          Return the type of exception being handled by the exception handler.
 java.lang.String getInstanceID()
          Return the ID of the current workflow instance.
 java.lang.String getOrg()
          Return the ID of the organization in which the current instance is running.
 java.lang.Object getPluginInstanceData(java.lang.String pluginName)
          Get the workflow instance data provided by the named plugin.
 java.lang.String getRequestor()
          Return the ID of the user who made the current API request.
 boolean getRollbackOnly()
          Return whether the current user transaction has been marked for rollback only.
 java.lang.String getTemplateDefinitionID()
          Return the ID of the current template definition.
 PluginObject getTemplateDefinitionPluginData(java.lang.String pluginName)
          Return the plugin template definition data for the specified plugin.
 java.lang.String getTemplateID()
          Return the ID of the current template.
 PluginObject getTemplatePluginData(java.lang.String pluginName)
          Return the plugin template data for the specified plugin.
 VariableInfo getVariableInfo(java.lang.String name)
          Return information about a variable in the template definition.
 java.lang.Object getVariableValue(java.lang.String name)
          Return the value of a workflow instance variable.
 com.bea.wlpi.server.instance.WorkflowInstanceData getWorkflowInstanceData()
          Return the workflow instance state.
 java.lang.String instantiate(java.lang.String orgID, java.lang.String initialNode, java.lang.String parentTemplateDefinitionID, java.lang.String parentID, java.lang.String parentNodeID, EventData eventData, java.util.List lVariableValues, java.util.Map pluginData)
          Create a new workflow instance.
 int invokeErrorHandler(java.lang.String handlerName, java.lang.Exception e)
          Invoke an error handler by name.
 boolean isAuditEnabled()
          Return whether auditing is enabled for the current workflow.
 void setErrorHandler(java.lang.String handlerName)
          Set the current error handler.
 void setPluginInstanceData(java.lang.String pluginName, java.lang.Object data)
          Set the workflow instance data provided by the named plugin.
 void setRollbackOnly()
          Set the current user transaction for rollback only.
 void setVariableValue(java.lang.String name, java.lang.Object value)
          Set the value of a workflow instance variable.
 void setVariableValues(java.util.Map variables)
          Set the value of multiple workflow instance variables.
 java.lang.String taskAssign(java.lang.String instanceID, java.lang.String taskID, java.lang.String assigneeID, boolean bRole, boolean bLoadBalance)
          Assign a workflow task to a participant.
 java.lang.String taskDoit(java.lang.String instanceID, java.lang.String taskID)
          Execute a workflow task.
 java.lang.String taskMarkDone(java.lang.String instanceID, java.lang.String taskID)
          Mark a workflow task as complete.
 java.lang.String taskSetProperties(java.lang.String instanceID, java.lang.String taskID, int priority, boolean doneWithoutExecute, boolean executeIfDone, boolean unmarkDone, boolean modifiable, boolean reassignment)
          Set the properties for a workflow task.
 java.lang.String taskUnassign(java.lang.String instanceID, java.lang.String taskID)
          Unassign a workflow task.
 java.lang.String taskUnmarkDone(java.lang.String instanceID, java.lang.String taskID)
          Mark a workflow task as incomplete.
 

Field Detail

AUDIT_HOME

public static final java.lang.String AUDIT_HOME
JNDI/EJB environment entry for the Audit bean.

WLPI_PRINCIPAL_HOME

public static final java.lang.String WLPI_PRINCIPAL_HOME
JNDI/EJB environment entry for the WLPIPrincipal bean.

TEMPLATE_DEFINITION_HOME

public static final java.lang.String TEMPLATE_DEFINITION_HOME
JNDI/EJB environment entry for the TemplateDefinitionRO bean.

WORKFLOW_INSTANCE_HOME

public static final java.lang.String WORKFLOW_INSTANCE_HOME
JNDI/EJB environment entry for the WorkflowInstance bean.

BUSINESS_CALENDAR_HOME

public static final java.lang.String BUSINESS_CALENDAR_HOME
JNDI/EJB environment entry for the BusinessCalendar bean.

XML_REPOSITORY_HOME

public static final java.lang.String XML_REPOSITORY_HOME
JNDI/EJB environment entry for the XMLRepository bean.

CALTYPE_ORG

public static final int CALTYPE_ORG
Use instance org calendar when evaluating expressions.

CALTYPE_ASSIGNEE

public static final int CALTYPE_ASSIGNEE
Use task assignee calendar when evaluating expressions.

CALTYPE_SPECIFIC

public static final int CALTYPE_SPECIFIC
Use specific calendar when evaluating expressions.

CALTYPE_GREGORIAN

public static final int CALTYPE_GREGORIAN
Use Gregorian calendar when evaluating expressions.

CONTINUE

public static final int CONTINUE
Return code to permit processing of subsequent operations.

STOP

public static final int STOP
Return code to prevent processing of subsequent operations.

EXIT_ROLLBACK

public static final int EXIT_ROLLBACK
Return code to exit an error handler and request rollback of user transaction.

EXIT_CONTINUE

public static final int EXIT_CONTINUE
Return code to exit an error handler and permit processing of subsequent operations.

EXIT_RETRY

public static final int EXIT_RETRY
Return code to exit an error handler and request retry of the failed operation.
Method Detail

getRollbackOnly

public boolean getRollbackOnly()
Return whether the current user transaction has been marked for rollback only.

Returns:
true if the transaction is set for rollback only.

setRollbackOnly

public void setRollbackOnly()
Set the current user transaction for rollback only.

getTemplatePluginData

public PluginObject getTemplatePluginData(java.lang.String pluginName)
Return the plugin template data for the specified plugin.

Parameters:
pluginName - The reverse-DNS plugin name.
Returns:
Plugin's template data.

getTemplateDefinitionPluginData

public PluginObject getTemplateDefinitionPluginData(java.lang.String pluginName)
Return the plugin template definition data for the specified plugin.

Parameters:
pluginName - The reverse-DNS plugin name.
Returns:
Plugin's template definition data.

getTemplateID

public java.lang.String getTemplateID()
Return the ID of the current template.

Returns:
The template ID.

getTemplateDefinitionID

public java.lang.String getTemplateDefinitionID()
Return the ID of the current template definition.

Returns:
The template definition ID.

getInstanceID

public java.lang.String getInstanceID()
Return the ID of the current workflow instance.

Returns:
The workflow instance ID.

getWorkflowInstanceData

public com.bea.wlpi.server.instance.WorkflowInstanceData getWorkflowInstanceData()
                                                                          throws WorkflowException
Return the workflow instance state. N.B. This method exposes undocumented classes. Plugins should call the public APIs Admin.getInstanceVariables(java.lang.String) and Admin.setInstanceVariable(java.lang.String, java.lang.String, java.lang.String, java.lang.Object) instead.

Returns:
The workflow instance state.
Throws:
WorkflowException - if an error occurred when accessing the workflow instance state.

getEventData

public EventData getEventData()
Return the data associated with the current event, if any.

Returns:
The event data.

getOrg

public java.lang.String getOrg()
                        throws WorkflowException
Return the ID of the organization in which the current instance is running.

Returns:
The organization ID.
Throws:
WorkflowException - if an error occurred when retrieving the organization ID.

getRequestor

public java.lang.String getRequestor()
Return the ID of the user who made the current API request.

Returns:
The requestor ID.

isAuditEnabled

public boolean isAuditEnabled()
Return whether auditing is enabled for the current workflow.

Returns:
The workflow's 'audit-enabled' flag.

addClientResponse

public void addClientResponse(java.lang.String xml)
Append an XML subdocument to the API method's return value.

Parameters:
xml - XML subdocument to append.

instantiate

public java.lang.String instantiate(java.lang.String orgID,
                                    java.lang.String initialNode,
                                    java.lang.String parentTemplateDefinitionID,
                                    java.lang.String parentID,
                                    java.lang.String parentNodeID,
                                    EventData eventData,
                                    java.util.List lVariableValues,
                                    java.util.Map pluginData)
                             throws WorkflowException
Create a new workflow instance.

Parameters:
orgID - The ID of the organization within which the instance is to run.
initialNode - The ID of the start node to activate.
parentTemplateDefinitionID - The ID of the parent template definition (if instantiating a sub-workflow).
parentID - The ID of the parent workflow instance (if instantiating a sub-workflow).
parentNodeID - The ID of the node in the parent workflow to be notified of events in subflows life-cycle (if instantiating a sub-workflow).
eventData - An event datum to pass to the called start nodes in the workflow. This is an alternative to setting variable values explicitly via the lVariableValues parameter.
lVariableValues - A list of VariableInfo objects to initialize the workflow instance variables. Note that non-null initial values for all mandatory input variables must be passed through the lVariableValues parameter.
Returns:
The ID of the new workflow instance.
Throws:
WorkflowException - if the workflow could not be instantiated.
See Also:
Worklist.instantiateWorkflow( String, String, String, Map, Map)

taskDoit

public java.lang.String taskDoit(java.lang.String instanceID,
                                 java.lang.String taskID)
                          throws WorkflowException
Execute a workflow task. This is equivalent to calling the public Worklist.taskExecute(java.lang.String, java.lang.String, java.lang.String) method.

Parameters:
instanceID - The ID of the workflow instance.
taskID - The ID of the task to execute.
Returns:
A response string (in XML format) compliant.
Throws:
WorkflowException - if an error occurred while executing the task.
See Also:
Worklist.taskExecute(java.lang.String, java.lang.String, java.lang.String)

taskMarkDone

public java.lang.String taskMarkDone(java.lang.String instanceID,
                                     java.lang.String taskID)
                              throws WorkflowException
Mark a workflow task as complete. This is equivalent to calling the public Worklist.taskMarkDone(java.lang.String, java.lang.String, java.lang.String) method.

Parameters:
instanceID - The ID of the workflow instance.
taskID - The ID of the task to mark complete.
Returns:
A response string (in XML format) compliant.
Throws:
WorkflowException - if an error occurred while marking the task as complete.
See Also:
Worklist.taskMarkDone(java.lang.String, java.lang.String, java.lang.String)

taskUnmarkDone

public java.lang.String taskUnmarkDone(java.lang.String instanceID,
                                       java.lang.String taskID)
                                throws WorkflowException
Mark a workflow task as incomplete. This is equivalent to calling the public Worklist.taskUnmarkDone(java.lang.String, java.lang.String, java.lang.String) method.

Parameters:
instanceID - The ID of the workflow instance.
taskID - The ID of the task to mark incomplete.
Returns:
A response string (in XML format) compliant.
Throws:
WorkflowException - if an error occurred while marking the task as incomplete.
See Also:
Worklist.taskUnmarkDone(java.lang.String, java.lang.String, java.lang.String)

taskAssign

public java.lang.String taskAssign(java.lang.String instanceID,
                                   java.lang.String taskID,
                                   java.lang.String assigneeID,
                                   boolean bRole,
                                   boolean bLoadBalance)
                            throws WorkflowException
Assign a workflow task to a participant. This is equivalent to calling the public Worklist.taskAssign(java.lang.String, java.lang.String, java.lang.String, java.lang.String, boolean, boolean) method.

Parameters:
instanceID - The ID of the workflow instance.
taskID - The ID of the task to assign.
assigneeID - The ID of the participant to whom the task is to be assigned. Must be a valid WebLogic Process Integrator role or user ID.
bRole - true if the assigneeID is a role ID.
bLoadBalance - true to apply the load-balancing across the members of a role. This parameter is ignored if bRole is false.
Returns:
A response string (in XML format) compliant.
Throws:
WorkflowException - if an error occurred while assigning the task.
See Also:
Worklist.taskAssign(java.lang.String, java.lang.String, java.lang.String, java.lang.String, boolean, boolean)

taskUnassign

public java.lang.String taskUnassign(java.lang.String instanceID,
                                     java.lang.String taskID)
                              throws WorkflowException
Unassign a workflow task. This is equivalent to calling the public Worklist.taskUnassign(java.lang.String, java.lang.String, java.lang.String) method.

Parameters:
instanceID - The ID of the workflow instance.
taskID - The ID of the task to unassign.
Returns:
A response string (in XML format) compliant.
Throws:
WorkflowException - if an error occurred while unassigning the task.
See Also:
Worklist.taskUnassign(java.lang.String, java.lang.String, java.lang.String)

taskSetProperties

public java.lang.String taskSetProperties(java.lang.String instanceID,
                                          java.lang.String taskID,
                                          int priority,
                                          boolean doneWithoutExecute,
                                          boolean executeIfDone,
                                          boolean unmarkDone,
                                          boolean modifiable,
                                          boolean reassignment)
                                   throws WorkflowException
Set the properties for a workflow task. This is equivalent to calling the public Worklist.taskSetProperties(java.lang.String, java.lang.String, java.lang.String, int, boolean, boolean, boolean, boolean, boolean) method.

Parameters:
instanceID - The ID of the workflow instance.
taskID - The ID of the task to update.
priority - The task instance priority (0=low, 1=medium, 2=high).
doneWithoutExecute - true to permit a user to mark a task instance as complete (by calling the Worklist.taskMarkDone(java.lang.String, java.lang.String, java.lang.String) method).
executeIfDone - true to permit a user to execute a task instance after it has been marked as complete (by calling the Worklist.taskExecute(java.lang.String, java.lang.String, java.lang.String) method).
unmarkDone - true to permit a user to mark a task instance as incomplete (by calling the Worklist.taskUnmarkDone(java.lang.String, java.lang.String, java.lang.String) method).
modifiable - true to permit a user to modify a task instance's runtime properties (by calling the Worklist.taskSetProperties(java.lang.String, java.lang.String, java.lang.String, int, boolean, boolean, boolean, boolean, boolean) method).
reassignable - true to permit a user to reassign a task instance to another participant (by calling the Worklist.taskAssign(java.lang.String, java.lang.String, java.lang.String, java.lang.String, boolean, boolean) method).
Returns:
A response string as described under Worklist.taskExecute(java.lang.String, java.lang.String, java.lang.String).
Throws:
WorkflowException - if an error occurred while setting the task properties.
See Also:
Worklist.taskSetProperties(java.lang.String, java.lang.String, java.lang.String, int, boolean, boolean, boolean, boolean, boolean)

setVariableValue

public void setVariableValue(java.lang.String name,
                             java.lang.Object value)
                      throws WorkflowException
Set the value of a workflow instance variable. The following conversions are supported for the value parameter:
Variable TypeValue ClassNotes
Boolean java.lang.Boolean,
java.lang.Number,
java.lang.String,
org.w3c.dom.Node,
org.w3c.dom.NodeList
Numbers are treated as true if non-zero. Strings are treated as true if they have the value "true". The same treatment is applied to the node value of Node and the first item of a NodeList. Any other value class throws an exception.
Date java.util.Date Strings are converted to dates using VariableInfo.DEFAULT_DATE_FORMAT
Double java.lang.Number,
java.lang.Boolean,
java.lang.String,
org.w3c.dom.Node,
org.w3c.dom.NodeList
Numbers simply yield their doubleValue(). Boolean true yields 1.0, false yields 0.0. Strings must contain a valid string representation of a double constant. The same treatment is applied to the node value of Node and the first item of a NodeList. Any other value class throws an exception.
Entity EJB javax.ejb.Handle The system checks the value to ensure that it is a handle for an entity EJB, then stores the handle. Any other value class throws an exception.
Integer java.lang.Number,
java.lang.Boolean,
java.lang.String,
org.w3c.dom.Node,
org.w3c.dom.NodeList
Numbers simply yield their intValue(). Boolean true yields 1, false yields 0. Strings must contain a valid string representation of an integer constant. The same treatment is applied to the node value of Node and the first item of a NodeList. Any other value class throws an exception.
Object java.lang.Object Any serializable Java object can be stored.
<Plugin> java.lang.Object The value must be assignable to the value class defined by the plugin for this variable type. Any other value class throws an exception.
Session EJB javax.ejb.Handle The system checks the value to ensure that it is a handle for a session EJB, then stores the handle. Any other value class throws an exception.
String org.w3c.dom.Node,
org.w3c.dom.NodeList,
java.lang.Object
All object types yield their string representation. The same treatment is applied to the node value of Node and the first item of a NodeList.
XML org.w3c.dom.Node,
org.w3c.dom.NodeList,
java.lang.String,
byte[]
The system performs a non-validating SAX parse on string values to ensure that they contain valid XML markup, then converts the string to a UTF-8 encoded byte array. A DOM Node and the first item of a NodeList object is serialized to a UTF-8 encoded byte array. A byte[] value is assumed to be a UTF-8 encoded string containing a valid XML document. The value is not parsed or verified. Any other value class throws an exception.

Parameters:
name - The name of the variable to set.
value - The new value to assign, which must be compatible with the variable's declared type, as described in the above table.
Throws:
WorkflowException - if an error occurred while setting the variable's value.
See Also:
Admin.setInstanceVariable(java.lang.String, java.lang.String, java.lang.String, java.lang.Object)

setVariableValues

public void setVariableValues(java.util.Map variables)
                       throws WorkflowException
Set the value of multiple workflow instance variables.

Parameters:
variables - A map containing variable name as the key and variable value as the object.
Throws:
WorkflowException - if an error occurred while setting the variable's value.
See Also:
Admin.setInstanceVariable(java.lang.String, java.lang.String, java.lang.String, java.lang.Object)

getVariableValue

public java.lang.Object getVariableValue(java.lang.String name)
                                  throws WorkflowException
Return the value of a workflow instance variable. N.B. It returns a DOM node if this variable is xml type.

Parameters:
name - The name of the variable whose value is required.
Returns:
the variable's value.
Throws:
WorkflowException - if an error occurred while retrieving the variable's value.
See Also:
Admin.getInstanceVariables(java.lang.String)

getVariableInfo

public VariableInfo getVariableInfo(java.lang.String name)
Return information about a variable in the template definition.

Returns:
Variable information.

getErrorHandler

public java.lang.String getErrorHandler()
                                 throws WorkflowException
Return the name of the current error handler. The system exception handler is denoted by the empty string.

Returns:
the name of the current error handler.
Throws:
WorkflowException - if the exception handler re-threw the original exception, or if a subsequent error occurred during the execution of the exception handler itself.

setErrorHandler

public void setErrorHandler(java.lang.String handlerName)
                     throws WorkflowException
Set the current error handler.

Parameters:
handlerName - The name of the error handler to store. If null, the method restores the previous exception handler. If the empty string, the method makes the system error handler current.
Throws:
WorkflowException - if the exception handler could not be set.

invokeErrorHandler

public int invokeErrorHandler(java.lang.String handlerName,
                              java.lang.Exception e)
                       throws WorkflowException
Invoke an error handler by name.

Throws:
WorkflowException - if the exception handler threw an exception, or if a subsequent error occurred during the execution of the exception handler itself.

getExceptionType

public java.lang.String getExceptionType()
Return the type of exception being handled by the exception handler. Typically, the exception type is the name of the exception class that raised the error.

Returns:
The current exception type.

getExceptionSeverity

public int getExceptionSeverity()
Return the severity code of the error being handled by the exception handler.

Returns:
Severity code: WorkflowException.ERROR_SYSTEM, WorkflowException.ERROR_WORKFLOW, WorkflowException.WARNING_WORKFLOW, WorkflowException.ERROR_UNKNOWN, or WorkflowException.ERROR_CUSTOM

getExceptionNumber

public int getExceptionNumber()
Return the message number of the error being handled by the exception handler.

Returns:
The message number.
See Also:
Messages

getExceptionText

public java.lang.String getExceptionText()
Return the message text of the error being handled by the exception handler.

Returns:
The message text.
See Also:
Messages

getExceptionObject

public java.lang.Exception getExceptionObject()
Return the exception object being handled by the exception handler.

Returns:
The exception object.

getPluginInstanceData

public java.lang.Object getPluginInstanceData(java.lang.String pluginName)
                                       throws WorkflowException
Get the workflow instance data provided by the named plugin.

Parameters:
pluginName - The reverse-DNS name of the plugin that supplied the data.
Returns:
Plugin-provided instance data.
Throws:
WorkflowException - if an error occurred when accessing the data.
See Also:
setPluginInstanceData(java.lang.String, java.lang.Object)

setPluginInstanceData

public void setPluginInstanceData(java.lang.String pluginName,
                                  java.lang.Object data)
                           throws WorkflowException
Set the workflow instance data provided by the named plugin.

Parameters:
pluginName - The reverse-DNS name of the plugin supplying the data.
data - The serializable plugin instance data. Set plugin-provided instance data.
Throws:
WorkflowException - if an error occurred when storing the data.
See Also:
getPluginInstanceData(java.lang.String)

WebLogic Integration

WebLogic Integration (WLI)