| Previous | Next |  | Contents | Index | Glossary

## Oracle Workflow Java Interface

The Oracle Workflow Java interface provides a means for any Java program to integrate with Oracle Workflow. The Oracle Workflow Engine and Notification APIs are accessible through public server PL/SQL packages and published views. The Oracle Workflow Java interface exposes those APIs as Java methods that can be called by any Java program to communicate with Oracle Workflow. The Java methods directly reference the WF_ENGINE and WF_NOTIFICATION PL/SQL package procedures and views and communicate with the Oracle Workflow database through JDBC.

The methods are defined within the EngineAPI class and the NotificationAPI class, in the Java package 'oracle.apps.fnd.wf.engine'. If a Workflow Engine or Notification API has a corresponding Java method, its Java method syntax is displayed immediately after its PL/SQL syntax in the documentation.

#### Oracle Workflow Context

Each Java method requires an input of a WFContext object that consists of database connectivity information which you instantiate and resource context information that the WFContext class instantiates. To call a Workflow Engine Java API in your Java program, you must first instantiate a database variable of class WFDB with your database username, password and alias. You can also optionally supply a JDBC string. Then you must instantiate wCtx with the database variable.

#### Sample Java Program

Oracle Workflow provides an example Java program that illustrates how to call most of the Workflow Engine Java APIs. The Java program is named WFTest. It calls the various Java APIs to launch the WFDEMO process, set/get attributes and suspend, resume and abort the process. To initiate this program, make sure you define CLASSPATH and LD_LIBRARY_PATH for the Oracle JDBC implementation and a supported version of Oracle before running the WFTest java program. For example, on UNIX, use the following commands:

    setenv CLASSPATH <WF_installed_directory>/java/oracle/apps/fnd/wf/jar/

    wfapi.jar:${ORACLE_HOME}/jdbc/lib/classes111.zip

    setenv LD_LIBRARY_PATH ${ORACLE_HOME}/lib:${LD_LIBRARY_PATH}

To initiate the WFTEST program, run Java against 'oracle.apps.fnd.wf.WFTest'. For example, on UNIX, enter the following statement on the command line:

    $java oracle.apps.fnd.wf.WFTest

### See Also

Workflow Engine APIs

| Previous | Next |  | Contents | Index | Glossary