Working with Decision Components that Expose a Decision Function Using Stateful Interactions with a Decision Component

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

You can use a Decision service to expose an Oracle Business Rules Decision Function as a service. A decision function is a function that is configured declaratively, without using RL Language programming that you use to call rules from a Java EE application or from a BPEL process. Example 11–1 shows a business_rule_name.decs file decisionServices element that defines the metadata for an Oracle Business Rules Decision Function exposed as a service. Example 11–1 decisionService for Decision Function Execution ?xml version=1.0 encoding=UTF-8 standalone=yes? decisionServices xmlns=http:xmlns.oracle.combpelrules name=PurchaseItems ruleEngineProvider name=OracleRulesSDK provider=Oracle_11.0.0.0.0 repository type=SCA-Archive pathPurchasingSampleProjectoraclerulescomexamplePurchaseItems.rulespath repository ruleEngineProvider decisionService targetNamespace=http:xmlns.oracle.comPurchaseItemsPurchaseItems_DecisionService_Validate PurchasesDF ruleEngineProviderReference=OracleRulesSDK name=PurchaseItems_DecisionService_ValidatePurchasesDF catalogPurchaseItemscatalog pattern name=CallFunctionStateless arguments callcom.example.PurchaseItems.ValidatePurchasesDFcall arguments Working with Decision Components in SOA Applications 11-5 pattern pattern name=CallFunctionStateful arguments callcom.example.PurchaseItems.ValidatePurchasesDFcall arguments pattern decisionService decisionServices In this case, the decision function ValidatePurchasesDF itself is specified entirely in the PurchaseItems.rules file. For more information, see, Chapter 6, Working with Decision Functions .

11.2.3 Using Stateful Interactions with a Decision Component

To provide a stateful Decision service you create a decision function and specify that the decision function is not stateless. To do so you deselect the Stateless checkbox in a decision function. Note the following details about stateful interactions with a decision component also see Figure 11–2 : ■ Rule sessions from the cache and those from the pool are mutually exclusive: – The rule session pool is for simple, stateless interactions only – The rule session cache keeps the state of a rule session across Decision service requests

11.2.4 What You Need to Know About Stateful Interactions with Decision Components