12 Using Oracle SOA Composer with Oracle Business Rules

Oracle Business Rules lets you create rules at design-time with the Oracle Business Rules Designer (Rules Designer) extension to JDeveloper. Rules Designer is an editor that enables you to create and edit rules with Oracle JDeveloper, and store the rules in a rules dictionary. When a dictionary is deployed in an SOA composite application Oracle Business Rules lets you use SOA Composer to view, edit, and commit changes to a dictionary. This chapter shows you how to use the SOA Composer application (SOA Composer) to work with a deployed dictionary that is part of an SOA composite application.

This chapter includes the following sections:

12.1 Introduction to SOA Composer

Oracle SOA Composer allows you to work with Oracle Business Rules dictionaries for deployed applications. Figure 12-1 shows how SOA Composer accesses a dictionary in an MDS repository.

Figure 12-1 SOA Composer Architecture

Description of Figure 12-1 follows
Description of "Figure 12-1 SOA Composer Architecture"

12.2 Using SOA Composer User Authentication

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

Figure 12-2 Oracle SOA Composer Login Page

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

To login to SOA Composer:

  1. In the SOA Composer login page in the Username field, enter a user name.

  2. In the Password field, enter a password.

  3. Click Login.

For information on creating and managing users and groups, see Oracle Fusion Middleware Oracle WebLogic Server Administration Console Help.

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

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

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

If a user without the SOADesigner role logs into SOA Composer, a message is shown indicating the user is not authorized to modify the SOA metadata, as shown in Figure 12-3.

Figure 12-3 SOA Composer Unauthorized Metadata Access Message

Description of Figure 12-3 follows
Description of "Figure 12-3 SOA Composer Unauthorized Metadata Access Message"

12.3 Opening and Viewing an Oracle Business Rules Dictionary at Runtime

After you login to SOA Composer you can select a document to open. SOA Composer supports viewing and editing different types of metadata, including a DVM document or an Oracle Business Rules dictionary. In SOA Composer you can open either an Oracle Business Rules dictionary or a DVM file with the Open menu as shown in Figure 12-4.

Figure 12-4 Oracle SOA Composer Open Menu Options

Description of Figure 12-4 follows
Description of "Figure 12-4 Oracle SOA Composer Open Menu Options"

12.3.1 Opening an Oracle Business Rules Dictionary at Runtime

To open an Oracle Business Rules dictionary using the Open menu:

  1. In SOA Composer, from the Open menu select Open Rules.

  2. When you select Open Rules SOA Composer connects to MDS and presents the available composite applications that contain dictionaries, as shown in Figure 12-5.

    Figure 12-5 SOA Composer with Oracle Business Rules Dictionaries

    Description of Figure 12-5 follows
    Description of "Figure 12-5 SOA Composer with Oracle Business Rules Dictionaries"

  3. To open a dictionary select an entry in the table and click Open or double-click an item. This opens the dictionary in view mode, as shown in Figure 12-6.

    Figure 12-6 Oracle Business Rules Dictionary Open in SOA Composer View Mode

    Description of Figure 12-6 follows
    Description of "Figure 12-6 Oracle Business Rules Dictionary Open in SOA Composer View Mode"

As shown in Figure 12-6, SOA Composer shows a dictionary that displays a left-side panel with a list of tabs and links. Dictionary details for the selected item are shown on the right-hand side. SOA Composer includes the following tabs:

  • Globals

  • Bucketsets

  • Rulesets

SOA Composer supports two modes for viewing a dictionary, view and edit. If you have not previously opened a dictionary in Edit mode, then by default the dictionary opens in view mode. For more information on Edit mode, see Section 12.4, "Getting Started with Editing and Saving a Dictionary at Runtime".

To open an Oracle Business Rules dictionary directly using a known URL:

If you know the URL for a document that stores an Oracle Business Rules dictionary, you can start SOA Composer and open the document by supplying the URL.

  1. Obtain the URL for the document you want to open in SOA Composer.

  2. With an Open document you can obtain the URL from the SOA Composer Bookmarkable Link. Click Bookmarkable Link to obtain the URL information for an open dictionary, as shown in Figure 12-7.

    Figure 12-7 Using Link Dialog to Obtain the URL for an Open Dictionary

    Description of Figure 12-7 follows
    Description of "Figure 12-7 Using Link Dialog to Obtain the URL for an Open Dictionary"

  3. Enter the URL and append the document path in a browser to open SOA Composer with the specified document.

    For example,

    http://www.example.com:8001/soa/composer?docPath=/deployed-composites/RulesHelloWorld_rev1.0/rules/AdvancedRules.rules
    

To open and edit a recently edited dictionary using the My Edits option:

If you recently edited a dictionary, then you can use the Open menu My Edits option to open and edit a dictionary.

  1. In SOA Composer, from the Open menu select My Edits and select a dictionary from the list, as shown in Figure 12-8.

    Figure 12-8 Using Open My Edits Option to Open a Dictionary

    Description of Figure 12-8 follows
    Description of "Figure 12-8 Using Open My Edits Option to Open a Dictionary"

  2. SOA Composer opens the specified dictionary in edit mode.

To open a ruleset in an Oracle Business Rules dictionary:

  1. In SOA Composer, from the Open menu select Open Rules.

  2. When you select Open Rules SOA Composer connects to MDS and presents the available composite applications that contain dictionaries.

  3. To open a ruleset, if the ruleset you want to open is shown in the Contents field then select the ruleset. If the ruleset is not shown then click Show All as shown in Figure 12-9.

    Figure 12-9 Opening a Ruleset from the Contents Field in SOA Composer

    Description of Figure 12-9 follows
    Description of "Figure 12-9 Opening a Ruleset from the Contents Field in SOA Composer"

  4. Select a ruleset from the Name field in the dropdown list. This opens the rules editor with the specified ruleset selected.

12.3.2 What You Need to Know When You Open an Oracle Business Rules Dictionary

When you use the Open menu and select Open Rules to open a dictionary, SOA Composer shows you all the metadata artifacts associated with the soa-infra that is co-located with the running SOA Composer application. From the supplied list, as shown in Figure 12-9, you select the composite, dictionary, and ruleset to open.

12.3.3 What You Need to Know to Obtain the Dictionary Path from the Open Dialog

The Open Dialog includes a Rules File field. When you hold the mouse over the values in the Rules File field, SOA Composer shows a "Complete Path" popup that includes the dictionary path, as shown in Figure 12-10.

Figure 12-10 Showing the Dictionary Rules File Complete Path from the Open Dialog

Description of Figure 12-10 follows
Description of "Figure 12-10 Showing the Dictionary Rules File Complete Path from the Open Dialog"

12.3.4 Viewing Globals in an Oracle Business Rules Dictionary at Runtime

When you open a dictionary SOA Composer displays the Globals tab. The Globals tab only shows final global variables (global variables with Final option selected). You cannot create or delete global variables. From the Globals tab, in edit mode you can edit the Name, Description, and Value fields. For the Value field, you can use the expression builder to set the value. To check for validity, you can click Validate icon above the table. In view mode, the edit operations are not available. For information on using the SOA Composer edit mode, see Section 12.4, "Getting Started with Editing and Saving a Dictionary at Runtime".

To view globals in SOA Composer:

  1. In SOA Composer, from the Open menu select Open Rules.

  2. After you open a dictionary, select the Globals tab from the left-side pane. This displays the Globals table, as shown in Figure 12-11.

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

Description of Figure 12-11 follows
Description of "Figure 12-11 Using the SOA Composer Rules Dictionary Globals Tab"

12.3.5 Viewing Bucketsets in an Oracle Business Rules Dictionary at Runtime

When you open a dictionary and select the Bucketsets tab, if the dictionary contains bucketsets the table shows all the bucketsets. For information on the SOA Composer edit mode, see Section 12.4, "Getting Started with Editing and Saving a Dictionary at Runtime".

To view bucketsets in SOA Composer:

  1. In SOA Composer, from the Open menu select Open Rules.

  2. After you open a dictionary, select the Bucketsets tab from the left-side pane. This displays the Bucketsets table, as shown in Figure 12-12.

Figure 12-12 Using the SOA Composer Rules Dictionary Bucketsets Tab

Description of Figure 12-12 follows
Description of "Figure 12-12 Using the SOA Composer Rules Dictionary Bucketsets Tab"

12.3.6 Viewing Rulesets in an Oracle Business Rules Dictionary at Runtime

SOA Composer displays the rulesets in the dictionary on the left-side panel, as shown in Figure 12-13. You can select a ruleset to display a detailed view of the ruleset. In view mode all the rules in the ruleset are displayed but they are not editable. For information on the SOA Composer Edit mode, see Section 12.4, "Getting Started with Editing and Saving a Dictionary at Runtime".

Note:

Using SOA Composer in edit mode you cannot create or delete rulesets. You can view and modify rulesets.

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

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

To select the next ruleset or previous ruleset:

  1. In SOA Composer open a dictionary and select a ruleset.

  2. When you are viewing a ruleset, you can click Select Next Ruleset or Select Previous Ruleset to view the next or the previous ruleset, as shown in Figure 12-14.

    Figure 12-14 Using the SOA Composer Rules Dictionary Rulesets Tab to Select Next Ruleset

    Description of Figure 12-14 follows
    Description of "Figure 12-14 Using the SOA Composer Rules Dictionary Rulesets Tab to Select Next Ruleset"

12.4 Getting Started with Editing and Saving a Dictionary at Runtime

When you select and open a dictionary SOA Composer shows the dictionary in read only mode. From each tab in view mode you enter edit mode for the dictionary item by selecting the Edit menu. In edit mode, after you make changes select Save to save your changes. Saving changes saves the dictionary to a work area. To apply the changes to the runtime version of the dictionary, select Commit. If you decide you do not want to apply the changes, select Revert.

12.4.1 Editing Bucketsets in an Oracle Business Rules Dictionary at Runtime

In SOA Composer, selecting the Bucketsets tab shows you a table listing the bucketsets in the dictionary. To edit a bucketset, select the appropriate row and click the Edit icon. Depending on the type of the bucketset, Range, Enum, or LOV, this displays a corresponding Edit bucketset page. You can create a Range Bucketset by clicking Add in the menu bar and selecting a type. This adds a new row in the Bucketsets table. Adding a bucket automatically adds an end point for a range bucket and a value for an LOV bucket based on the datatype. You can modify the newly added bucket end point or value. Note that the alias is modified when an end point or value is changed.

To delete a bucketset, select a row and click Delete.

To Edit a Range Bucketset:

  1. To edit a Range bucketset, in SOA Composer select the Bucketsets tab. This displays a table listing the bucketsets in the dictionary.

  2. To edit a Range bucketset, select the appropriate Range bucketset row and click the Edit Bucketset icon. This displays the Bucketset Editor page, as shown in Figure 12-15.

    Figure 12-15 Bucketset Editor Dialog to Edit a Range Bucketset

    Description of Figure 12-15 follows
    Description of "Figure 12-15 Bucketset Editor Dialog to Edit a Range Bucketset"

  3. Use the Bucketset Editor to edit the appropriate fields in the bucketset.

  4. Click OK to confirm the changes.

To Edit an LOV Bucketset:

  1. To edit an LOV bucketset, in SOA Composer select the Bucketsets tab. This displays a table listing the bucketsets in the dictionary.

  2. To edit an LOV bucketset, select the appropriate LOV bucketset row and click the Edit Bucketset icon. This displays the Bucketset Editor page, as shown in Figure 12-16.

    Figure 12-16 Bucketset Editor Dialog to Edit an LOV Bucketset

    Description of Figure 12-16 follows
    Description of "Figure 12-16 Bucketset Editor Dialog to Edit an LOV Bucketset"

  3. Use the Bucketset Editor to edit the appropriate fields in the bucketset.

12.4.2 What You Need to Know About Editing Bucketsets

Only when a bucket has the Allowed in Actions field selected does the bucketset display in the condition cell drop-down in a Decision Table.

Click Validate to validate the dictionary while making changes to a bucketset.

12.4.3 Editing Rules in an Oracle Business Rules Dictionary at Runtime

SOA Composer allows you to edit the rules in a dictionary.

To edit a rule with SOA Composer:

  1. In SOA Composer with an Oracle Business Rules dictionary open, select a ruleset.

  2. Click the Edit menu item.

  3. SOA Composer shows a confirm dialog if another user is currently editing the same dictionary. In the confirm dialog, click No or Yes, depending on whether you want to edit the document (if you click Yes, your changes could conflict with another user's changes). For more information, see Section 12.5.1, "What You Need to Know About Editing With Multiple Users at Runtime".

  4. SOA Composer creates an area to save any modifications you make to the dictionary, and the Edit menu changes to a Save menu.

    Note:

    The Edit view provides an interface to the dictionary that allows you to edit most dictionary components (you can only create and edit some dictionary components at design-time using the Rules Designer extension to JDeveloper).
  5. To edit an item in the dictionary, in the navigation tab select the item of interest. For example, see Figure 12-17 with the ruleset Ruleset_3 selected.

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

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

  6. Click the Save menu item to save your changes in the work area.

12.5 Committing Changes for an Oracle Business Rules Dictionary at Runtime

After you verify dictionary modifications you can commit those changes to the MDS repository.

To commit changes to an Oracle Business Rules dictionary:

  1. Click the Commit menu item.

  2. In the Confirm dialog, click No if you do not want to make the changes in the MDS repository.

  3. In the Confirm dialog, click Yes if you do want to make the changes in the MDS repository.

12.5.1 What You Need to Know About Editing With Multiple Users at Runtime

When multiple users are editing the same dictionary, 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 commit is persisted.

12.6 Editing Rules in an Oracle Business Rules Dictionary at Runtime

In SOA Composer with edit mode you can edit, add, and delete rules in a ruleset. For more information on how to use edit mode, see Section 12.4, "Getting Started with Editing and Saving a Dictionary at Runtime".

12.6.1 Adding a Rule at Runtime

In SOA Composer you can add rules to a ruleset.

To add a rule in a ruleset:

  1. In edit mode, select a ruleset of interest.

  2. In the rule area, click New Rule as shown in Figure 12-18.

    Figure 12-18 Adding a Rule in a Ruleset

    Description of Figure 12-18 follows
    Description of "Figure 12-18 Adding a Rule in a Ruleset"

12.6.2 Deleting a Rule at Runtime

In SOA Composer you can delete rules in a ruleset.

To delete a rule in a ruleset:

  1. In edit mode, select a ruleset of interest.

  2. In the rule area locate the rule you want to delete and click Delete Rule, as shown in Figure 12-19.

    Figure 12-19 Deleting a Rule in a Ruleset

    Description of Figure 12-19 follows
    Description of "Figure 12-19 Deleting a Rule in a Ruleset"

12.6.3 Showing and Editing Advanced Settings for Rules at Runtime

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

To show and edit advanced settings in a rule:

  1. In edit mode, select a ruleset of interest.

  2. In the rule area locate the rule you want to show or change advanced settings.

  3. Click the Show Advanced Settings icon next to the rule name. This displays the advanced settings, as shown in Figure 12-20.

    Figure 12-20 Showing and Editing Rule Advanced Settings

    Description of Figure 12-20 follows
    Description of "Figure 12-20 Showing and Editing Rule Advanced Settings"

12.6.4 Adding Rule Conditions at Runtime

In SOA Composer you can add conditions to a rule in a ruleset. For more information on working with rule conditions, see Section 4.3, "Working with Rules".

To add rule conditions:

  1. In edit mode, select a ruleset of interest.

  2. In the rule area locate the rule where you want to add a condition.

  3. Next to the rule condition, click Add Condition as shown in Figure 12-21.

    Figure 12-21 Adding a New Rule Condition in a Ruleset

    Description of Figure 12-21 follows
    Description of "Figure 12-21 Adding a New Rule Condition in a Ruleset"

12.6.5 Deleting Rule Conditions at Runtime

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

To delete rule conditions:

  1. In edit mode, select a ruleset of interest.

  2. In the rule area locate the rule where you want to delete a condition.

  3. Click Delete Condition next to the rule condition, as shown in Figure 12-22.

    Figure 12-22 Deleting a Rule Condition in a Ruleset

    Description of Figure 12-22 follows
    Description of "Figure 12-22 Deleting a Rule Condition in a Ruleset"

12.6.6 Modifying Rule Conditions at Runtime

Using 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 Section 4.3, "Working with Rules".

To modify a condition in a rule:

  1. In edit mode, 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, icons, and selection boxes, including the Left Value expression icon, dropdown list for an operator, and Right Value expression icon to modify the condition.

12.6.7 Adding Rule Actions at Runtime

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

To add rule actions:

  1. In edit mode, 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-23.

    Figure 12-23 Adding a Rule Action in a Ruleset

    Description of Figure 12-23 follows
    Description of "Figure 12-23 Adding a Rule Action in a Ruleset"

12.6.8 Deleting Rule Actions at Runtime

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

To delete rule actions:

  1. In edit mode, 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, next to the rule action click Delete Action, as shown in Figure 12-24.

    Figure 12-24 Deleting a Rule Action in a Ruleset

    Description of Figure 12-24 follows
    Description of "Figure 12-24 Deleting a Rule Action in a Ruleset"

12.6.9 Modifying Rule Actions at Runtime

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

To delete rule actions:

  1. In edit mode, 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, next to the rule action click a dropdown list for the action type or click Edit Properties.

12.6.10 Working with Advanced Mode Rules at Runtime

In SOA Composer you can work with advanced mode rules in a ruleset. For more information on working with advanced mode rules, see Section 4.7, "Working with Advanced Mode Rules".

To show and modify advanced mode rules:

  1. In edit mode, select a ruleset of interest.

  2. In the rule area locate the rule where you want to show or modify advanced mode rules.

  3. Select Advanced Settings icon to show advanced settings. For more information on showing advanced settings, see Section 12.6.3, "Showing and Editing Advanced Settings for Rules at Runtime".

  4. If the Advanced Mode icon is not selected, then select the Advanced Mode icon. This shows the advanced mode rule options, as shown in Figure 12-25.

    Figure 12-25 Showing Advanced Mode Rule Options

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

12.6.11 Working with Tree Mode Rules at Runtime

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

To show and modify tree mode rules:

  1. In edit mode, 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 Settings icon to show advanced settings. For more information on showing advanced settings, see Section 12.6.3, "Showing and Editing Advanced Settings for Rules at Runtime".

  4. If the Tree Mode icon is not selected, then select the Tree Mode icon. This shows the tree mode rule options, as shown in Figure 12-26.

    Figure 12-26 Show the Tree Mode Rule Area in a Rule

    Description of Figure 12-26 follows
    Description of "Figure 12-26 Show the Tree Mode Rule Area in a Rule"

12.7 Editing Decision Tables in an Oracle Business Rules Dictionary at Runtime

In SOA Composer in edit mode you can edit, add, and delete a Decision Table in a ruleset. For more information on how to use edit mode, see Section 12.4, "Getting Started with Editing and Saving a Dictionary at Runtime".

12.7.1 Adding a Decision Table at Runtime

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

To add a decision table in a ruleset:

  1. In edit mode, select a ruleset of interest.

  2. In the ruleset area click New Decision Table, as shown in Figure 12-27.

    Figure 12-27 Adding a Decision Table in a Ruleset

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

12.7.2 Deleting a Decision Table at Runtime

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

To delete a decision table in a ruleset:

  1. In edit mode, select a ruleset of interest.

  2. In the ruleset area, in the View field from the dropdown list select the Decision Table you want to delete.

  3. Click Delete Decision Table, as shown in Figure 12-28.

    Figure 12-28 Select the Delete Decision Table Icon

    Description of Figure 12-28 follows
    Description of "Figure 12-28 Select the Delete Decision Table Icon"

12.7.3 Modifying a Decision Table at Runtime

In SOA Composer you can modify a Decision Table in a ruleset. For more information on working with Decision Tables, see Section 5.1, "Introduction to Working with Decision Tables".

To modify a decision table in a ruleset:

  1. In edit mode, select a ruleset of interest.

  2. In the ruleset area, in the View field from the dropdown list select the Decision Table you want to work with, as shown in Figure 12-29.

  3. Use the Decision Table controls to modify the decision table. For more information on working with Decision Tables, see Chapter 5, "Working with Decision Tables".

Figure 12-29 Editing a Decision Table

Description of Figure 12-29 follows
Description of "Figure 12-29 Editing a Decision Table"

12.8 Validating an Oracle Business Rules Dictionary at Runtime

In SOA Composer you can validate a dictionary. For more information on validation, see Section 4.4, "Validating Dictionaries".

To validate a dictionary:

  1. In edit mode, select a ruleset of interest.

  2. In the ruleset area click Validate, as shown in Figure 12-30.

    Figure 12-30 Validating a Dictionary at Runtime

    Description of Figure 12-30 follows
    Description of "Figure 12-30 Validating a Dictionary at Runtime"

12.9 Obtaining Composite and Dictionary Information at Runtime

When a dictionary is open, you can obtain dictionary and composite details from the Info dialog.

To obtain dictionary information:

  1. With an Open document you can obtain the document type, composite details, and document path by clicking Info. This displays the SOA Composer open file information, as shown in Figure 12-31.

    Figure 12-31 Using Info Dialog to Obtain the Document Path for an Open Dictionary

    Description of Figure 12-31 follows
    Description of "Figure 12-31 Using Info Dialog to Obtain the Document Path for an Open Dictionary"