Right-click the project name in the Application Navigator and select Project Select Libraries and Classpath from the left panel and click Add Library. In the Add Library dialog box, select Oracle Rules Dictionary Component and

Using Declarative Components and Task Flows 25-43 The prerequisites for using the Rules Dictionary Editor task flow to create ADF-based Web applications is having a running installation of SOA Suite and Oracle JDeveloper on your computer. To create a sample application by using the Rules Dictionary Editor task flow: The first task is to create a sample application. The steps are: 1. Open Oracle JDeveloper.

2. From the File menu, select New and then Generic Application to create an

application.

3. Enter a name for the application in the Application Name field, for example,

useRuleDictTaskFlowApp, and click Next as shown in Figure 25–48 . Figure 25–48 Creating a Generic Task Flow Application

4. Enter useRuleDictTaskFlow in the Project Name field and ensure that ADF

Faces is selected in the Project Technologies tab, as shown in Figure 25–49 . Click Finish to create the project. 25-44 Oracle Fusion Middleware Developers Guide for Oracle SOA Suite Figure 25–49 Creating a Task Flow Project

5. Right-click the useRuleDictTaskFlow project in the Application Navigator of

Oracle JDeveloper, and select Project Properties to display the Project Properties dialog box. In the Project Properties dialog box:

a. Select JSP Tag Libraries from the left panel.

b. Click Add and select ADF Faces Components from the extension list in the

Choose Tag Libraries dialog box, and click OK as shown in Figure 25–50 . Figure 25–50 Choosing Tab Libraries for the Task Flow Application

c. Select Libraries and Classpath from the left panel and click Add Library to

display the Add Library dialog box. Using Declarative Components and Task Flows 25-45

d. Select Oracle Rules and then Oracle Rules Dictionary Task Flow in the

Libraries list and click OK as shown in Figure 25–51 . This adds the Rules SDK and the Rules Dictionary Task Flow JARs to the project. Figure 25–51 Adding the Rules SDK and Rules Dictionary Task Flow

e. Click OK to close the Project Properties dialog box.

6. Click Save All from the Oracle JDeveloper File menu to save the project.

7. Create a Java class that implements the

oracle.integration.console.metadata.model.share.MetadataDetai ls interface, which is defined in soaComposerTemplates.jar. For more information on the MetadataDetails interface, see Section I.1, The MetadataDetails Interface. The steps are:

a. Open Oracle JDeveloper.

b. From the File menu, select New to display the New Gallery dialog box.

c. In the New Gallery dialog box, select Java under General from the Categories

panel. Ensure that Java Class under Items is selected and click OK to display the Create Java Class dialog box.

d. Enter the name of the Java class, for example MyMetaDataDetails, add the

MetadataDetails interface in the Implements box under Optional Attributes, and click OK to create the Java class in your project as shown in Figure 25–52 . 25-46 Oracle Fusion Middleware Developers Guide for Oracle SOA Suite Figure 25–52 Creating a Java Class That Implements the MetadataDetails Interface The following is a sample of the content of the MyMetaDataDetails.java file: package useruledicttaskflow; import java.io.BufferedReader; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.OutputStreamWriter; import java.io.UnsupportedEncodingException; import java.io.Writer; import java.net.MalformedURLException; import java.net.URL; import oracle.integration.console.metadata.model.share.MetadataDetails; import oracle.integration.console.metadata.model.share.RelatedMetadataPath; public class MyMetaDataDetails implements MetadataDetails { public MyMetaDataDetails { super; } private static final String RULES_FILE1 = file:path of Rules file; public String getDocument { URL url = null; try { url = new URLRULES_FILE1; return readFileurl; } catch IOException e { System.err.printlne; } return ; }