Creating a dictionary

A dictionary is an Oracle Business rules container for facts, functions, globals, Bucketsets, links, decision functions, and rulesets. A dictionary is an XML file that stores the application's rulesets and the Data model. Dictionaries can link to other dictionaries. Oracle JDeveloper creates an Oracle Business rules dictionary in a ''rules'' file.

Note

You can create as many dictionaries as you need. A dictionary may contain any number of rulesets.

Rules dictionaries are use to hold rule facts, functions, tables, and other components.

How to do it...

In this section, you will create a rules dictionary:

  1. Start Oracle JDeveloper, select Default Role, and click OK.
  2. Go to Application Navigator | Project and click on the process SalesToContract.
  3. Go to Component Palette | BPM and click Business Rule from Activities.
    How to do it...
  4. Click on the salesrepresentative swimlane, between Enter Quote user task and Is Business Analyst Review Required? gateway.
  5. You will find the BusinessRuleTask | Properties dialog:
    How to do it...
  6. Enter the Business Rule Task name as CheckCustomer.
  7. Click on the Implementation tab and click the green plus (+) icon to add a Business Rule.
  8. You will find that a Create business Rule dialog opens up.
  9. Go to the General tab of the dialog and enter rule Name
  10. In the input and output section, click on the green plus (+) icon to add input and output Data objects:
    How to do it...
  11. Click Input Data Object and browse for the object quote, and click Output Data Object and browse for the object ApprovalFlow, as the input and output of the Business rule, respectively:
    How to do it...
  12. Click OK.
  13. In the Properties dialog, you will create a Data association. Click on the pencil icon to the right of Use Associations to tick Data Associations.
  14. You can find the objects quote and ApprovalFlow as input and output for the CustomerCheck rule.
    How to do it...
  15. When finished, Save.
  16. Go to BPM Project navigator | Business Catalog | Rules, and you can find a CheckCustomer.rules file created. This is called a rules dictionary.

    Note

    Oracle Business Rule cannot work with simple Data objects. Even if we have to use a Simple type, it needs to wrapped inside a complex element of a schema.

How it works...

Rulesets are accessed via:

  • Rulesets that are defined as a service are accessed via API or Web services.
  • Alternatively, the rules dictionary can be a component in the BPMN composite application and the rulesets accessed directly by the BPMN process.

    When you create a dictionary, and if you go to the Application navigator, you can find that the following Decision component defining files are created:

    • Decision Service Metadata file (.decs): The business rule metadata file provides information about the location of the component business rules dictionary and the Decision services exposed by the Decision component. The business rule metadata file (business_rule_name.decs) defines the contract between the components involved in the interaction of the business rule with the design time and backend Oracle Rules Engine. The business_rule_name.decs file rule EngineProvider element includes details about the rules dictionary to use:
    <ruleEngineProvider name="OracleRulesSDK" provider="Oracle_11.0.0.0.0">
    <repository type="SCA-Archive">
    <path>SalesToContractDemo/oracle/rules/salestocontractdemo/CheckCustomer.rules</path>
    </repository>
    </ruleEngineProvider>
    

    A repository-type SCA archive indicates that that the rules dictionary is located in the service component architecture archive. The path is relative and interpreted differently by the following:

    • Design time: Metadata service (MDS) APIs open the rules dictionary. Therefore, the full path to the dictionary is as follows:

      Oramds:/SalesToContractComposite/oracle/rules/ CheckCustomer.rules

      Runtime (business rule service engine): The business rule service engine uses the Oracle Business rules SDK Rule Repository API to open the rules dictionary located in MDS. The composite name prefix, is removed from the path and the metadata manager assumes the existence of oracle/rules/CheckCustomer.rules, relative to the composite home directory.

      A decision service is a web service (or SOA) enabler of business rules. It is a service in the sense of a Web service, thus opening the world of business rules to service-oriented architectures (SOA).

  • SCA ComponentType Files (.component): An SCA business_rule_name.component type file is included with each Decision component. This file lists the services exposed by the business rules service component.
  • Composite.xml files: They also have entries for decision components. An entry in composite.xml is created for a Decision component. The business rules service engine uses the information from this implementation type to process requests for the Service Engine. From an SCA perspective, a Decision component is a new implementation type.
    <component name="CheckCustomer">
    <implementation.decisionsrc="CheckCustomer.decs"/>
    </component>
    
    How it works...
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.216.27.251