Click Test. In the Input Arguments area, select XML View. Replace the XML with the Click Test Web Service. In the Response tab, view the results. For example, for this input:

Working with Decision Tables 5-47 Figure 5–44 Testing the Order Approval Application

2. Click Test.

3. In the Input Arguments area, select XML View. Replace the XML with the

contents of example Example 5–2 . Example 5–2 Sample Input for Testing Order Approval Application soap:Envelope xmlns:soap=http:schemas.xmlsoap.orgsoapenvelope soap:Body xmlns:ns1=http:xmlns.oracle.comOracleRules1OracleRules1_DecisionService_1 ns1:callFunctionStateless name=OracleRules1_DecisionService_1 ns1:parameterList xmlns:ns3=http:example.comnscustomerorder ns3:CustomerOrder ns3:nameGaryns3:name ns3:creditScore600ns3:creditScore ns3:annualSpending2001.0ns3:annualSpending ns3:valueHighns3:value ns3:order100.0ns3:order ns3:CustomerOrder ns1:parameterList ns1:callFunctionStateless soap:Body soap:Envelope 4. Replace the values in the input shown in Example 5–2 as desired for your test.

5. Click Test Web Service.

6. In the Response tab, view the results. For example, for this input:

OracleRules1_DecisionService_1 xmlns:ns2=http:xmlns.oracle.combpel resultList OrderApproval:OrderApproval xmlns:OrderApproval=http:example.comnscustomerorder xmlns=http:example.comnscustomerorder 5-48 Oracle Fusion Middleware Users Guide for Oracle Business Rules statusapprovedstatus OrderApproval:OrderApproval resultList callFunctionStatefulDecision 6 Working with Decision Functions 6-1 6 Working with Decision Functions Use a decision function to call rules from a Java application, from a composite, or from a BPEL process. This chapter includes the following sections: ■ Section 6.1, Introduction to Decision Functions ■ Section 6.2, Working with Decision Functions ■ Section 6.3, What You Need to Know About Decision Functions

6.1 Introduction to Decision Functions

A decision function is a function that is configured declaratively. A decision function contains the following declarations: ■ input facts ■ rulesets and nested decision functions ■ output facts A decision function performs the following operations: ■ Asserts inputs as rule facts into the Oracle Business Rules Engine working memory ■ Runs rulesets configured in the current decision function and in nested decision functions in order ■ Returns output facts from the Oracle Business Rules Engine working memory You can create a decision function to simplify the use of Oracle Business Rules from a Java application or from a BPEL process. In a decision function the rules you want to use can be organized into several rulesets, and those rulesets can be executed in a prescribed order. Facts may flow to the first ruleset, and this ruleset may assert additional facts that flow to the second and subsequent rulesets until finally facts flow back to the decision function as decision function output.

6.2 Working with Decision Functions

A decision function is a function that is configured declaratively.

6.2.1 How to Add or Edit a Decision Function

You use Rules Designer to add a decision function.