| Previous | Next |  | Contents | Index | Glossary

## Step 14 Setting Up the Java Function Activity Agent

To execute external Java function activities, you must set up the Java Function Activity Agent. This agent dequeues the messages related to external Java activities from the 'Outbound' queue for external function processing, calls the appropriate Java functions, and places the results on the 'Inbound' queue for external function processing.

> Note: These 'Outbound' and 'Inbound' queues are separate from the queues used for the Business Event System. See: Workflow Queue APIs.

After a Java function completes, you must run a background engine to process the 'Inbound' queue and complete the function activity. See: Setting Up Background Engines.

Some standard Workflow activities are external Java function activities and require the Java Function Activity Agent. You can also define your own external Java function activities. See: Standard Activities, To Create a Function Activity, and Standard API for Java Procedures Called by Function Activities.

You must have Java Runtime Environment (JRE) Version 1.1.8 or higher installed to run the Java Function Activity Agent.

> Note: The Java Runtime Environment is available for download from `http://www.javasoft.com`.

Context: You need to perform this step only once.

#### To Start the Java Function Activity Agent

You can either start the Java Function Activity Agent manually or modify and run sample scripts provided by Oracle Workflow to start the agent.

To start the Java Function Activity Agent manually, run JRE against 'oracle.apps.fnd.wf.WFFALsnr', specifying your CLASSPATH and the user name and password of your Oracle Workflow database account.

The CLASSPATH must point to the Java Runtime Environment, the top-level Workflow Java directory, the Oracle XML parser, the Oracle JDBC implementation, and the following Workflow JAR files:

- wfjava.jar--The Java Function Activity Agent

- wfapi.jar--Workflow Java APIs

- fndbalishare.jar--Utilities referenced by the Workflow Java APIs

- fndewt.jar--Utilities referenced by the Workflow Java APIs

- fndswing.jar--Optional additional utilities

If you define your own external Java function activities, you must also include the JAR files containing your custom Java classes in the CLASSPATH. The custom class files should reside on the same platform where the Java Function Activity Agent is run. The Java Function Activity Agent does not need to reside on the same tier as the database, however.

For example, on UNIX, use the following command to start the Java Function Activity Agent:

    jre -classpath "$<JREPATH>/rt.jar:$<ORACLE_HOME>/wf/java:

    $<ORACLE_HOME>/wf/java/oracle/apps/fnd/wf/jar/wfjava.jar:

    $<ORACLE_HOME>/wf/xml/java/lib/xmlparserv2.jar:

    $<ORACLE_HOME>/wf/java/oracle/apps/fnd/wf/jar/wfapi.jar:

    $<ORACLE_HOME>/jdbc/lib/classes111.zip:$<ORACLE_HOME>/wf/

    java/oracle/apps/fnd/wf/jar/fndbalishare.jar:$<ORACLE_HOME>/

    wf/java/oracle/apps/fnd/wf/jar/fndewt.jar:$<ORACLE_HOME>/wf/

    java/oracle/apps/fnd/wf/jar/fndswing.jar:" oracle.apps.fnd.

    wf.WFFALsnr <user_name>/<password>@<connect_string>

On Windows NT, use the following command:

    jre -classpath ";<JREPATH>\rt.jar;<ORACLE_HOME>\wf\java;

    <ORACLE_HOME>\wf\java\oracle\apps\fnd\wf\jar\wfjava.jar;

    <ORACLE_HOME>\wf\java\oracle\apps\fnd\wf\xmlparserv2.jar;

    <ORACLE_HOME>\wf\java\oracle\apps\fnd\wf\jar\wfapi.jar;

    <ORACLE_HOME>\jdbc\lib\classes111.zip;<ORACLE_HOME>\wf\java\

    oracle\apps\fnd\wf\jar\fndbalishare.jar;<ORACLE_HOME>\wf\

    java\oracle\apps\fnd\wf\jar\fndewt.jar;<ORACLE_HOME>\wf\

    java\oracle\apps\fnd\wf\jar\fndswing.jar;" -nojit oracle.

    apps.fnd.wf.WFFALsnr <user_name>/<password>@<connect_string>

Oracle Workflow also provides sample scripts called wfjvlsnr.csh and wfjvlsnr.bat which you can modify to run the Java Function Activity Agent on UNIX or on Windows NT, respectively. These scripts are located on your server in the Oracle Workflow admin subdirectory. Before you can use these sample scripts, you must edit them to include the actual directory paths to your Oracle Home and to the JRE rt.jar file. Also, if you define your own external Java function activities, you must include the path to the JAR files containing your custom Java classes. Then you can run the scripts with the user name and password of your Oracle Workflow database account to submit the Java Function Activity Agent. For example, on UNIX, use the following command:

    wfjvlsnr.csh <user_name>/<password>@<connect_string>

On Windows NT, use the following command:

    wfjvlsnr.bat <user_name>/<password>@<connect_string>

#### To Stop the Java Function Activity Agent

Normally, the Java Function Activity Agent runs as a perpetual job. However, you can stop the agent by running a script called wfjvstop.sql, located in the admin/sql subdirectory on your Oracle Workflow server. This script places a stop message on the 'Outbound' queue. See: wfjvstop.sql.

> Note: If you are running more than one Java Function Activity Agent simultaneously, you must run the wfjvstop.sql script once for each Java Function Activity Agent.

| Previous | Next |  | Contents | Index | Glossary