Working with Decision Component Metadata

11-2 Oracle Fusion Middleware Users Guide for Oracle Business Rules You can create a variety of such business rules service components. For more information, see Oracle Fusion Middleware Developers Guide for Oracle SOA Suite.

11.2 Working with a Decision Component

Using Oracle JDeveloper with Rules Designer these tools automatically generate all required metadata and WSDL operations. The Decision component can be integrated into an SOA composite application in the following ways: ■ Create a Decision component as a standalone component in the SOA Composite Editor. In this scenario, the Decision Service is exposed on the composite level and thus can be invoked from any Web service client. For more information, see Getting Started with Oracle Business Rules in the Oracle Fusion Middleware Developers Guide for Oracle SOA Suite. ■ Create a Decision component in the SOA Composite Editor that you later associate with a BPEL process. In this scenario the Decision Service is not exposed on the composite level. However it can be wired to any other component within the composite, such as BPEL, Oracle Mediator, and Oracle Human Workflow. For more information, see Getting Started with Oracle Business Rules in the Oracle Fusion Middleware Developers Guide for Oracle SOA Suite. ■ Create a Decision component within the Human Task editor of a human task component. This integration provides the following benefits: ■ Dynamic processing: provides for intelligent routing, validation of policies within a process, and constraint checks. ■ Integration with ad hoc human tasks: provides policy-based task assignment, various escalation policies, and load balancing of tasks.

11.2.1 Working with Decision Component Metadata

A Decision component is defined by the following files: ■ Decision Service Metadata .decs File ■ SCA Component Type .componentType File ■ Decision Component Entry in composite.xml Typically, Oracle JDeveloper generates and maintains these files.

11.2.1.1 Decision Service Metadata .decs File

Every Decision component within a composite comprises one business rule metadata file. The business rule metadata file provides information about the location of the component business rule dictionary and the Decision Services exposed by the Decision component. One Decision component might expose one or more Decision Services. For example a CreditRating Decision component might expose two services, CheckEligibility and CalculateCreditRating. In Oracle Fusion Middleware 11g Release 1 11.1.1, the Decision Service metadata comprises the decision function name that is being exposed as a Web service. For projects that are migrated from older releases of Oracle SOA Suite, the Decision Working with Decision Components in SOA Applications 11-3 Service metadata typically has more information depending on the interaction pattern used in 10.1.3.x. 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 back-end Oracle Rules Engine. This file is in the SOA Content area of the Application Navigator in Oracle JDeveloper for your SOA composite application. Table 11–1 describes the top-level elements in the Decision service .decs file. Table 11–1 Decision Metadata File .decs Top-level Elements Element Description ruleEngineProvider The business_rule_name.decs file ruleEngineProvider element includes details about the rule dictionary to use: ruleEngineProvider name=OracleRulesSDK provider=Oracle_11.0.0.0.0 repository type=SCA-Archive pathAutoLoanCompositeoraclerulesAutoLoanRules.rulespath repository ruleEngineProvider The repository type is set to SCA-Archive for Decision components. This indicates that the rule dictionary is located in the service component architecture archive. The path is relative and interpreted differently by the following: ■ Design time — The path is prefixed with Oramds:. Metadata service MDS APIs open the rule dictionary. Therefore, the full path to the dictionary is as follows: Oramds:AutoLoanCompositeoraclerulesAutoLoanRules.rules ■ Runtime business rule service engine — The business rule service engine uses the Oracle Business Rules SDK RuleRepository API to open the rule dictionary located in MDS. The composite name prefix, for example AutoLoanComposite is removed from the path and the metadata manager assumes the existence of oraclerulesAutoLoanRules.rules relative to the composite home directory. decisionService 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. In 11g Release 1 11.1.1.5.0, a Decision service consists of metadata and a WSDL contract for the service. The business_rule_name.decs file decisionService element defines the metadata that describes business rules exposed as a Web service. In general, a Decision service includes the following elements: ■ Target namespace ■ Reference to the back-end Oracle Rules Engine this is the link to the rule dictionary. Note that OracleRulesSDK is the reference name that matches the name of the Oracle Rules Engine provider in ruleEngineProvider element. ■ Name CreditRatingService in the following example ■ Additional information about the dictionary name and ruleset to use ■ List of supported operations patterns Apart from the operations patterns, the parameter types or fact types of operations are specified and validated later at runtime. Therefore, every Decision service exposes a strongly-typed contract. 11-4 Oracle Fusion Middleware Users Guide for Oracle Business Rules

11.2.1.2 SCA Component Type .componentType File

An SCA business_rule_name.componentType file is included with each Decision component. This file lists the services exposed by the business rules service component. In the following sample, two services are exposed: CreditRatingService and LoanAdvisorService. ?xml version=1.0 encoding=UTF-8 ? -- Generated by Oracle SOA Modeler version 1.0 at [52407 9:27 AM]. -- componentType xmlns=http:xmlns.oracle.comsca1.0 service name=CreditRatingService interface.wsdl interface=http:xmlns.oracle.comcreditratingRatingwsdl.interfaceIDecisionSer vice service service name=LoanAdvisorService interface.wsdl interface=http:xmlns.oracle.comloanofferAdvisorwsdl.interfaceIDecisionServi ce service componentType

11.2.1.3 Decision Component Entry in composite.xml

An entry in composite.xml is created for a decision component. For example, component name=OracleRules1 implementation.decision src=OracleRules1.decs 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.

11.2.2 Working with Decision Components that Expose a Decision Function