How to Create the .jspx File

The next task is to create the .jspx file to include the Rules Editor component tag.

To create the .jspx file to include the Rules Editor Component tag:

  1. Open Oracle JDeveloper.
  2. From the File menu, select New and then select JSF.
  3. Select JSF Page and click OK.
  4. Select Document Type as JSP XML.
  5. Enter rulesEditor.jspx as file name. Click OK.
  6. The RulesEditor is visible in the component window in jDeveloper.
  7. Select RulesEditor, after that the Rulesdc tag can be seen.
  8. Drag and drop the rulesdc tag into the JSPX file. You can also add the rulesDC tag manually in your jspx file like this:
    <?xml version='1.0' encoding='UTF-8'?>
    <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1" xmlns:f="http://java.sun.com/jsf/core"
              xmlns:af="http://xmlns.oracle.com/adf/faces/rich" xmlns:rdc="http://xmlns.oracle.com/bpel/rules/editor">
        <jsp:directive.page contentType="text/html;charset=UTF-8"/>
        <f:view>
            <af:document title="rulesEditor" id="d1">
                <af:form id="f1">
                    <af:panelGridLayout id="pgl1" inlineStyle="margin:15px;" styleClass="AFStretchWidth"
                                        partialTriggers="cb1 cb3 cb4">
                        <af:gridRow id="gr2">
                            <af:gridCell marginStart="5px" marginEnd="5px" width="100%" halign="stretch" id="gc1">
                                <af:panelGroupLayout id="pgl2" layout="horizontal">
                                    <af:commandButton text="Save Dict" action="#{someBean.saveDictionary}" id="cb1"/>
                                    <af:spacer width="10" height="10" id="s2"/>
                                    <af:commandButton text="Validate" id="cb3" action="#{someBean.validate}"
                                                      partialSubmit="true"/>
                                    <af:spacer width="10" height="10" id="s8"/>
                                    <af:commandButton text="Toggle Mode" id="cb4" action="#{someBean.toggleMode}"
                                                      partialSubmit="true"/>
                                </af:panelGroupLayout>
                            </af:gridCell>
                        </af:gridRow>
                        <af:gridRow height="100%" id="gr1">
                            <af:gridCell marginStart="5px" marginEnd="5px" width="100%" halign="stretch" valign="stretch"
                                         id="gc2">
                                <rdc:rulesdc rulesetModel="#{someBean.ruleSetModel}" id="r1"
                                             ifThenPreferences="#{someBean.ifThenPreferences}"
                                             dtPreferences="#{someBean.dtPreferences}" viewOnly="#{someBean.viewOnly}"
                                             disableVerbalRules="false"></rdc:rulesdc>
                            </af:gridCell>
                        </af:gridRow>
                    </af:panelGridLayout>
                </af:form>
            </af:document>
        </f:view>
    </jsp:root>