oracle.apps.fnd.wf.common
Class WorkflowContext

java.lang.Object
  |
  +--oracle.apps.fnd.common.Context
        |
        +--oracle.apps.fnd.wf.common.WorkflowContext
All Implemented Interfaces:
java.lang.Cloneable, WorkflowConstants

public class WorkflowContext
extends oracle.apps.fnd.common.Context
implements WorkflowConstants

Workflow Context will be instantiated for each asynchronous call into a workflow process. This is a transient object that holds the JDBC connection, the NLS settings, the AppsContext when running in embedded (Apps) mode, reference to the logger and Workflow Resource Store, as well as information on the kind of store being used database, XML etc. In the embedded mode it can also be used to obtain a JDBC connection from the AOL/J Connection Pool. WorkflowContext should be initialized with an AppsContext in the embedded mode and with a JDBC connection in the standalone mode.


Field Summary
static java.lang.String RCS_ID
           
static boolean RCS_ID_RECORDED
           
 
Fields inherited from interface oracle.apps.fnd.wf.common.WorkflowConstants
WF_DB, WF_DB_STORE, WF_DEFAULT_STORE, WF_DESIGN_STORE_LOCATION, WF_DESIGN_STORE_TYPE, WF_ENGINE_TYPE, WF_INBOUND_HOST_URL, WF_MT, WF_OUTBOUND_MAILBOX, WF_OUTBOUND_SMTP, WF_PARENT_CONTEXT, WF_RUNTIME_STORE_TYPE, WF_STORE_ID, WF_WFT_STORE, WF_XML_STORE
 
Constructor Summary
WorkflowContext()
           
WorkflowContext(oracle.apps.fnd.common.AppsContext ctx)
          This API will be used by Oracle Applications users to set applications specific context.
WorkflowContext(java.sql.Connection conn)
          Use this constructor when you have a database connection available.
WorkflowContext(java.util.Map attributes)
          Creates a new WorkflowContext object.
WorkflowContext(WorkflowContext ctx)
          Creates a new WorkflowContext object.
 
Method Summary
 oracle.apps.fnd.common.AppsContext getAppsContext()
          Returns AppsContext which was used to instantiate the WorkflowContext.
 java.lang.Object getAttribute(java.lang.Object key)
          Return attribute value for a given key value
 java.lang.String getCharset()
          Returns current member value of character set.
 java.lang.String getDatabaseId()
          This method will call super.getDatabaseId once this method is added to AOL/J context.
 java.lang.String getDateFormat()
          Get the date format mask for the current session associated with the database connection.
 oracle.apps.fnd.common.EnvironmentStore getEnvStore()
          This API is only available on AppsContext.
 oracle.apps.fnd.common.ErrorStack getErrorStack()
          This API is only available on AppsContext.
 java.sql.Connection getExtraJDBCConnection(java.lang.Object pThis, java.lang.String pSessionId)
          This API is only available on AppsContext.
 java.sql.Connection getJDBCConnection()
          This method returns current JDBC connection for this context.
 java.lang.String getNLSLanguage()
          Get NLS language for the current session associated with the database connection.
 java.lang.String getNumberFormat()
          Get the date format mask for current session associated with the database connection.
 oracle.apps.fnd.common.PreferenceStore getPreferenceStore()
          This API is only available on AppsContext.
 oracle.apps.fnd.common.ProfileStore getProfileStore()
          This API is only available on AppsContext.
 oracle.apps.fnd.common.ResourceStore getResourceStore()
          Return the singleton WorkflowResourceStore.
 java.lang.String getTerritory()
          Get NLS Territory for the current session associated with the database connection.
 oracle.apps.fnd.wf.WFContext getWFContext()
          For internal use only.
 void releaseExtraJDBCConnection(java.sql.Connection conn)
          This API is only available on AppsContext.
 void releaseJDBCConnection()
          Release JDBC Connection that is held by this context.
 void setCharset(java.lang.String charset)
          Use this API to change the character set for the context.
 void setResourceStore(oracle.apps.fnd.common.ResourceStore resourceStore)
          This method does nothing, Default WorkflowResourceStore will be constructed when it is requested.
 void updateNLSSettings()
          This method will refresh NLS settings using the current database connection.
 
Methods inherited from class oracle.apps.fnd.common.Context
getExtraJDBCConnection, getExtraJDBCConnection, getJDBCConnection, getJDBCConnection, getLog, getSessionId, getSessionManager, releaseJDBCConnection, setContextProperties, setContextProperty, setContextProperty, setContextProperty, setLog, setPreferenceStore, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

RCS_ID

public static final java.lang.String RCS_ID

RCS_ID_RECORDED

public static final boolean RCS_ID_RECORDED
Constructor Detail

WorkflowContext

public WorkflowContext()

WorkflowContext

public WorkflowContext(java.sql.Connection conn)
Use this constructor when you have a database connection available. This API will set the store source to be the database. Releasing this connection will be the responsibility of the application that supplied this connection.
Parameters:
conn - Parameter

WorkflowContext

public WorkflowContext(WorkflowContext ctx)
Creates a new WorkflowContext object.
Parameters:
ctx - Parameter

WorkflowContext

public WorkflowContext(java.util.Map attributes)
Creates a new WorkflowContext object.
Parameters:
attributes - Parameter

WorkflowContext

public WorkflowContext(oracle.apps.fnd.common.AppsContext ctx)
This API will be used by Oracle Applications users to set applications specific context. When the WorkflowContext is instantiated using an AppsContext it delegates to AppsContext for most of its APIs.
Parameters:
ctx - instance of AppsContext.
Method Detail

getAttribute

public java.lang.Object getAttribute(java.lang.Object key)
Return attribute value for a given key value
Parameters:
key - Parameter
Returns:
return-value

getAppsContext

public oracle.apps.fnd.common.AppsContext getAppsContext()
Returns AppsContext which was used to instantiate the WorkflowContext. If not constructed with an AppsContext, null will be returned.
Returns:
AppsContext

getDatabaseId

public java.lang.String getDatabaseId()
This method will call super.getDatabaseId once this method is added to AOL/J context. This method should be public in the base class because RuntimeStore which is in the engine package needs to references this and set it as its id.
Overrides:
getDatabaseId in class oracle.apps.fnd.common.Context
Returns:
return-value

getJDBCConnection

public java.sql.Connection getJDBCConnection()
This method returns current JDBC connection for this context. Depending on the way the context was instantiated, it either returns the reference to the connection passed through constructor, or it delegates to the AppsContext from which this context was constructed.
Overrides:
getJDBCConnection in class oracle.apps.fnd.common.Context
Returns:
return-value

releaseJDBCConnection

public void releaseJDBCConnection()
Release JDBC Connection that is held by this context. It does nothing if the context was constructed using a JDBC connection and delegates to AppsContext if the context was instantiated with one.

So if the WorkflowContext was intantiated with a JDBC connection that was supplied by the calling application then it is the responsibility of the application to release the connection.

Overrides:
releaseJDBCConnection in class oracle.apps.fnd.common.Context

getExtraJDBCConnection

public java.sql.Connection getExtraJDBCConnection(java.lang.Object pThis,
                                                  java.lang.String pSessionId)
This API is only available on AppsContext. If AppsContext does not exist a null will be returned until AOL/J adds a standalone version of this API to the base Context class.
Overrides:
getExtraJDBCConnection in class oracle.apps.fnd.common.Context
Parameters:
pThis - Parameter
pSessionId - Parameter
Returns:
return-value

releaseExtraJDBCConnection

public void releaseExtraJDBCConnection(java.sql.Connection conn)
This API is only available on AppsContext. If AppsContext does not exist this API is a no-op.
Overrides:
releaseExtraJDBCConnection in class oracle.apps.fnd.common.Context
Parameters:
conn - Parameter

updateNLSSettings

public void updateNLSSettings()
                       throws WorkflowRuntimeException
This method will refresh NLS settings using the current database connection.
Throws:
WorkflowRuntimeException - Exception

setCharset

public void setCharset(java.lang.String charset)
Use this API to change the character set for the context. This value has no impact on the database, i.e. it does not alter database character.
Parameters:
charset - Parameter

getCharset

public java.lang.String getCharset()
Returns current member value of character set. If not set, it defaults to UTF8
Returns:
return-value

getNLSLanguage

public java.lang.String getNLSLanguage()
Get NLS language for the current session associated with the database connection. Default value is AMERICAN
Returns:
return-value

getDateFormat

public java.lang.String getDateFormat()
Get the date format mask for the current session associated with the database connection. Default value is 'DD-MON-YYYY'
Returns:
return-value

getNumberFormat

public java.lang.String getNumberFormat()
Get the date format mask for current session associated with the database connection. Default value is 'DD-MON-YYYY'
Returns:
return-value

getTerritory

public java.lang.String getTerritory()
Get NLS Territory for the current session associated with the database connection. Default value is AMERICA
Returns:
return-value

getErrorStack

public oracle.apps.fnd.common.ErrorStack getErrorStack()
This API is only available on AppsContext. If AppsContext does not exist this API is a no-op.
Overrides:
getErrorStack in class oracle.apps.fnd.common.Context
Returns:
return-value

getProfileStore

public oracle.apps.fnd.common.ProfileStore getProfileStore()
This API is only available on AppsContext. If AppsContext does not exist this API is a no-op.
Overrides:
getProfileStore in class oracle.apps.fnd.common.Context
Returns:
return-value

getEnvStore

public oracle.apps.fnd.common.EnvironmentStore getEnvStore()
This API is only available on AppsContext. If AppsContext does not exist this API is a no-op.
Overrides:
getEnvStore in class oracle.apps.fnd.common.Context
Returns:
return-value

getPreferenceStore

public oracle.apps.fnd.common.PreferenceStore getPreferenceStore()
This API is only available on AppsContext. If AppsContext does not exist this API is a no-op.
Overrides:
getPreferenceStore in class oracle.apps.fnd.common.Context
Returns:
return-value

getResourceStore

public oracle.apps.fnd.common.ResourceStore getResourceStore()
Return the singleton WorkflowResourceStore.
Overrides:
getResourceStore in class oracle.apps.fnd.common.Context
Returns:
return-value

setResourceStore

public void setResourceStore(oracle.apps.fnd.common.ResourceStore resourceStore)
This method does nothing, Default WorkflowResourceStore will be constructed when it is requested. You can not change this behaviour by calling this method.
Overrides:
setResourceStore in class oracle.apps.fnd.common.Context
Parameters:
resourceStore - Parameter

getWFContext

public oracle.apps.fnd.wf.WFContext getWFContext()
For internal use only. Utility Class that converts a WorkflowContext to WFContext.
Returns:
return-value
Throws:
WorkflowRuntimeException - Exception