12 Using Oracle SOA Composer with Oracle Business Rules at Runtime

This chapter describes how to use the Oracle SOA Composer application to work with a deployed dictionary and tasks that are part of a SOA composite application.

The chapter includes the following sections:

12.1 Introduction to Oracle SOA Composer

Oracle SOA Composer is a web-based application that enables you to work with Oracle Business Rules dictionaries and tasks for deployed applications. Oracle SOA Composer accesses a dictionary or a task in an MDS repository.

Oracle SOA Composer supports viewing and editing different types of metadata artifacts, such as DVM documents, SOA composites, and Oracle Business Rules dictionaries. You can view the different types of metadata by Types View or Deployment View, as shown in Figure 12-1.

The Deployment View is the default. Choose the Types View to see artifacts listed by type: Business Rules, Domain Value Maps, Human Tasks, or SOA Composites.

Figure 12-1 Oracle SOA Composer Types View

Description of Figure 12-1 follows
Description of "Figure 12-1 Oracle SOA Composer Types View "

The Deployment View has two nodes: SOA-Infra and Shared. The default node is a SOA partition created and managed in Enterprise Manager. The Shared folder displays rules or DVMs created in JDeveloper and deployed as shared artifacts.

From either view, click artifacts in the navigation tree to open them in separate tabs.

In SOA Composer, the Verbal Rules and Business Phrases features do not appear if you have not installed BPM.

Use the search field just above the View drop down to quickly find and filter types by name, as shown in Figure 12-2. Click to open artifacts from this page.

Figure 12-2 Search and Filter

Description of Figure 12-2 follows
Description of "Figure 12-2 Search and Filter"

12.1.1 Creating and Publishing Sessions

Click an artifact to open it in read-only mode. If you plan to make changes to an artifact, click the Edit Session button. Most action buttons only become active if you are in a session. When you are done making changes, click Publish. All changes in a session are committed to the main repository, can be seen by others, and the server will begin executing. If you have validation errors, you cannot publish, though you can save rules with validation errors and work on them again in another session.

The Discard button enables you to cancel out of changes that you do not want to save. If, after making some changes in a session, you wanted to go back to the original state that you started from, click Exit Session. Click Edit Session again to see the last saved session information.

These icons and buttons provide more information:

Table 12-1 SOA Composer Buttons

Button Description

Graphic is described in surrounding text Session Info

Hover over this icon to see Session Details.

Graphic is described in surrounding text Maximize

Click to maximize the tabs section. This increases screen space when writing or editing rules. Click again to restore the view.

Graphic is described in surrounding text Validate

Click to validate your changes. The system validates when you save and you can save rules with validation errors, though you cannot publish. For more information about validating, see Validating and Diagnosing an Oracle Business Rules Dictionary.

Graphic is described in surrounding text Bookmark

Click the bookmark if you want to avoid the search/deployment view in a future session. For more information, see Creating a Bookmark.

Save Changes in Current Tab or Save Changes in All Tabs

Click to save as appropriate.

Get Context Sensitive Help

Click to view the online help file.

Close All, Close Others

Click the drop down and select to close tabs.

Graphic is described in surrounding text

The Actions drop down enables you to use the compare and merge dictionaries, work with Decision Tables in Microsoft Excel, and review dictionary settings.

Diff Merge enables you to compare the currently selected dictionary with the File System, the Published Version, or the Saved Version. If there are differences, you can choose to merge the dictionaries.

For more information about comparing or merging dictionaries, see Comparing and Merging Oracle Business Rules Dictionaries.

Import From Excel enables you to import decision tables from Excel.

Export To Excel enables you to export decision tables and edit them in Excel.

For more information about working with Excel, see Editing Decision Tables in Microsoft Excel.

Dictionary Settings enables you to set dictionary preferences.

For more information about reviewing dictionary settings, see Reviewing Dictionary Settings.

Diagnostics, History Center, Save Log, Validation Log

At the bottom of the SOA Composer page are four tabs: Diagnostics, History Center, Save Log, and Validation Log. Use these tabs to validate changes to rules and perform and resolve changes to artifacts.

For more information about these tabs, see Validating and Diagnosing an Oracle Business Rules Dictionary.

12.1.1.1 Publishing Changes for an Oracle Business Rules Dictionary

After you verify dictionary modifications, click Publish to commit those changes to the MDS repository.

To publish changes to an Oracle Business Rules dictionary:

  1. Click the Publish menu item.
  2. In the Confirm dialog, click Yes if you want to make the changes in the MDS repository. Click No if you do not want to make the changes in the MDS repository.

    Remember to update the runtime changes into Rule Editor ADF following the tasks described in Importing Runtime Rules Changes From Repository Into JDeveloper

  3. When you open the dictionary after saving the edit session and deploying the composites, SOA composer opens the last saved edit session.

    When multiple users are editing the same dictionary, Oracle SOA Composer shows a message that the dictionary is being edited by another user and asks for a confirmation. When multiple users work on a single dictionary, only the last publish is persisted.

    To open the new dictionary click Discard, Clear all session edits and save changes button in the top menu.

Note:

A dictionary with validation errors can be saved, but it can be committed only after correcting the validation issues.

12.1.1.2 Creating a Bookmark

Create a bookmark to avoid the search or deployment view.

To open a dictionary using a known URL:

  1. In an open dictionary, click Bookmark in the toolbar of Oracle SOA Composer.
  2. Copy the URL and paste in a browser to launch SOA composer with the bookmarked artifact opened in a tab.

    Figure 12-3 Obtain the URL for an Open Dictionary

    Description of Figure 12-3 follows
    Description of "Figure 12-3 Obtain the URL for an Open Dictionary"
  3. In a browser, use the saved URL to directly access the dictionary.

    For example,

    http://SERVER_NAME_OR_IP_ADDRESS/soa/composer?docPath=/deployed-composites/ default/BusinessRulesTest_rev1.0/oracle/rules/businessrulestest/OrderBooking.rules
    

    According to the preceding example, composites are stored as per the following structure: deployed-composites/composite name_rev composite revision/oracle/rules/dictionary package path/dictionary name.rules

12.1.1.3 Reviewing Dictionary Settings

Click the Dictionary Setting button to set preferences.

Figure 12-4 Dictionary Settings Dialog

Description of Figure 12-4 follows
Description of "Figure 12-4 Dictionary Settings Dialog"

Table 12-2 Dictionary Settings

Dialog Sections Settings

Execution section

Rule Execution Algorithm: choose RETE or Non-RETE. For more information, see 1.3 Oracle Business Rules Engine Architecture. The Rete Algorithm and The Non-Rete Algorithm

Choices section

Phrase Suggestions: choose Business Phrases, Auto Suggestions, or All.

Data Model section

Global Qualifier Pattern: confirm {member} of {fact}.

Translations: click to translate {member} of {fact}.

Validate: click to validate {member} of {fact}.

12.1.2 Using Oracle SOA Composer User Authentication

Figure 12-5 shows the Oracle SOA Composer login page. This page allows Oracle SOA Composer to authenticate the specified user.

Figure 12-5 Oracle Oracle SOA Composer Login Page

Description of Figure 12-5 follows
Description of "Figure 12-5 Oracle Oracle SOA Composer Login Page"

To login to Oracle SOA Composer:

  1. Access Oracle SOA Composer using the following URL in your browser address bar:

    http://SERVER_NAME_OR_IP_ADDRESS/soa/composer

  2. In the Oracle SOA Composer login page, in the Username field, enter a user name.
  3. In the Password field, enter a password.
  4. Click Sign In.

For information about creating and managing users and groups, see the integrated SOA Composer Console online help.

12.1.3 What You Need to Know About SOA Composer Access Control and User Authentication

Oracle SOA Composer supports user and password access control and only authenticated users can use Oracle SOA Composer. However, Oracle SOA Composer does not provide finer grained access control. For example, Oracle SOA Composer does not support access control for individual rulesets or rules within a dictionary.

Oracle SOA Composer does support access control to metadata. Using Oracle SOA Composer, only users with the SOADesigner application role can access the metadata from Oracle SOA Composer. By default, all users with WLS Administrator privileges have this role.

If a user without the SOADesigner role logs into Oracle SOA Composer, a message appears, stating that the user is not authorized to modify the SOA metadata.

For more information about assigning the SOADesigner role to a nonadmin user who requires access to Oracle SOA Composer, see Managing Application Roles in Oracle Enterprise Manager Fusion Middleware Control Console in Oracle Fusion Middleware Administrator's Guide for Oracle SOA Suite and Oracle Business Process Management Suite.

12.2 Setting Accessibility Options

Accessibility settings help you read all components of the application.

You can set accessibility options in SOA Composer for the current instance, or for all instances.

12.2.1 How to Set Accessibility Features Before Logging In

SOA Composer presents the Accessibility menu on the login page, so you can configure accessibility before you log in. These settings can be persisted for only the current session or for all sessions.

To set accessibility options for the current session only:

  1. Launch SOA Composer.
  2. On the login page, click Accessibility in the top right corner.

    The Edit Accessibility Settings page appears, as shown in Figure 12-6.

    Figure 12-6 Edit Accessibility Settings Page

    Description of Figure 12-6 follows
    Description of "Figure 12-6 Edit Accessibility Settings Page"
  3. Select any of the following options:
    • Use screen reader.

    • Use high contrast colors.

    • Use large fonts.

  4. To save the new settings only for this session, click Use for this session. To save the settings for all sessions, click Save as preference and use.

12.2.2 How to Set Accessibility Options After Logging In

Once you log in to SOA Composer, you can configure accessibility options from any page. This changes the user preferences, which are retained through all sessions until you change them again.

To set accessibility options after logging in:

  1. Launch SOA Composer and log in.
  2. From any page, select Preferences in the top right corner.

    The Preferences dialog appears.

  3. In the Preferences column, click Accessibility.

    The Accessibility Preferences appear, as shown in Figure 12-7.

    Figure 12-7 Preferences Dialog

    Description of Figure 12-7 follows
    Description of "Figure 12-7 Preferences Dialog"
  4. In the Mode Settings field, select Enable screen reader mode if you use a screen reader. Select Disable screen reader mode if you do not use a screen reader.
  5. In the Contrast Settings field, select Use high contrast to increase the contrast between objects on the console; otherwise, select Use normal contrast.
  6. In the Font Settings field, select Use large fonts to increase the font size; otherwise, select Use normal fonts.
  7. Click OK.

12.3 Opening and Viewing an Oracle Business Rules Dictionary

When you open Oracle SOA Composer, it connects to MDS and displays the available composite applications that contain dictionaries. In addition, it lists the shared dictionaries, and these shared dictionaries can also be viewed and edited.

As shown in Figure 12-8, Oracle SOA Composer shows a navigation tree that displays a left-side panel with a list of metadata artifacts. Details for the selected item are shown on the right-hand side. Oracle SOA Composer includes the following tabs:

Note:

In SOA Composer, the Verbal Rules and Business Phrases features do not appear if you have not installed BPM.

12.3.1 How to View and Edit Rulesets

Oracle SOA Composer displays the rulesets in the dictionary, as shown in Figure 12-9. You can select a ruleset to display a detailed view of the ruleset. You can add and delete rulesets and rules.

Figure 12-9 Using the Oracle SOA Composer Rules Dictionary Rulesets Tab to View Rules

Description of Figure 12-9 follows
Description of "Figure 12-9 Using the Oracle SOA Composer Rules Dictionary Rulesets Tab to View Rules"

To use the ruleset tab:

For detailed documentation of fields and other UI controls, click Help, Help for This Page from within SOA Composer.

  1. In Oracle SOA Composer, open a Rules file.
  2. Click the Rulesets tab, and click the Create Session button. The action buttons are enabled.
  3. Click the down arrow next to ClaimRules, as shown in Figure 12-9, and choose a Ruleset. The ruleset is displayed and is editable. You can also add or delete rulesets from the toolbar.
  4. Click the Rules panel to add Decision Tables, Verbal Rules, or General Rules. You can also delete, cut, copy, or paste rules.

    For information on adding verbal rules in SOA Composer, see How to Add Verbal Rules in SOA Composer.

  5. When done with changes, click Save Changes in Current Tab. If you are ready to apply the changes to the runtime version, click Publish.

For more information about Decision Tables, see Editing Decision Tables in an Oracle Business Rules Dictionary.

For more information about Verbal and General Rules, see Editing Rules in an Oracle Business Rules Dictionary

For more information about Rulesets, see Working with Rulesets and Rules .

12.3.1.1 How to Add Verbal Rules in SOA Composer

Verbal rules provide a flexible way to author rules using natural language statements to express rule logic in domain specific sentences.

To add verbal rules in SOA Composer:

  1. In Oracle SOA Composer, open a Rules file.

  2. Click the Rulesets tab, and click the Create Session button. The action buttons are enabled.

  3. Select the Ruleset from the drop down list.

  4. Click the Rules panel to add Decision Tables, Verbal Rules, or General Rules.

    To add Decision Tables, see Adding a Decision Table.

    To add Verbal Rules:

    1. Click the Add icon and select Verbal Rules.

      The Verbal Rules window appears.

      Figure 12-10 Verbal Rule window

      Description of Figure 12-10 follows
      Description of "Figure 12-10 Verbal Rule window"
    2. In the If field, add a test. Once done, add an action in the Then field.

      Note that when you add a test or an action, the test or the action becomes editable. Type in a filter in the If field, for example, 'customer number', all related options are displayed in the drop down list.

    3. Use the up/down arrow keys to select and use the right arrow key on the selected option to get similar choices.

      To get more choices in the list, scroll to the end of the drop down list and select the More option by using either keyboard or mouse.

    4. From the list, select existing business phrase or you can instantiate a new business phrase based on what you typed.

      Once a choice is set, the text field is no longer editable and the existing parameters become links. The links when clicked becomes editable. To set the value, double-click the links.

      Note:

      Some of the important keyboard-based interface for Verbal Rules are:

      • Copy: ctrl + c

      • Paste: ctrl + v

      • Cut: ctrl + x

      • Move row up: ctrl + up

      • Move selection up: up arrow

      • Move row down: ctrl + down

      • Move selection down: down arrow

      • Delete row: ctrl + delete

      • Add new row: ctrl + enter

      • Edit row: enter

      Important keyboard gestures for setting parameter values:

      • Avoid having a selected row while specifying parameter values. Since 'enter' makes the selected row editable and you may be trying to set a parameter value.

      • Using the Esc button within the parameter text field converts it back to a link without setting the value.

      • Using tab or entering key values does not make the link editable when its in focus. You must use the mouse or use the enter key to activate the link.

      • To set a parameter value, you can tab out of the parameter text field or press enter.

  5. When done, click Save Changes in Current Tab. If you are ready to apply the changes to the runtime version, click Publish.

To add General Rules, see How to Add General Rules.

12.3.2 How to View and Edit Value Sets

When you open a dictionary and select the Value Sets tab, if the dictionary contains value sets, the table shows all available value sets. Value sets from linked dictionaries are also displayed. You can select a linked value set and click the Edit button to view the values. However, a linked value set is not editable even in the edit mode.

For information on the Oracle SOA Composer edit mode, see Getting Started with Editing a Dictionary.

To view value sets in Oracle SOA Composer:

For detailed documentation of fields and other UI controls, click Help, Help for This Page from within SOA Composer.

  1. In Oracle SOA Composer, open a Rules file.
  2. Click the Value Sets tab, and click the Create Session button. The action buttons are enabled, as shown in Figure 12-11.
  3. Click + and select Value Set to add a value set to the dictionary.
  4. Click + and select Range Value Set to create a range value set.

    Figure 12-11 Using the Oracle SOA Composer Rules Dictionary Value Sets Tab

    Description of Figure 12-11 follows
    Description of "Figure 12-11 Using the Oracle SOA Composer Rules Dictionary Value Sets Tab"
  5. Click + to add values in the table. You can click in a row to make it editable. Selected rows can also be deleted or moved up or down.
  6. The Name, Description, and Data Type cannot be changed only for 'enum' type value sets. They are editable otherwise.
  7. The Include Disallowed Values in Tests controls whether cleared values from the Values list are included in tests.
  8. When done with changes, click Save Changes in Current Tab. If you are ready to apply the changes to the runtime version, click Publish.

12.3.3 How to View and Edit Globals

When you open a dictionary Oracle SOA Composer displays the Globals tab. Globals can be final or not and can be edited in SOA Composer.

For the Value field, you can use the expression builder to set the value. To check for validity, you can click the Validate button.

To view globals in Oracle SOA Composer:

  1. In Oracle SOA Composer, open a Rules file.
  2. Click the Globals tab, and click the Create Session button, as shown in Figure 12-12.

    Figure 12-12 Using the Oracle SOA Composer Rules Dictionary Globals Tab

    Description of Figure 12-12 follows
    Description of "Figure 12-12 Using the Oracle SOA Composer Rules Dictionary Globals Tab"
  3. Click + to add a Global. Enter a Name, Description, and Value.
  4. Choose a Value Set and Type from the drop down.
  5. Check the Final check box to indicate whether the global can be changed at runtime.
  6. Check the Constant check box to indicate if the global is a constant or can be modified.
  7. When done with changes, click Save Changes in Current Tab. If you are ready to apply the changes to the runtime version, click Publish.

12.3.4 How to View and Edit Business Phrases

Use the Business Phrases tab to view and manage business phrases in your rules project.

Note:

In SOA Composer, Verbal Rules and Business Phrases features do not appear if you have not installed BPM.

To edit Business Phrase:

  1. In Oracle SOA Composer, open a Rules file.

  2. Click the Business Phrases tab, and click the Create Session button. The action buttons are enabled, as shown in Figure 12-13.

    Figure 12-13 Using the Oracle SOA Composer Rules Dictionary Business Phrases Tab

    Description of Figure 12-13 follows
    Description of "Figure 12-13 Using the Oracle SOA Composer Rules Dictionary Business Phrases Tab"
  3. Click the action buttons to add, cut, copy or paste.

    To add a Business Phrase, enter the following details:

    1. Phrase - A phrase can be a test or an action. It can be an English phrase, for example, "calculate premium as {threshold} of {percentage}". You can mark the phrase as a draft to edit later by selecting the Make Draft button.

    2. Parameters - You can edit, add, or delete the parameters in the parameters table. You can drag and drop parameters into the phrase field. You can also use the Insert parameter link to drop parameters into the phrase.

    3. Mapping - The mapping section is used to map the business phrase to the internal test/action.

  4. When done with changes, click Save Changes in Current Tab. If you are ready to apply the changes to the runtime version, click Publish.

For more information about business phrases, see Introduction to Verbal Rules and Business Phrases.

12.3.5 How to View and Edit Tests

At runtime, you can use SOA Composer to regression test rules. This enables business users to quickly check if a modified rule changes the existing functionality. The Tests tab only appears if you have a deployed composite and are in a SOA Composer session.

To view and edit tests:

  1. In Oracle SOA Composer, open a Rules file.
  2. Click the Tests tab, and click the Create Session button. The action buttons are enabled, as shown in Figure 12-14.

    Figure 12-14 Using the Oracle SOA Composer Rules Dictionary Tests Tab

    Description of Figure 12-14 follows
    Description of "Figure 12-14 Using the Oracle SOA Composer Rules Dictionary Tests Tab"
  3. You can create and run Test Suites and Test Templates.

    For more information about testing and validating rules at runtime, see Testing Rules in SOA Composer.

  4. When done with changes, click Save Changes in Current Tab. If you are ready to apply the changes to the runtime version, click Publish.

12.3.6 How to View Explorer

To view the Explorer tab:

  1. In Oracle SOA Composer, open a Rules file.
  2. Click the Explorer tab, as shown in Figure 12-15.

    The Explorer tab is used to view the data, its type and description. You cannot make any changes in the Explorer table.

    Figure 12-15 Using the Oracle SOA Composer Rules Dictionary Explorer Tab

    Description of Figure 12-15 follows
    Description of "Figure 12-15 Using the Oracle SOA Composer Rules Dictionary Explorer Tab"

12.3.7 How to View and Edit Facts

To view and edit facts:

  1. In Oracle SOA Composer, open a Rules file.
  2. Click the Facts tab, and click the Create Session button. The action buttons are enabled. Only RL facts can be created in SOA Composer, as shown in Figure 12-16.

    Figure 12-16 Using the Oracle SOA Composer Rules Dictionary Facts Tab

    Description of Figure 12-16 follows
    Description of "Figure 12-16 Using the Oracle SOA Composer Rules Dictionary Facts Tab"
  3. Select a fact and click the Edit Facts button to open the Edit Facts dialog. You can edit RL and XML facts here, but Java and ADFBC facts are read-only.
  4. When done with changes, click Save Changes in Current Tab. If you are ready to apply the changes to the runtime version, click Publish.

12.3.8 How to View Decision Functions

In Oracle SOA Composer, you can view the decision functions that are available to the current dictionary by using the Decision Functions tab. Currently, even in a session, you can only modify the following fields and options:

  • Description

  • Rule Firing Limit

  • Check rule flow

  • Make stateless

  • Available Rulesets to fire

You cannot create any decision function, rename an existing decision function, or add or delete any input or output.

To view decision function names in Oracle SOA Composer:

  1. In Oracle SOA Composer, open a Rules file.
  2. Click the Decision Functions tab.
  3. You can view information on the following tabs: Inputs, Initial Actions, Outputs, and Rulesets Decision Functions as shown in Figure 12-17.

Figure 12-17 Viewing Decision Functions

Description of Figure 12-17 follows
Description of "Figure 12-17 Viewing Decision Functions"

12.3.9 How to View Linked Dictionary Names

In Oracle SOA Composer, you can view the names of the dictionaries to which the current dictionary is linked by using the Links tab as shown in Figure 12-18. Currently, even in a session, you can view the linked dictionary names, but you cannot link to a dictionary or delete an existing link to any dictionary.

To view linked dictionary names in Oracle SOA Composer:

  1. In Oracle SOA Composer, open a Rules file.
  2. Click the Links tab, as shown in Figure 12-18.

    Figure 12-18 Viewing the Linked Dictionary Name

    Description of Figure 12-18 follows
    Description of "Figure 12-18 Viewing the Linked Dictionary Name"
  3. Select to Prefix Linked Names.
  4. When done with changes, click Save Changes in Current Tab. If you are ready to apply the changes to the runtime version, click Publish.

12.3.10 How to Work With Dictionary Links in an Oracle Business Rules Dictionary

An Oracle Business Rules dictionary can be linked to other dictionaries. The complete data model defined by a dictionary and its linked dictionaries is called a combined dictionary. You can create multiple links to the same dictionary. However, in this case, all but the first link is ignored.

You cannot use Oracle SOA Composer to link dictionaries. However, if a deployed composite already has linked dictionaries, using Oracle SOA Composer, you can view the linked dictionary names and make use of the Globals, Value Sets, and Rulesets of the linked dictionaries across applications. For example, you have an application called App1 that contains a dictionary called Dict1. Dict1 is linked to another dictionary called Dict2. Because Dict1 is linked to Dict2, the objects of Dict2 will be available for use in App1.

For more information on viewing linked dictionary names, see How to View Linked Dictionary Names.

In Oracle SOA Composer, you can use the Prefix Linked Names check box in the Links table to either display or hide the linked dictionary name that is prefixed to the all the items in the dictionary such as Globals, Value Sets, and Rulesets. Selecting the check box prefixes facts from the linked dictionary with its dictionary name, and deselecting hides the linked dictionary facts prefix. By default, the Prefix Linked Names check box is in selected state as shown in Figure 12-19.

Figure 12-19 Using the Links Tab

Description of Figure 12-19 follows
Description of "Figure 12-19 Using the Links Tab"

For more information about linked dictionaries, see What You Need to Know About Dictionary Linking.

12.3.11 How to View and Edit Translations

Use the Translations tab to view the phrases included in the selected dictionary and their translated strings.

The translation table contains all translated strings in the current locale as well as earlier locales. For example, the current locale is Japanese and you edit some translations and save them. If you log out, and then log back in with a different locale, for example, English, then the translation table will contain columns for both English and Japanese.

To translate phrases:

  1. In Oracle SOA Composer, open a Rules file.
  2. Click the Translations tab, as shown in Figure 12-20.

    Figure 12-20 Using the Oracle SOA Composer Translations Tab

    Description of Figure 12-20 follows
    Description of "Figure 12-20 Using the Oracle SOA Composer Translations Tab"
  3. When done with changes, click Save Changes in Current Tab. If you are ready to apply the changes to the runtime version, click Publish.

12.4 Getting Started with Editing a Dictionary

When you select and open a dictionary, Oracle SOA Composer shows the dictionary in read-only mode. On each tab in read-only mode, use the Session buttons to make changes and then Save them to a work area. To apply the changes to the runtime version of the dictionary, click Publish.

For more information about how to use SOA Composer features, see Creating and Publishing Sessions.

12.4.1 What You May Need to Know About Localized Number Formatting Support in Oracle SOA Composer

In Oracle SOA Composer, number formatting changes based on the browser locale. For example, you are using Oracle SOA Composer with U.S. English as the browser language. You enter a floating-point data, such as 34533223.2345, as a value. If you wish to view the data in any other language, such as French, you need to:

  1. Modify the browser locale for the instance to French.

  2. Click the Refresh button of the browser to view the number formatting changes

    In French, the value should display as 34533223,2345.

Note:

The grouping and decimal separators specified in Oracle SOA Composer overrides the locale-specific ones.

12.4.2 What You May Need to Know About Cutting/Copying and Pasting Rule Elements

You can cut/copy a value set or rule from one dictionary and open another dictionary in composer and paste it. However, cut/copy/paste works between different dictionaries within the same session.

Cutting/copying and pasting feature enables you to quickly create a new rule element based on an existing one, without having to create the new element from scratch.

The buttons in the Figure 12-21 help you with cut, copy and paste options.

Figure 12-21 Cut, Copy and Paste Buttons

Description of Figure 12-21 follows
Description of "Figure 12-21 Cut, Copy and Paste Buttons"

Oracle SOA Composer enables you to cut/copy and paste the following elements of a rule:

  • Rules

  • Patterns

  • Conditions

  • Actions

  • Value sets

Cut/copy/paste is not supported for the following:

  • Globals

  • Links

  • Values

  • Decision Functions

Note:

The Paste button is disabled if multiple conditions or actions are selected. The button is enabled only on single selected condition/action. When pasting, the copied/cut items are added at the end of the list.

12.4.3 How to Edit Globals in an Oracle Business Rules Dictionary

In Oracle SOA Composer, selecting the Globals tab shows you a table listing the globals in the dictionary, as shown in Figure 12-22. To edit a global, select the appropriate row, and the entire row becomes editable. Make necessary changes as required.

Figure 12-22 List of Globals in the DIctionary

Description of Figure 12-22 follows
Description of "Figure 12-22 List of Globals in the DIctionary"

To add a global, click the Add Global button on the top. A new empty row is added. Make necessary changes to Name, Description, Value, Value Set, Type, Final, Consent. For more information on adding globals, see Working with Oracle Business Rules Globals.

To delete a global, select a row and click the Delete button.

12.4.4 How to Edit Value Sets in an Oracle Business Rules Dictionary

In Oracle SOA Composer, selecting the Value Sets tab displays a master list on the left which displays the value sets in the dictionary, and a detail section with a table that display the values. To edit a value set, click the appropriate Value Set in the master list and then click the value in the detail section that you want to change.

You can create a Range Value Set by clicking the Add button and selecting a type. This adds a new value set in the master list. Adding a range value automatically adds an end point for a range and a value for an LOV based on the datatype. You can modify the newly added value end point or value. Note that the alias is modified when an end point or value is changed.

For more information on adding value sets, see Working with Value Sets and Associating a Value Set with Business Terms.

To cut or copy a value set, select a row and click Cut or Copy. To paste a copied value set, click Paste.

To delete a value set, select a row and click Delete.

To edit Value Sets:

  1. To edit either a Value Set or a Range Value Set, in Oracle SOA Composer select the Value Sets tab. This displays both master and detail sections for the value sets in the dictionary.
  2. Select the appropriate Value Set from the master list. This displays the detail table, as shown in Figure 12-23.

    Figure 12-23 Editing Value Sets

    Description of Figure 12-23 follows
    Description of "Figure 12-23 Editing Value Sets"
  3. Edit the appropriate fields in the table. You can click Add Value to add a value, and also select a row and click Delete Value to delete a value.
  4. To change the order of values in the value set, select a value and then click the up or down arrow to move the selected value.

    You can change the relative position of values in an LOV value set only; you cannot reorder values in a Range value set.

    Only when a value has the Allowed in Actions field selected does the value set display in the condition cell drop down in a Decision Table.

  5. Click Save Changes in Current Tab to confirm the changes.

    Click Validate in the menu bar to validate the dictionary while making changes to a Value Set.

12.4.5 How to Edit Decision Functions in an Oracle Business Rules Dictionary

In Oracle SOA Composer, the Decision Functions tab displays a table listing the decision functions that are available to the dictionary, both parent and linked.

You can only modify the following fields and options:

  • Description

  • Rule Firing Limit

  • Check rule flow

  • Make stateless

  • Initial Actions

  • Rulesets and Decision Functions

To edit a decision function:

  1. To edit a decision function, in Oracle SOA Composer, select the Decision Functions tab. This displays a master list of decision functions on the left, and the detail panel on the right.
  2. Select the appropriate decision function on the left. This displays the Decision Function Editor dialog box as shown in Figure 12-24.

    Figure 12-24 Editing a Decision Function

    Description of Figure 12-24 follows
    Description of "Figure 12-24 Editing a Decision Function"
  3. In the Description field, optionally enter a description.
  4. Enter the required number value from the Rule Firing Limit list. By default, the selected value is unlimited. However, you can enter an integer value for the rule firing limit and press the Tab key. The newly specified value gets added to the Rule Firing Limit list.
  5. Select the appropriate decision function options:
    • Check rule flow: When selected, this option specifies that the rule flow is checked

    • Make stateless: When selected specifies the decision function is stateless.

    You cannot edit the following:

    • Name field

    • Inputs tab

    • Outputs tab

  6. In the Initial Actions tab, you can add actions that could be used to change input facts before they are asserted, change the ruleset stack, set the effective date, or even assert output facts. These actions could be used instead of rules, or to "set up" the environment for running rules. Initial Actions always run just before the inputs are asserted and the rules are run. The RL for the actions will be executed just before the inputs are asserted.

    Consider a situation where a decision function (DF1) calls another decision function (DF2) using the Initial Actions tab. DF1 is configured to push Ruleset1 to the ruleset stack. DF2 is configured to push Ruleset2. In DF1, before the initial actions are executed, Ruleset1 is pushed to the ruleset stack. Then, when DF2 is called, Ruleset2 is also pushed. So when rules start running, rules from both rulesets fire because of the ruleset stack. If you want to push Ruleset2 (because in the initial actions, you are calling DF2), you can use initial actions in DF1 to clear the ruleset stack before calling DF2, and push Ruleset1 on the stack after calling DF2.

    You can add any required action ranging from assert, call, modify to even conditional actions such as if, else, elseif, while, for, if (advanced), and while (advanced).

    The if (advanced) and while (advanced) structs accepts only boolean values. For each of the action conditions, you can add different test form types.

    Note:

    If decision function DF1 contains DF2 in the Rulesets & Decision Functions tab, then DF2 may not have any initial actions.

  7. In the Rulesets & Decision Functions tab, use the left and right arrow buttons to move items from the Available box to the Selected box.
  8. Select an item in the Selected box, and click up or down arrow buttons as appropriate to order the rulesets and the decision functions.
  9. When done with changes, click Save Changes in Current Tab. If you are ready to apply the changes to the runtime version, click Publish.

For more information on decision functions, see Working with Decision Functions.

12.4.6 What You May Need to Know About Oracle Business Rules Dictionary Editor Declarative Component

You can use the Oracle Business Rules Dictionary Editor declarative component to leverage the functionality of editing Rules Dictionaries in any ADF-based Web application. It enables you to edit business rules metadata artifacts, such as Globals, Value Sets, and Rulesets, by using the Rules SDK2 API.

For more information on Oracle Business Rules Dictionary Editor, see "Using the Oracle Business Rules Dictionary Editor Declarative Component" in Developing SOA Applications with Oracle SOA Suite.

12.4.7 What You May Need to Know About Oracle Business Rules Dictionary Editor Task Flow

Rules Dictionary Editor Task Flow, which is a wrapper around the Rules Dictionary Editor declarative component is used in ADF-based Web applications that require a task flow instead of a declarative component.

For more information on Oracle Business Rules Dictionary Editor, see Using the Oracle Business Rules Dictionary Task Flow in Developing SOA Applications with Oracle SOA Suite.

12.5 Editing Rules in an Oracle Business Rules Dictionary

SOA Composer provides an interface to the dictionary that enables you to edit most dictionary components, though you can only create and edit some dictionary components at design-time using the Rules Designer extension to Oracle JDeveloper.

In SOA Composer, Verbal Rules and Business Phrases features do not appear if you have not installed BPM.

12.5.1 Using the Rulesets Tab

Use the Rulesets tab to view and edit Rulesets, and the General Rules, Verbal Rules and Decision Tables they contain, in the currently selected Business Rules dictionary, as shown in Figure 12-25.

Figure 12-25 Using Oracle SOA Composer to Edit a Ruleset in a Dictionary

Description of Figure 12-25 follows
Description of "Figure 12-25 Using Oracle SOA Composer to Edit a Ruleset in a Dictionary"

Table 12-3 Rulesets tab

Button Description

Rulesets drop down

Click and select a ruleset from the list.

This button is described in the surrounding textAdvanced Property Editor

Click to edit properties in the pop-up Advanced Property Editor.

Add Ruleset

Click to add a Ruleset.

Delete Ruleset

Click to delete a Ruleset.

In the Rules master list, you can enter an alias and search for rules. Click Clear to clear the Search by Alias field. You can also sort rules--click the Sort Ascending or Sort Descending arrows to sort the IF/THEN detail panel.

Table 12-4 Rules master list buttons

Button Description

Add

Click to add a new Decision Table, a Verbal Rule, or a General Rule.

Delete

Click to delete.

Cut, Copy, Paste

Click to Cut, Copy, or Paste.

This button is described in surrounding text

Click the Sort Ascending or Sort Descending arrows to sort the IF/THEN detail panel. Click By Type and choose an option to sort by any of these options: Type, Name, Active, Effective Start or End Date, Priority.

Search by Alias

Enter an alias name to search for rules by alias name.

This button is described in surrounding text Clear

Click Clear to clear search results.

12.5.2 How to Edit Rules in an Oracle Business Rules Dictionary

Oracle SOA Composer enables you to edit the rules in a dictionary.

To edit a rule with Oracle SOA Composer:

  1. In Oracle SOA Composer, with an Oracle Business Rules dictionary open, click the Rulesets tab.
  2. Select the appropriate ruleset from the drop down and choose a rule from the list. The rule appears in the detail panel.

    Use the Add, Delete, Cut, Copy, and Paste buttons in the Rules toolbar to modify the rule.

    Note:

    The Paste button is disabled if the selection is multiple. The button is enabled only on single selected condition/action. When pasting, the copied/cut items are added at the end of the list.

  3. When done with changes, click Save Changes in Current Tab. If you are ready to apply the changes to the runtime version, click Publish.

12.5.3 How to Add a Rule

In Oracle SOA Composer you can add rules to a ruleset.

To add a rule in a ruleset:

  1. In a session, the Ruleset tab, select a ruleset of interest.
  2. In the rule area, click Add Rule and select to add either a Decision Table, Verbal Rule, or General Rule.
  3. In the IF area, enter search terms to get results and filter them further by pressing the right arrow to create the condition.
  4. In the THEN area for the rule, click Add Action to add the required action for this rule.
  5. When done, click Save Changes in Current Tab.
  6. If you are ready to apply the changes to the runtime version, click Publish.

12.5.4 How to Delete a Rule

In Oracle SOA Composer you can delete rules in a ruleset.

To delete a rule in a ruleset:

  1. In a session, the Ruleset tab, select a ruleset of interest.
  2. In the rule detail area, locate the rule you want to delete and click Delete.
  3. When done, click Save Changes in Current Tab.
  4. If you are ready to apply the changes to the runtime version, click Publish.

12.5.5 How to Show and Edit Advanced Settings for Rules

In Oracle SOA Composer you can edit advanced settings for rules in a ruleset. For more information on advanced settings, see Using Advanced Settings with Rules and Decision Tables.

To show and edit advanced settings in a rule:

  1. In a session, the Ruleset tab, select a ruleset of interest.
  2. In the rule area and locate the rule you want to show or change advanced settings. Expand the rule first, if necessary.
  3. Click the Advanced Property Editor button next to the rule name. This displays the advanced settings dialog, as shown in Figure 12-26.

    Figure 12-26 Advanced Properties Editor Dialog

    Description of Figure 12-26 follows
    Description of "Figure 12-26 Advanced Properties Editor Dialog"

12.5.6 How to Add Rule Conditions

In Oracle SOA Composer you can add conditions to a rule in a ruleset. Conditions within a rule use a tree representation. Use the toolbar at the top of the conditions tree to add, delete, cut, copy and paste. Within the condition tree, you can select a parent node and perform similar actions.

For more information on working with rule conditions, see Working with Rules.

To add rule conditions:

If no condition is selected, the condition is added at the end. If a condition is selected, a sibling to the selected condition is added.

  1. In a session, the Ruleset tab, select a ruleset of interest.
  2. In the rule area, locate the rule where you want to add a condition.
  3. Next to the existing rule condition, click the down arrow to display a list of options available for adding a condition as shown in Figure 12-27.

    Figure 12-27 Adding a Condition

    Description of Figure 12-27 follows
    Description of "Figure 12-27 Adding a Condition"

    If the rule where you want to add a condition does not contain any existing condition, then you need to click the Add Test down arrow to display a list of available options for adding a condition as shown in Figure 12-27.

The following are some of the available options for adding a condition:

  • simple test: Adds a simple test condition

  • variable: Adds a variable definition. The variable and its value can be represented as an inline business term definition.

  • (...): Adds a new simple test within a nested parenthesis

  • not(...): Adds a new simple test within a NOT nested parenthesis

Each nesting level provides a list with the preceding options to operate on a nested block.

For more information on tests, see How to Work with Extended Tests.

12.5.7 How to Delete Rule Conditions

In Oracle SOA Composer you can delete conditions for a rule in a ruleset. For more information on working with rule conditions, see Working with Rules.

To delete rule conditions:

  1. In a session, the Ruleset tab, select a ruleset of interest.
  2. In the rule area, locate the rule where you want to delete a condition.
  3. Next to the rule condition that you want to delete, click the down arrow, and then click Delete Test from the list.

    A separate list is available for each nesting level. So the delete operation can be performed on a single condition or a nested block.

12.5.8 How to Modify Rule Conditions

Using Oracle SOA Composer, you can edit conditions in a rule. You can select a rule condition for nesting or modify expression values within the condition. For more information on working with rule conditions, see Working with Rules.

To modify a condition in a rule:

  1. In a session, the Ruleset tab, select a ruleset of interest.
  2. In the rule area locate the rule where you want to modify conditions.
  3. In the IF area, use the controls, buttons, and selection boxes, including the Left Value expression button, list for an operator, and Right Value expression button to modify the condition.

    Filtering is supported for expressions. For example, when you type Employee, values are filtered and the values with Employee are displayed in the drop-down. Use mouse or arrow keys to select a value.

You can use the Expression Builder, Condition Browser, Date Browser, and Right Operand Browser to edit the left and right-side expressions.

In addition to modifying the values, you can also change the form type of a condition. For example, a simple test can be changed to variable definition and so on. To change the form type of a condition, you need to select the condition by using the adjacent check box and select the required form type from the Selected Tests list.

12.5.9 How to Add Rule Actions

In Oracle SOA Composer you can add actions to a rule. For more information on working with rule actions, see Working with Rules.

To add rule actions:

  1. In a session, the Ruleset tab, select a ruleset of interest.
  2. In the rule area locate the rule where you want to add an action.
  3. In the THEN area for the rule, next to the rule action click Add Action, as shown in Figure 12-28.

    Figure 12-28 Rule Actions in a Ruleset

    Description of Figure 12-28 follows
    Description of "Figure 12-28 Rule Actions in a Ruleset"

    If the rule to which you want to add an action does not contain any existing action, then you need to click the Add Action button in the THEN area.

12.5.10 How to Delete Rule Actions

In Oracle SOA Composer you can delete actions in a rule. For more information on working with rule actions, see Working with Rules.

To delete rule actions:

  1. In a session, the Ruleset tab, select a ruleset of interest.
  2. In the rule area, locate the rule where you want to delete an action.
  3. In the THEN area for the rule, select the action.

    Click Delete Action.

12.5.11 How to Modify Rule Actions

In Oracle SOA Composer you can modify actions in a rule. For more information on working with rule actions, see Working with Rules.

To modify rule actions:

  1. In a session, the Ruleset tab, select a ruleset of interest.
  2. In the rule area, locate the rule where you want to modify an action.
  3. In the THEN area for the rule you can do the following:
    • Add and delete actions using Add and Delete buttons on the top.

    • Select the action and move it up and down using the respective arrow buttons.

    • Cut, copy and paste using the Cut, Copy and Paste buttons on the top.

    • Click the More link in the drop-down area to launch Select a Target popup and select a value.

    • Click the Edit Properties button next to the rule action and modify properties.

    The Properties dialog box is displayed where you can modify the property details.

12.5.12 How to Work with Advanced Mode Rules

In Oracle SOA Composer, you can work with advanced mode rules in a ruleset.

Note:

Advanced Mode capability has been maintained for backward compatibility only. We recommend that you use extended tests in simple mode to create any kind of condition that you need.

Everything that can be done in Advanced Mode can be done in simple mode. Advanced mode rules can be converted to equivalent simple mode rules simply by clearing the Advanced Mode check box.

For more information, see How to Work with Extended Tests.

To show and modify advanced mode rules:

  1. In a session, the Ruleset tab, select a ruleset of interest.
  2. In the rule area, locate the rule where you want to show or modify advanced mode rules.
  3. Click Advanced Property Editor button to show advanced settings. For more information on showing advanced settings, see How to Show and Edit Advanced Settings for Rules.
  4. If the Advanced Mode check box is not selected, then select the Advanced Mode check box. This shows the advanced mode rule options, as shown in Figure 12-29.

    Figure 12-29 Showing Advanced Mode Rule Options

    Description of Figure 12-29 follows
    Description of "Figure 12-29 Showing Advanced Mode Rule Options"

12.5.12.1 Working with Advanced Mode Options

The Advanced Mode rules options enables you to create, modify, and delete patterns, as well as add, modify, and delete conditions and actions within a pattern.

Using the Advanced Mode rule options, you can:

  • Specify a pattern variable and select a fact type for the variable: You can directly enter the name of the pattern variable in the variable field. You can specify the fact type for the variable by using the fact type list as shown in Figure 12-30.

    Figure 12-30 Specifying Pattern Variable and Fact Type

    Description of Figure 12-30 follows
    Description of "Figure 12-30 Specifying Pattern Variable and Fact Type"

    In the graphic example, CustomerOrder is a pattern variable of CustomerOrder fact type.

  • Add a pattern: Click the Add Pattern button to create a pattern to the existing rule. Figure 12-31 displays an added pattern. The newly created pattern is blank.

    Figure 12-31 Adding a Pattern

    Description of Figure 12-31 follows
    Description of "Figure 12-31 Adding a Pattern"
  • Delete a pattern: Click the Delete Pattern button to delete a pattern from a rule.

  • Specify connectives: Two or more patterns are joined by a connective, and or or. You can use the connective link to toggle between the connectives.

  • Work with nested patterns: A nested pattern has patterns inside it. These are enclosed within curly braces ({}). The pattern operator list is followed by the open curly brace. You can create a nested pattern by clicking Surround pattern with parentheses button and you can remove the pattern nesting by clicking the Remove parentheses from pattern button as shown in Figure 12-32.

    Figure 12-32 Adding and Removing Pattern Nesting

    Description of Figure 12-32 follows
    Description of "Figure 12-32 Adding and Removing Pattern Nesting"

    Inside the open curly brace, you can specify a pattern and then click the Add Test down arrow to add conditions to the nested pattern as well as add another pattern to the same pattern block.

    A nested pattern block ends with a closing curly brace. You can have multiple levels of nested patterns, which means that inside a nested pattern, you can have another nested pattern. You can click the Delete Nested Pattern Block button to remove the entire nested pattern block.

    When you nest a pattern, an operator list is displayed with (for each case where) selected as the default operator in the operator list. The other items are there is a case where, there is no case where, and aggregate and so on.

    The user interface remains the same as (for each case where) when you select there is a case where or there is no case where as the operator. However, when you select aggregate, the user interface changes. For an aggregate operator, you must enter a variable in the available field and select a function from the function list. The function list displays the following:

    • count

    • average

    • maximum

    • minimum

    • sum

    • collection

    Except for the count function, all the other functions require an expression. You can specify an expression in the available field or launch the Condition Browser window.

In the Advanced Mode of rules, in the THEN part, you can add any required action ranging from assert, call, modify to even conditional actions such as if, else, elseif, while, for, if (advanced), and while (advanced.

12.5.13 How to Work with Extended Tests

Extended tests should be used when building complex rules. Extended tests, or Simple Mode, replaces Advanced Mode rules.

Note:

Advanced Mode capability has been maintained for backward compatibility only.

Everything that can be done in Advanced Mode can now be done in Simple Mode. The UI has been streamlined and improved to enable you to more easily create complex rules and tests, as shown Figure 12-33

Figure 12-33 List of Extended Tests

Description of Figure 12-33 follows
Description of "Figure 12-33 List of Extended Tests"

Advanced mode rules can be converted to the equivalent simple mode rules by clearing the Advanced Mode check box in the Advanced Property Editor.

Extended tests are only applicable to general rules, decision tables, and while defining business phrases. They are not visible in verbal rules.

In addition to the original four tests (shown first in Table 12-5) there are new forms:

Table 12-5 Extended Tests

Forms Description

simple test

This is the building block for conditions. Compares a value against another value, range or set.

For example: Emp.salary > 1000

variable

Initializes variables.

For example: age = Duration.years between(Emp.birthdate,RL.date.get current())

nested test

Encapsulates tests in a containing block.

For example: (age > 50 or Emp.salary > 50000)

negated test

Negates a test.

For example: not(age > 50 and Emp.salary > 50000)

all of the following

all of the following are true.

For example: (age > 50 and Emp.salary > 50000)

any of the following

some of the following are true.For example:

IF
  e is a Emp and  there is no Emp where     Emp.salary < e.salary     <insert test>  <insert test>THEN  assign e.isLowestPaid = true

is a

Defines a fact.

For example: e is a Emp

there is a case where

This test has 1 or more child tests that are ANDed.

The child tests are all true for at least 1 case. A case is a binding of facts to contained is a tests.

Must have is a descendant.

Example:

There is a case where
e is a Emp and
d is a Dept and
e.salary > 1000000 and
d.name == "Marketing" and
d.employees contains e

there is a <factType1>,...<factTypeN> where#*

This test has N or more child tests that are ANDed

Hidden <factType> is a <factType> tests as first N children.

The child tests are all true for at least 1 case.

It is legal to have no visible child tests, in which case the where keyword should be suppressed.

Example:

IF
  there is a Emp, Dept where
  Emp.salary > 1000000 and
  Dept.name == "Marketing" and
  Dept.employees contains Emp
THEN 
 call print "there is a highly paid marketer!"
IF  
  there is a Emp
THEN  
  call print "somebody works here!"

there is no case where

This test has 1 or more child tests that are ANDed.

The child tests are true for no case (no binding of facts to contained is a tests satisfy all the other tests).

Must have is a descendant.

there is no <factType1>,...,<factTypeN> where

Hidden <factType> is a <factType> as first N children

The child tests are true for no case

aggregation

This test has 0 or more child tests that are ANDed.

Must have is a child (may be hidden).

v is the sum|average|minimum|maximum|count|collection of <expression> where

Where clause omitted when there are no visible child tests.

IF
  number of employees is the count of Emp
THEN
  call print "number of employees: " + number of employees
 
IF
  number of male employees is the count of Emp where
  Emp.gender == "M"
THEN
  call print "number of male employees: " + number of male employees

Note that in both rules above, the SDK will create a hidden nested is a test for Emp.

You can also use an explicit is a

IF
  number of male employees is the count of e where
    e is Emp and
    e.gender == "M"
THEN
  call print "number of male employees: " + number of male employees

boolean expression

Captures a boolean expression.

For example: isEligible(Emp)

Figure Figure 12-34 shows an example of "there is a case where" form:

Figure 12-34 Extended Test Example 1

Description of Figure 12-34 follows
Description of "Figure 12-34 Extended Test Example 1"

Figure Figure 12-35 shows an example of "there is no case where" form:

Figure 12-35 Extended Test Example 2

Description of Figure 12-35 follows
Description of "Figure 12-35 Extended Test Example 2"

For information about how to build complex rules, see How to Add Rule Conditions.

For more information about Advanced Mode, see How to Work with Advanced Mode Rules.

12.5.14 How to Work with Tree Mode Rules

In Oracle SOA Composer you can work with tree mode rules in a ruleset. For more information on working with tree mode rules, see Working with Tree Mode Rules.

To show and modify tree mode rules:

  1. In a session, the Ruleset tab, select a ruleset of interest.
  2. In the rule area locate the rule where you want to show or modify tree mode rules.
  3. Select Advanced Property Editor button to show advanced settings.
  4. If the Tree Mode check box is not selected, then select the Tree Mode check box. This shows the tree mode rule options, as shown in the ROOT area in Figure 12-36.

    Figure 12-36 Showing the Tree Mode Rule Area in a Rule

    Description of Figure 12-36 follows
    Description of "Figure 12-36 Showing the Tree Mode Rule Area in a Rule"

12.5.15 What You May Need to Know About Oracle Business Rules Editor Declarative Component

You can use the Oracle Business Rules Editor composite declarative component to leverage the functionality of editing business rules in any ADF-based Web application. It enables you to edit business rules available in rulesets by using the Rules SDK2 API.

For more information on Oracle Business Rules Editor, see Using the Oracle Business Rules Editor Declarative Component in Developing SOA Applications with Oracle SOA Suite.

12.5.16 What You May Need to Know About Oracle Business Rules Dictionary Editor Declarative Component

The Oracle Business Rules Dictionary Editor is a composite declarative component that can be embedded in any ADF-based web application. It enables you to edit business rules metadata artifacts, such as globals, value sets, and rulesets, by using the Rules SDK2 API.

For more information on Oracle Business Rules Dictionary Editor, see Using the Oracle Business Rules Dictionary Editor Declarative Component in Developing SOA Applications with Oracle SOA Suite.

12.5.17 What You May Need to Know About Oracle Business Rules Dictionary Editor Task Flow

The Oracle Rules Dictionary Editor Task Flow is basically a wrapper around the Rules Dictionary Editor declarative component. The task flow is used in ADF-based web applications that require a task flow instead of a declarative component.

For more information on Oracle Business Rules Dictionary Editor Task Flow, see Using the Oracle Business Rules Dictionary Editor Task Flow in Developing SOA Applications with Oracle SOA Suite.

12.6 Using the Oracle SOA Composer Browser Windows

Oracle SOA Composer provides browser windows that helps you to work with different types of expressions such as rule expressions, XPATH expressions, date expressions, and so on.

The different types of browsers provided by Oracle SOA Composer are:

12.6.1 Expression Builder

Expression Builder is used to build different types of expressions such as XPATH expressions, rule expressions, and so on.

Expression Builder has a field where you can enter the expression directly. It has four tabs: Variables, Functions, Operators, and Constants. Each of these tabs display data in a tree structure. The Variables tab displays all the variables in the rules meta-data. The Functions tab displays all the functions in the rules meta-data. The Operators tab displays operators such as +, -, *, and so on. The Constants tab displays all the constants that exist in the rules meta-data.You can switch between the tabs, select an item in the tree, and click the Insert Into Expression button to insert the selected item at the cursor position in the expression field. When an item is selected in the tree, the Content Preview and the Description areas display more information about the selected item. Once you create the expression and click OK, the newly created expression appears in the field that is available to the left of the expression builder button.

Figure 12-37 displays the Expression Builder browser.

Figure 12-37 The Expression Builder Browser

Description of Figure 12-37 follows
Description of "Figure 12-37 The Expression Builder Browser"

12.6.2 Condition Browser

The Condition Browser has a field, a hierarchical tree, and an Expression Builder embedded inside it. You can enter the expression directly in the field, or select an item from the tree. Condition Browser supports filtering. For example, when you start entering customer the tree is narrowed down to items with customer.

When an item is selected in the tree, the new selection appears in the field immediately. You can also use the embedded Expression Builder to create an expression.

Once the Expression Builder is launched and an expression is created, the new expression appears in the Condition Browser field. Once you create an expression and click the OK button in the Condition Browser, the newly created expression appears in the field that is to the left of the Condition Browser button.

Figure 12-38 displays the Condition Browser.

Figure 12-38 The Condition Browser

Description of Figure 12-38 follows
Description of "Figure 12-38 The Condition Browser"

12.6.3 Date Browser

The Date Browser is used to select a Literal Date or a Date Expression. The Date Browser has two options to switch between a Literal Date and a Date Expression. When one option is selected, the other one is disabled.

Select:

  • Literal Date option to enter a date using a Calendar pop-up.

  • Date Expression option to enter the expression directly in the Date Expression field or to launch the Condition Browser to select a date expression.

Figure 12-39 displays the Date Browser.

Figure 12-39 The Date Browser

Description of Figure 12-39 follows
Description of "Figure 12-39 The Date Browser"

12.6.4 Right Operand Browser

The Right Operand browser is used to select multiple right expressions. The browser displays operands in each row. You can enter an expression directly in the operand field or launch the Condition Browser to select an expression. The + button adds a row after the current one. The - button deletes the current row. These buttons are enabled and disabled based on the selected operator. For instance the in operator allows multiple right expressions. So in this case, the buttons are enabled.

Figure 12-40 displays a Right Operand browser.

Figure 12-40 The Right Operand Browser

Description of Figure 12-40 follows
Description of "Figure 12-40 The Right Operand Browser"

Note:

Using Right Operand browsers, you can enter multiple values for the right-side expression. However, you can place a Date browser outside a Right Operand browser, and in which case, only one expression can be entered. For both these browsers, you cannot enter values directly in the right-side expression field. Once you have entered values using the browser and clicked OK, the values get added as comma-separated values on the Rules UI.

12.7 Editing Decision Tables in an Oracle Business Rules Dictionary

When Oracle SOA Composer is in a session, you can edit, add, and delete a Decision Table in a ruleset.

For more information on how to use sessions, see Creating and Publishing Sessions.

You can edit the description of a rule/condition or action within a decision table. If you hover over a condition, a right arrow is used to select the condition. If you click on the condition value, a pop-up appears where you can edit the description.

12.7.1 Adding a Decision Table

In Oracle SOA Composer, you can add a Decision Table to a ruleset. For more information on working with Decision Tables, see Introduction to Working with Decision Tables.

To add a Decision Table in a ruleset:

  1. In a session, select a ruleset of interest.
  2. In the ruleset area, click Add and then Add Decision Table, as shown in Figure 12-41. An empty Decision Table appears.

    Figure 12-41 Adding a Decision Table in a Ruleset

    Description of Figure 12-41 follows
    Description of "Figure 12-41 Adding a Decision Table in a Ruleset"

12.7.2 Adding Condition Rows to a Decision Table

Using Oracle SOA Composer, you can add condition rows to a Decision Table.

To add condition rows to a Decision Table:

  1. In the Decision Table toolbar, from the list next to the Add button, select Add Condition that displays the Condition Browser window where you can specify or select conditions.

    The selected or specified condition row and a Rules column with the header R1 is added to the table; the cell below R1 has a "?" symbol (Figure 12-42). The "?" symbol indicates that the cell does not have a value yet.

    Figure 12-42 New Condition Row Added in a New Decision Table

    Description of Figure 12-42 follows
    Description of "Figure 12-42 New Condition Row Added in a New Decision Table"

    If you are adding a condition to a table that has existing condition rows, similar to adding a condition to a blank Decision Table, Oracle SOA Composer prompts for specifying the condition details. Once the details are provided, the specified condition is added as the last condition row; the condition cells under each rule column in the new row also have "?" symbols.

    Figure 12-43 New Condition Row Added As Last Row in a Decision Table

    Description of Figure 12-43 follows
    Description of "Figure 12-43 New Condition Row Added As Last Row in a Decision Table"

    For information about all symbols that might be used in a decision table, see Editing Decision Table Cells.

  2. If you want to edit a specified condition, in the Conditions area, click the condition row, and then click the Edit Condition button on the toolbar. This displays the Condition Browser.
  3. Enter an expression by clicking in the Conditions Browser to select a variable, or click the Expression Builder button to display the Expression Builder.

    Expression Builder lets you build expressions.

  4. Each condition row requires a value set from which to draw the values for each cell. When the value you select has an associated global value set, then by default the value set is associated with the condition row.

    If there is no global value set associated with the value, then after you add a condition row to a Decision Table, you need to either specify an existing global value set or create a Local List of Values or a Local List of Ranges value set.

    To associate a value set for the condition, perform either of the following:

    • In the Conditions area, select the condition, and select an existing value set from the Select Value Set list.

    • In the Conditions area, select the condition, and select either Local List of Values or Local List of Ranges (as relevant) from the Select Value Set list.

    You can edit the value set for the selected condition by clicking the Edit Value Set button.

    This displays the Value Set Editor where you can add, edit or delete values. If editing a Local List of Values value set, you can also reorder values in the value set.

    For more information on number formatting in value sets, see What You May Need to Know About Localized Number Formatting Support in Oracle SOA Composer.

  5. Repeat Step 2 through Step 5, as required to add additional condition rows in the Decision Table.

For more information on adding condition rows, see How to Add Condition Rows to a Decision Table.

12.7.3 Adding Actions to a Decision Table

In Oracle SOA Composer, you can add actions to a Decision Table.

To add actions to Decision Table:

  1. From Oracle SOA Composer, select a ruleset from the Rulesets navigation tab and select the Decision Table where you want to add actions.
  2. From the list next to the Add button, select Add Action and select an available action from the list. For example, click Modify as shown in Figure 12-44.

    Figure 12-44 Adding Actions to a Decision Table

    Description of Figure 12-44 follows
    Description of "Figure 12-44 Adding Actions to a Decision Table"

    Table 5-1 in Working with Decision Tables, lists the available actions.

  3. In the Action Editor window, select the action target and then specify values for an action cell.

    For more information on number formatting in value sets, see What You May Need to Know About Localized Number Formatting Support in Oracle SOA Composer.

For more information on adding actions to Decision Tables, see How to Add Actions to a Decision Table.

12.7.4 Adding Rules to a Decision Table

Using Oracle SOA Composer, you can add a rule to a Decision Table.

To add a rule to a Decision Table:

  1. In a session, select a ruleset of interest, select the Decision Table where you want to add the rule.
  2. In the Rules master list, select the Decision Table where you want to add the rule. Next to the Add button in the detail section, select Add Rule.

    A new column for the added rule is displayed.

    Notice that the new rule is added as the first rule of the Decision Table and the other rules have moved as required to keep the values in their defined order. This is because Order Rules By Bucket is enabled by default, which means rule ordering in a Decision Table is set according to the relative position of values associated with a condition expression. If Order Rules By Bucket is not enabled when you add a rule, the new rule is added as the last rule of the Decision Table. In either case, the cells in the new rule column have "?" symbols, indicating the cells do not have values yet.

    For information about all symbols used in a table, see Editing Decision Table Cells. For additional information about rules ordering, see Controlling the Order of Rules in a Decision Table.

  3. Enter values for the condition cells by clicking the cells.
  4. Click an Action row to enter values for the action cells.

Note:

If because of the inadequate column width, you cannot view the complete contents of a cell in a Decision Table, you can roll your mouse pointer over the cell to view the contents. Also, click the Maximize tabs section button in the toolbar to increase the view.

12.7.4.1 Editing Decision Table Cells

Each rule in a Decision Table contains cells pertaining to three sections: Conditions, Conflicts, and Actions.

Working with Condition Cells

In view mode, a condition cell with a "?" symbol indicates that the cell does not have a condition value. If a cell has two or more values specified, a semicolon-separated list of values is displayed in the cell.

In the editable mode the condition cells display specified condition values in multichoice lists. When editing a new rule or when a condition value is unspecified, the condition cell is blank.

If you select All:

  • When the particular condition cell is clicked, the cell displays "All"

  • When the particular condition cell is not selected, the cell displays the "-" symbol

You can select any value that is available in the condition value list.

Note:

When you edit the condition cells, if Order Rules By Bucket is selected, the Decision Table is refreshed and the edited rule column may shift to the left or right depending on the selected condition cell value. Click the Tools drop down to select Order Rules By Bucket.

Note:

You can modify the value set associated with a a condition, by clicking the condition. This enables the value set list and the Edit Value Set button so that you can edit the associated value set.

Working with Action Cells

When you add an action, an action row is created with the specified action type. There are two types of action cells:

  • The Action form cells contain check boxes. When a rule fires, only selected actions are executed. In Figure 12-45, R1 and R3 action check boxes are selected whereas the other action check boxes are cleared. In this case, if R1 fires, the action will be executed, but if R2 fires, then the action will not be executed.

    Note:

    The Edit Action button is enabled only if the action form cell row is selected. The Edit Action button invokes the Action Editor window.

  • The Action parameter cells contain the parameters of the action form. You can directly enter the action parameter values in the respective field or you can invoke the Condition Browser window to select a value.

Figure 12-45 displays the Action Editor window where you can select the values for an action parameter cell. If you select the Always Selected check box, all the check boxes for the particular action form get selected. All the check boxes pertaining to the action form are also disabled, because the specified action "is always selected".

Figure 12-45 The Action Editor Window

Description of Figure 12-45 follows
Description of "Figure 12-45 The Action Editor Window"

Note:

You can delete all the condition cells and all the action cells of a Decision Table at one go. Clicking the Conditions or the Actions box selects all the conditions or actions in the Decision Table respectively.

You can then click the Delete button on the Decision Table toolbar to delete the conditions or actions.

12.7.4.2 Controlling the Order of Rules in a Decision Table

By default the Order Rules by Bucket check box is enabled in a Decision Table. This means the order of the values in the value set associated with a condition row determines the order of the condition cells, and thus the order of the rules. Click the Tools drop down to select Order Rules By Bucket.

To change the order of rules in a Decision Table, you need to change the order of values in the value set. For example, you can control rule ordering in a Decision Table by changing the relative position of the values in an LOV value set associated with a condition row. Note, however, that you cannot reorder range value sets.

When the Order Rules by Bucket check box is selected in a Decision Table and you add a rule, by default the new rule is added as the first rule column; the other rule columns move as required to keep the value set values in their defined order. When the Order Rules by Bucket check box is not enabled and you add a rule, the new rule is added as the last rule column. If you now select the Order Rules by Bucket check box, the newly added rule shifts to the first column.

12.7.5 Deleting Rules in a Decision Table

You can delete one or multiple rules in a Decision Table.

To delete rules in a Decision Table:

  1. Select the rules column that you want to delete.

    If you want to delete more than one rule, press the Ctrl key, and by keeping the key pressed, select the other rule columns

  2. Click the Delete button.

12.7.6 Defining Tests in a Decision Table

In Oracle SOA Composer, you can define tests in a Decision Table by adding conditions to facts. For more information about defining tests and working with rule conditions, see Working with Rules.

Note:

To add more complex conditions to facts, see How to Work with Extended Tests.

To add tests to a Decision Table:

  1. From Oracle SOA Composer, select a ruleset from the Rulesets navigation tab and select the Decision Table where you want to add a test.
  2. Click the Advanced Properties Editor button next to the Decision Table name. If Advanced Mode is selected, clear the check box.
  3. Click the Click to view tests and variables link under the Decision Table name.
  4. Click the down arrow next to the Add button and select any of the options according to your requirements.
  5. Use the field controls or Left Value and Right Value buttons, and the operator list to create the condition expression.

    Note:

    If a Decision Table already contains test conditions, you can add new test conditions by clicking Add at the end of an existing condition and selecting the required test form type.

12.7.7 Splitting and Compacting a Decision Table

You can modify the contents of a Decision Table to create a table that includes a complete set of rules for all cases, or a table that provides the least number of rules for the cases. The split and compact operations enables you to manipulate the contents in a Decision Table.

The split table operation creates a rule for every combination of values across the conditions. For example, in a Decision Table with 2 boolean conditions, 2 x 2 = 4 rules are created. In a Decision Table with 20 boolean conditions, 2**20 ~ 1 million rules are created. So, you only use split table when the number of rules created is small enough that filling in the action cells is feasible.

Using Oracle SOA Composer, split can be applied to an entire Decision Table. However, you cannot perform split operation on an individual condition row or cell.

To split or compact a Decision Table:

  1. From Oracle SOA Composer, select a ruleset from the Rulesets navigation tab and select the Decision Table that you want to split or compact.
  2. Click the Split Table button or Compact Table button on the Tools drop down.

Using Oracle SOA Composer, you can compact a Decision Table by merging conditions of rules with identical actions. So, compacting a table enables you to remove conditions from a Decision Table. However, using Oracle SOA Composer, you cannot merge two or more condition cells.

For more information on splitting and compacting Decision Tables, see Introduction to Decision Table Operations.

12.7.8 Checking for Missing Rules in a Decision Table

In a Decision Table, a missing rule is also called a "gap." A gap in a Decision Table occurs when a rule does not cover some combinations of values, one from each condition.

Using Oracle SOA Composer, you can check for missing rules in Decision Tables.

To check for missing rules:

  1. From Oracle SOA Composer, select a ruleset from the Rulesets navigation tab and select the Decision Table in which you want to check for missing rules.
  2. Select Gap Analysis from the Tools drop down.

    The Gap Analysis window is displayed as shown in Figure 12-46. You can select the rules that need to be added to the Decision Table.

    Figure 12-46 The Gap Analysis Window

    Description of Figure 12-46 follows
    Description of "Figure 12-46 The Gap Analysis Window"

For more information about checking for missing rules, see How to Perform Decision Table Gap Checking.

12.7.9 Performing Conflict Resolution in Decision Tables

Rules in a Decision Table can conflict when they overlap and have different actions. Two rules overlap when at least one of their condition cells has a value in common. However, overlap without conflict is common and harmless. For more information about conflicts in Decision Tables, see Understanding Decision Table Conflict Analysis.

Using Oracle SOA Composer, you can find and resolve conflicts in a Decision Table.

To perform conflict resolution in a Decision Table:

  1. From Oracle SOA Composer, select a ruleset from the Rulesets navigation tab and select the Decision Table on which you want to perform the Conflict Resolution.
  2. Ensure that the Show Conflicts button is selected on the Tools drop down.
  3. Click the Advanced Property Editor button next to the Decision Table name.
  4. Ensure that Conflict Policy is set to Manual in the Advanced Settings area. This is the default conflict policy.

    Note:

    For more information on conflict policies, see Understanding Decision Table Conflict Analysis.

  5. Select the Conflict row and then click the rule that has a conflict to display the Conflict Resolution window.
  6. In the Conflict Resolution window, for each conflicting rule, in the Resolution field select a resolution from the list and click OK as shown in Figure 12-47.

    Figure 12-47 Conflict Resolution Dialog

    Description of Figure 12-47 follows
    Description of "Figure 12-47 Conflict Resolution Dialog"

    For more information about the conflict resolution options in Decision Tables, see Understanding Decision Table Conflict Analysis.

12.7.10 Switching From Rows to Columns

In Oracle SOA Composer, you can turn the rows in a Decision Table to columns by clicking the Switch Rows to Columns link in the detail area. This enables the rules to be displayed as rows, and the conditions, actions, and conflicts to be displayed as the columns.

Switching rows to columns provides ease of navigation when a Decision Table has many rules because you can see all the rules together and you do not need to "page the columns" for viewing the rules.

Figure 12-48 displays a Decision Table before the switch operation.

Figure 12-48 A Sample Decision Table

Description of Figure 12-48 follows
Description of "Figure 12-48 A Sample Decision Table"

Figure 12-49 displays the sample Decision Table after switching the rows to columns.

Figure 12-49 Switching Rows to Columns

Description of Figure 12-49 follows
Description of "Figure 12-49 Switching Rows to Columns"

12.7.11 Working with Advanced Mode Options in a Decision Table

In Oracle SOA Composer, you can use advanced mode rules in a Decision Table just like you can work with advanced mode rules in a ruleset. The Advanced Mode rules options enable you to create, modify, and delete patterns, as well as add, modify, and delete conditions and actions within a pattern.

Note:

Advanced Mode capability has been maintained for backward compatibility only. We recommend that you use extended tests in simple mode to create any kind of condition that you need.

Everything that can be done in Advanced Mode can be done in simple mode. Advanced mode rules can be converted to equivalent simple mode rules simply by clearing the Advanced Mode check box.

For more information, see How to Work with Extended Tests.

To show and use advanced mode options:

  1. From Oracle SOA Composer, select a ruleset from the Rulesets navigation tab and select the Decision Table on which you want to add more complex rules.
  2. Click the Advanced Property Editor button next to the Decision Table name.
  3. Select Advanced Mode.

    The advanced mode options in a Decision Table are similar to the advanced mode options in a ruleset. For more information, see Working with Advanced Mode Options.

12.7.12 Deleting a Decision Table

In Oracle SOA Composer, you can delete Decision Tables in a ruleset. For more information on working with Decision Tables, see Introduction to Working with Decision Tables.

To delete a decision table in a ruleset:

  1. In a session, select a ruleset of interest.
  2. In the Rules master list, click the Decision Table you want to delete.
  3. Click Delete.
  4. When done with changes, click Save Changes in Current Tab. If you are ready to apply the changes to the runtime version, click Publish.

12.7.13 Editing Decision Tables in Microsoft Excel

Business users may find that editing Decision Tables is easier to do in Microsoft Excel. New functionality enables both developers and business users to export and edit Decision Tables in Excel and then import the Decision Tables back into the dictionary.

When exporting Decision Tables in Microsoft Excel, only basic Action types such as Assert New, Modify, Assign, Retract, and Call are supported.

You can export and edit Decision Tables at design-time in Oracle JDeveloper or Business Process Composer. At runtime, you can export and edit in SOA Composer. You can export one or more Decision Tables from a Rule dictionary to the same Excel workbook.

When you import back into the dictionary, you can create a new dictionary, overwrite the existing dictionary, or perform a Diff-Merge. The Diff-Merge enables you to compare dictionaries.

For more information about comparing dictionaries, see Comparing and Merging Oracle Business Rules Dictionaries.

The Excel workbook structure consists of several worksheets: a Readme sheet, a Value Set sheet, and one sheet for each exported Decision Table, as shown in Figure 12-50. Only Rules and Value Sets can be edited in Excel. You can export to .xlsm (default) or .xls.

When you open the spreadsheet, the macros are disabled by default. If you enable the macros, a new tab called Oracle Business Rules, appears. This tab enables you to add or delete rules, merge or split cells, and add or remove values from value sets. You can also disable or enable highlighting, use a simple or advanced mode and hide or show the Readme sheet.

You can edit with the macros disabled, though you will not be able to:

  • Choose values from drop lists for restricted cells.

  • Edit free form cells.

  • Copy and paste a range of cells to add a rule or Value Set.

  • Delete a range of cells to delete a rule or Value Set.

  • Split or merge cells.

  • Create Value Sets automatically.

  • Validate the structure of Decision Tables or Value Sets.

Using the predefined macros, you can:

  • Add and delete rules.

  • Split or merge cells.

  • Add or delete Value Sets.

  • Editable cells include:

    • Description for Rules, Conditions, Actions.

    • Condition and Action nodes.

    • Action state.

    • Parameterized options for Action parameters.

  • Non-editable cells include:

    • Condition expressions.

    • Action expressions.

    • Action parameters.

    If you try to edit these cells, you will get an error message, as shown in Figure 12-51.

    Figure 12-51 Non Modifiable Cell

    Description of Figure 12-51 follows
    Description of "Figure 12-51 Non Modifiable Cell"

12.7.13.1 Understanding What is Exported

In the SDK, there are shared Value Sets that can be associated with multiple conditions across Decision Tables. However, in Excel there are no shared Value Sets--each condition has its own Value Set--so you can only export a Value Set if it is modifiable in Excel. The Value Sets that are non-modifiable include:

  • Linked Dictionary Value Sets.

  • Enums.

  • Internal Value Sets, for example, boolean Value Sets.

In the worksheet, you can only select values from the drop down for the conditions associated with non-modifiable Value Sets. A highlighting mechanism informs you which conditions are associated with non-modifiable Value Sets.

12.7.13.2 How to Export Decision Tables

The export functionality is invoked by using the Export to Excel button in the toolbar options, as shown in Figure 12-52.

Figure 12-52 Actions Toolbar

Description of Figure 12-52 follows
Description of "Figure 12-52 Actions Toolbar"

To export to Excel:

  1. In SOA Composer, in a session, click Actions, Export to Excel.
  2. In the Export Decision Tables dialog box, select the Format and browse to the folder where you want to save the worksheet.
  3. Select the Decision Table to export and click OK.
  4. Check the Read Only Value Set check box to make all of the value sets read-only in Excel. There will not be any Value Sets sheet in the Excel workbook. All conditions will have drop down menus from which values can be selected but no values can be added or removed.
  5. Click Export. You can now open the worksheet and edit the Decision Table.

12.7.13.3 How to Import Decision Tables to the Dictionary

You can only import Excel spreadsheets that have been previously exported.

To import edited Decision Tables back to the Dictionary:

  1. In Rules Designer, click Actions, Import from Excel.
  2. In the Import Decision Tables dialog box, click Browse to browse to the folder where you saved the worksheet.
  3. The Diff-Merge check box is selected by default. For more information about using the Diff-Merge, see Comparing and Merging Oracle Business Rules Dictionaries. Select Create New or Overwrite depending on your requirements.
  4. Click Import. The decision table is imported into Rules Designer, where you can accept or reject changes. Each changed artifact is flagged with a change icon.

Note:

Merges should be done with caution. See Comparing and Merging Oracle Business Rules Dictionaries

12.7.13.4 How to Edit Decision Tables in Excel

In Excel, enable the macros to view the Oracle Business Rules tab, which provides you with options to author rules, edit Value Sets, and set preferences.

For more information, see Editing Decision Tables in Microsoft Excel.

12.7.14 What You Need to Know About Rule Test Variables

Oracle SOA Composer enables you to define test variables that provide a way to shorten lengthy expressions that occur in rule and decision table conditions and actions. The variable and its value can be represented as an inline business term definition. The test variables are also called inline aliases.

So, instead of writing:

You can write:

In subsequent test conditions, you can use foo as part of your expressions. The expression can be anything from a simple to a complex expression.

To define a variable, in the IF section of a rule, you need to click the down arrow adjacent to Add Test, and select variable from the list.

Apart from variables, you can also define other test form types, such as simple test, nested tests ((...)), and not nested tests (not (...)).

12.8 Comparing and Merging Oracle Business Rules Dictionaries

The Diff Merge feature enables you to review any differences in the latest revision of a dictionary against a previous revision and be able to save or roll back any changes since then. At runtime, in SOA Composer, you can use the Diff Merge feature to compare the File-System, Published Version, or the Saved Version to the dictionary that you have open.

SOA Composer only supports the compare of the edited version with one prior saved version and the ability to select items that have changed since the saved version and to revert them back to their saved values. The differences are viewed from the perspective of the latest revision.

The Merge feature enables you to review any differences between the two versions and be able to resolve or merge the differences among them. The differences are viewed from the perspective of the changed versions.

The Diff Dictionary option is available in the Rules Designer toolbar, as shown in Figure 12-53.

Figure 12-53 Actions Drop Down List

Description of Figure 12-53 follows
Description of "Figure 12-53 Actions Drop Down List"

WARNING:

Before you decide to run this feature, you must be ready to resolve all changes because the dictionary becomes read-only when in diff or merge mode.

Merging dictionaries should be done with care.

12.8.1 How to see Differences Between Dictionaries

When you want to compare dictionaries, you have the newer dictionary opened and then use the Diff Merge to select the dictionary to compare with. Anything missing from the newer dictionary is flagged as a deletion from the newer version.

To see differences between dictionaries:

  1. In SOA Composer, with the newer dictionary open, click Actions, Diff Merge.

    The Dictionary version dialog appears, as shown in Figure 12-54.

    Figure 12-54 Dictionary Version dialog

    Description of Figure 12-54 follows
    Description of "Figure 12-54 Dictionary Version dialog"
  2. In the Select Dictionary field, select one of the Dictionary version to compare.
    • File-System - File-system version give users an option to compare the rules file available on the local file system against the rules file of the composite deployed on the server.

    • Published Version - Published version is the composite versions which changes when versions change.

    • Saved Version - Saved version is the composite version which changes when versions change.

  3. Click OK to open the dictionary that you want to compare with.

    All differences between the two dictionaries are flagged with change icons.

    The change icons are shown for all tabs and for the specific artifacts within each tab. An example is shown in Figure 12-55.

    Figure 12-55 Merging or Reverting Changes

    Description of Figure 12-55 follows
    Description of "Figure 12-55 Merging or Reverting Changes"
  4. Click Keep to retain the changes or select Revert to discard the changes made.

    You may click each tab and decide to keep or revert the changes.

  5. Alternatively, you can choose to Accept All or Reject All in the Actions drop down list to accept or reject all the changes on one click.

    Figure 12-56 Accept All or Reject All from the Actions Drop Down

    Description of Figure 12-56 follows
    Description of "Figure 12-56 Accept All or Reject All from the Actions Drop Down"

The Diff Merge feature is more fully functional in JDeveloper Rules Designer. For more information, see How to Compare or Merge Two or More Dictionaries.

12.9 Localizing Names of Resources in Oracle Business Rules

Oracle BPM allows you to localize the names of some rules components.

Providing a translated version of these aliases enables users to view these aliases based on the local setting of their browser when using the following applications:

  • Oracle SOA Composer

  • Oracle Business Process Composer

  • Oracle Process Workspace

Note:

Locale dictionaries are stored as resource bundles. You must create the resource bundle using Oracle JDeveloper. They must be deployed as part of the SOA composite application.

Resource bundles cannot be created using Oracle SOA Composer. However, you can use Oracle SOA Composer to edit the localized strings within a resource bundle.

Oracle SOA Composer enables you to localize the aliases of the following rules components.

  • Values

  • Value Sets

  • Decision Functions

  • Decision Function Facts

  • Globals

  • Links

  • Rulesets

  • Rules

  • Patterns

12.9.1 How to Localize the Alias of a Oracle Business Rules Component

Using Oracle SOA Composer, in a session, you can add translated versions of the aliases and their descriptions used to identify rules components.

To localize the alias of a rules component:

  1. In Oracle SOA Composer, select the Translations tab. The Translations tab displays a table with multiple columns. By default, there are two columns one displaying the untranslated identifier of the rules component. The other displays the English locale.

    If you have defined other locales in your application, these also appear as columns in this table. See Localizing Oracle Business Rule Resources. for more information.

  2. In the column of the locale you want to edit, double-click in cell corresponding to the alias you want to translate.
  3. Enter the localized text for the alias.
  4. Repeat steps 2 and 3 to localize all the aliases required for the locale.

Note:

Offline editing of locale files is not supported. When a locale is added, the xml file generated does not contain all the keys by default. They are added when a value is added.

You can also localize from the editor. To localize from the editor click the Translations button.

The Translations Editor enables you to appears enter the Alias for the rule components and click OK.

12.10 Synchronizing Rules Dictionary in Oracle JDeveloper With Runtime Dictionary Updates

Oracle SOA Composer enables you to update rules dictionaries at runtime. However, the modifications made to the dictionaries through Oracle SOA Composer are not automatically reflected in Oracle JDeveloper. To synchronize the dictionary updates made in Oracle SOA Composer with the dictionaries available in Oracle JDeveloper, you must select the Export option in Oracle Enterprise Manager Fusion Middleware Control Console. This utility allows you to export the SOA composite application along with the dictionary.

To select the Export option in Fusion Middleware Control Console:

  1. In Fusion Middleware Control Console, select the composite that contains the dictionary to be exported.
  2. Click SOA Composite drop-down list on the right panel and select Export as shown in Figure 12-57.

    Figure 12-57 Selecting the Export Utility

    Description of Figure 12-57 follows
    Description of "Figure 12-57 Selecting the Export Utility"
  3. Select Option 1: Export with all post-deploy changes from the Export Composite page and click Export as shown in Figure 12-58.

    Figure 12-58 Exporting All Postdeployment Changes

    Description of Figure 12-58 follows
    Description of "Figure 12-58 Exporting All Postdeployment Changes"

12.11 Validating and Diagnosing an Oracle Business Rules Dictionary

In Oracle SOA Composer, in a session, you use the bottom tabs to check diagnostics and validate a dictionary for errors. The diagnostics tab is populated after you publish a session.

During the publish of the session, if another user has made any changes to the same artifact (like a dictionary) it will be listed in this section. You then have three options to handle any conflicts.

12.11.1 Understanding the Validation Log Tab

The Validation Log tab lists all the dictionary-level validation errors.

The Validation Log does not get updated automatically. The validation is only run if you click Validate and when you save any changes.

For example, when a new rule is added with errors, the Validation Log tab is not updated automatically. Click the Validate button on the toolbar to update the Validation Log with the new error entries.

12.11.2 Understanding the Diagnostics Tab

Use the Diagnostics tab see if other users are modifying the same artifacts and resolve those conflicts, as shown in Figure 12-59.

Figure 12-59 Diagnostics Tab

Description of Figure 12-59 follows
Description of "Figure 12-59 Diagnostics Tab"

To resolve changes made by you or other users:

  1. For each item in the table, use the Resolution drop down to Ignore, Adopt, or Overwrite changes.
  2. Adopt will try to merge changes.
  3. Ignore means your changes will be discarded.
  4. Overwrite means that your changes will be made, other users changes will be discarded.
  5. Click Publish when done.

12.11.3 Understanding the History Center Tab

The History Center tab displays any pending changes that you or other users have made in a currently active session. You can discard changes from here, for example, if you want to quickly undo all changes you have made all at once.

12.11.4 Understanding the Save Log Tab

The Save Log tab is updated whenever you save. It adds an entry to the save log if it succeeds. It it fails it will show the error message here.

12.12 Working with Tasks

Using Oracle SOA Composer, you can view and edit tasks that may be or may not be associated to Approval Management Extensions (AMX) rules. AMX enables you to define complex task routing slips for human workflow by taking into account business documents and associated rules to determine the approval hierarchy for a work item.

Additionally, AMX lets you define multi-stage approvals with associated list builders based on supervisor or position hierarchies. At design time, you can define the approval task in the Human Task Editor of Oracle JDeveloper, and associate the task with a BPEL process. For more information about approval management and tasks, see Using Approval Management in Oracle Fusion Middleware Modeling and Implementation Guide for Oracle Business Process Management.

In Oracle SOA Composer, the Task Editor is embedded as a task flow so that you can view and perform all the task metadata lifecycle operations.

12.12.1 How to View Task Metadata

To view task metadata:

  1. In Oracle SOA Composer, to open a task or an AMX rules metadata artifact, from the Types View, expand the Human Tasks folder, and click an artifact to open it in a new tab, as shown in Figure 12-60.
  2. If you want to make changes, click Edit Session. When you are ready to apply the changes to the runtime version, click Publish.

    For more information about how to use the session buttons, see Creating and Publishing Sessions

You can differentiate between traditional rules and AMX rules depending on the naming convention.

For example, a composite may have the following artifacts:

  • <AMX task name>.tsk

  • <AMX rule name>Rules.rules

12.12.2 How to Configure a Task or an AMX Rule Metadata

Task Configuration enables business users and administrators to review the rules that were configured automatically by the workflow designer. These predefined rules can be changed for a specific customer based on the customer's applicable corporate policies.

In Oracle SOA Composer, Task Configuration enables you to edit the event-driven (only tasks) and data-driven rules (tasks with an associated AMX rules) associated with an approval flow at runtime.

Figure 12-61 Configuring Tasks

Description of Figure 12-61 follows
Description of "Figure 12-61 Configuring Tasks"

12.12.2.1 Configuring Event-Driven Settings

To configure event-driven settings:

  1. Log on to Oracle SOA Composer and open the required task.
  2. Click Edit Session on the Oracle SOA Composer menu bar to open the selected task for editing as shown in Figure 12-62.

    Figure 12-62 Opening a Task for Editing

    Description of Figure 12-62 follows
    Description of "Figure 12-62 Opening a Task for Editing"
  3. Make the relevant edits and click Save Changes in Current Tab When you are ready to apply the changes to the runtime version, click Publish.

You can configure the following options and settings:

  • Task aggregation

  • Error notification

  • Assignment and routing policy

  • Expiration and escalation policy

  • Notification settings

  • Task access settings

12.12.2.1.1 Setting Approval Aggregation Requirements

Task aggregation requirements can be any of the following:

  • None

  • Once per task

  • Once per stage

12.12.2.1.2 Notifying Errors

You can specify the user and group names that need to be notified in case of an error in the task. You need to click the On Error Notify search button to display the Configure Error Assignees dialog box where you can specify the user or group names.

12.12.2.1.3 Setting Assignment and Routing Policy

You can set the assignment and routing policy by using the options available in Oracle SOA Composer. Click to select the available options for setting assignment and routing policy.

For more information about the assignment and routing options available in event-driven configuration, see Routing Policy Method in Oracle Fusion Middleware Developer's Guide for Oracle SOA Suite.

12.12.2.1.4 Setting Expiration and Escalation Policy

You can set the expiration and escalation policy for the task by using the available items in the Expiration and Escalation Policy list. The available list items are:

  • Never Expire

  • Expire After

  • Escalate After

  • Renew After

12.12.2.1.5 Configuring Notification Settings

You can configure notification settings for a task by using the options available in the Notification Settings section of Oracle SOA Composer.

**INTERNAL XREF ERROR** displays the different options available to configure notification settings for a task.

Figure 12-63 Specifying Notification Settings

Description of Figure 12-63 follows
Description of "Figure 12-63 Specifying Notification Settings"
12.12.2.1.6 Configuring Task Access Settings

You can set access-rule settings to control the actions a user can perform. You can also specify content and action permissions based on the logical role of a user, such as creator (initiator), owner, assignee, and reviewers.

In Oracle SOA Composer, you can set access settings by using the options available under Task Access area and tabs, as shown in **INTERNAL XREF ERROR** and **INTERNAL XREF ERROR**.

Figure 12-64 Specifying Task Access Settings

Description of Figure 12-64 follows
Description of "Figure 12-64 Specifying Task Access Settings"

Figure 12-65 Specifying Task Actions Settings

Description of Figure 12-65 follows
Description of "Figure 12-65 Specifying Task Actions Settings"

For more information on configuring task access, see How to Define Security Access Rules in Oracle Fusion Middleware Modeling and Implementation Guide for Oracle Business Process Management.

12.12.2.2 Configuring Data-Driven Settings (Rule or Condition)

To configure data-driven settings:

  1. Log on to Oracle SOA Composer and open the required task.
  2. Click Edit Session on the Oracle SOA Composer menu bar to open the selected AMX rule-associated task for editing as shown in Figure 12-66.

    Figure 12-66 Editing a Rule-Associated Task

    Description of Figure 12-66 follows
    Description of "Figure 12-66 Editing a Rule-Associated Task"
  3. Make the relevant edits and click Save Changes in Current Tab. If you are ready to apply the changes to the runtime version, click Publish.

You can perform the following actions:

  • Adding, updating, and deleting a rule

  • Changing rule assertions (which depend on the type of list builder for which the rule has been configured)

  • Adding a variable

For more information about editing data-driven settings, see How to Edit Data-Driven Settings in Oracle Fusion Middleware User's Guide for Oracle Business Process Management.