<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
   <title>Oracle Business Rules</title>
   <link rel="alternate" type="text/html" href="http://blogs.oracle.com/rules/" />
   <link rel="self" type="application/atom+xml" href="http://blogs.oracle.com/rules/xml/rss.xml" />
   <id>tag:blogs.oracle.com,2009:/rules//557</id>
   <updated>2009-09-04T17:03:19Z</updated>
   <subtitle>a discussion of Oracle Business Rules and rules engines in general</subtitle>
   <generator uri="http://www.sixapart.com/movabletype/">Movable Type Enterprise 4.23-en</generator>


<entry>
   <title>BI Powered Business Rules </title>
   <link rel="alternate" type="text/html" href="http://blogs.oracle.com/rules/2009/09/bi_powered_business_rules.html" />
   <id>tag:blogs.oracle.com,2009:/rules//557.14210</id>
   
   <published>2009-09-04T16:58:28Z</published>
   <updated>2009-09-04T17:03:19Z</updated>
   
   <summary> Check out Building Intelligent Processes with Insight-Driven Agility, an article on combining BPM/SOA and BI by Matt Miller, Head of Business Analysis and Testing at Motability Operations, and Mark Simpson, an Oracle ACE Director and leader of the SOA...</summary>
   <author>
      <name>Manoj Das</name>
      
   </author>
   
   
   <content type="html" xml:lang="en" xml:base="http://blogs.oracle.com/rules/">
      <![CDATA[<p>
Check out <a href="http://www.oracle.com/technology/architect/enterprise_solution_cookbook/building_intelligent_processes.html">Building Intelligent Processes with Insight-Driven Agility</a>, an article on combining BPM/SOA and BI by Matt Miller, Head of Business Analysis and Testing at <a href="http://www.motability.co.uk">Motability </a>Operations, and Mark Simpson, an Oracle ACE Director and leader of the SOA technology practice for <a href=http://www.griffiths-waite.co.uk>Griffiths Waite</a>.
</p>
<p>
Among other things, this article discusses how Business Rules can leverage BI information as contextual facts to drive optimal decisions.</p>
<span class="mt-enclosure mt-enclosure-image" style="display: inline;"><img alt="building_intelligent_processes_fig03.png" src="http://blogs.oracle.com/rules/2009/09/04/building_intelligent_processes_fig03.png" width="349" height="191" class="mt-image-none" style="" /></span>
<p>
Happy reading! Again, the article is <a href="http://www.oracle.com/technology/architect/enterprise_solution_cookbook/building_intelligent_processes.html">here</a>. 
</p>
]]>
      
   </content>
</entry>

<entry>
   <title>Oracle Fusion Middleware 11gR1 Released!</title>
   <link rel="alternate" type="text/html" href="http://blogs.oracle.com/rules/2009/07/oracle_fusion_middleware_11gr1.html" />
   <id>tag:blogs.oracle.com,2009:/rules//557.13255</id>
   
   <published>2009-07-09T00:16:57Z</published>
   <updated>2009-07-09T00:17:13Z</updated>
   
   <summary>We&apos;re all really excited to announce the release of Oracle Fusion Middleware 11gR1! This includes some significant improvements to Oracle Business Rules. You can find more information on the Oracle Business Rules homepage. Oracle Fusion Middleware 11gR1 can be downloaded...</summary>
   <author>
      <name>Phil Varner</name>
      
   </author>
   
   
   <content type="html" xml:lang="en" xml:base="http://blogs.oracle.com/rules/">
      <![CDATA[<p>We're all really excited to announce the release of Oracle Fusion Middleware 11gR1! This includes some significant improvements to Oracle Business Rules.  You can find more information on the <a href="http://www.oracle.com/technology/products/soa/rules/index.html">Oracle Business Rules homepage</a>.</p>

<p>Oracle Fusion Middleware 11gR1 can be downloaded <a href="http://www.oracle.com/technology/software/products/middleware/index.html">here</a>.</p>

<p>Rule Designer, the design-time UI component for Jdeveloper, is part of the Oracle SOA Composite Editor and can be downloaded <a href=" http://www.oracle.com/technology/products/jdev/101/update/fmw_products.xml">here</a>.</p>

<p>OBR 11g documentation can be found <a href="http://www.oracle.com/technology/products/soa/rules/collateral/documentation.html#11g">here</a>.</p>

<p>Information on upgrading OBR 10g dictionaries to OBR 11g can be found in <i>Oracle Fusion Middleware Upgrade Guide for Oracle SOA Suite, WebCenter, and ADF</a> <br />
<a href="http://download.oracle.com/docs/cd/E12839_01/upgrade.1111/e10127/migrate_rules_app.htm#CACGDICE">Appendix C Upgrading Oracle Business Rules Dictionaries and Projects</a>.</p>

<p>Finally, there are a few <a href="http://download.oracle.com/docs/cd/E12839_01/relnotes.1111/e10133/rules.htm#CJADCAAA">release notes</a>.</p>]]>
      
   </content>
</entry>

<entry>
   <title>Business Rules 11 Rocks - A Preview</title>
   <link rel="alternate" type="text/html" href="http://blogs.oracle.com/rules/2009/03/rules11_preview.html" />
   <id>tag:blogs.oracle.com,2009:/rules//557.10653</id>
   
   <published>2009-03-08T14:55:21Z</published>
   <updated>2009-03-17T22:49:59Z</updated>
   
   <summary>In our upcoming 11g release, we have added many features and enhancements to Oracle Business Rules (OBR). Everyone that has used the preview version, or has seen a demo, has been very positive. Whether you are familiar with OBR or...</summary>
   <author>
      <name>Manoj Das</name>
      
   </author>
   
   
   <content type="html" xml:lang="en" xml:base="http://blogs.oracle.com/rules/">
      <![CDATA[<p>In our upcoming 11g release, we have added many features and enhancements to Oracle Business Rules (OBR). Everyone that has used the preview version, or has seen a demo, has been very positive. Whether you are familiar with OBR or not, we believe, you will be very pleasantly surprised with the simplicity, richness, and power of OBR 11g.</p>

<p>We recently demonstrated the preview version of OBR 11g to Jim Sinur from Gartner and he <a href="http://blogs.gartner.com/jim_sinur/2009/03/05/oracle-and-business-rules-purposed-split-strategies/">blogged </a>about it:<br />
<blockquote><strong>Process and Infrastructure: Now for the good news</strong></p>

<p>While one could argue that Oracles wrapped JESS based rule engine is not the best one in Oracles inventory of BREs, but it is more than sufficient. Oracle is upping its usability and penetration into Oracles BPM offering. I was given an advanced demo of the interaction of Oracle BPM and their advancing rule engine and I came away pleased. This BRE is pervasive in most, if not all, of the process components and it is much easier to use than ever before. With the addition of decision tables and rule modeling/evaluation, the rule engine is something that a trained business analyst could use. In addition there were aspects of a budding business rule management system (BRMS) that included major aspects of change control and rule packaging. I was pleasantly surprised and excited about hearing from Beta users later this year.</blockquote></p>

<p>Some of the enhancements in OBR 11g include:</p>

<p><strong>1. Decision Tables</strong><br />
Decision Tables is a spreadsheet like metaphor for business rules authoring. In addition to being easier to understand for business analysts, it also provides more validation support including checks for overlapping rules and completeness.<br />
<img alt="decisiontable.png" src="http://blogs.oracle.com/rules/decisiontable.png" width="100%" height="100%" title="Decision Tables in OBR 11g" /><br />
Click <a href="http://blogs.oracle.com/rules/decisiontable.png" target="_blank">here </a>to see full image.</p>

<p>To learn more about the Decision Tables feature in OBR 11g, please see this <a href="http://www.oracle.com/technology/products/ias/business_rules/11/rules11decisiontables1_viewlet_swf.html">demo recording</a>.</p>

<p><strong>2. Much simpler to use</strong><br />
OBR 11g makes it real simple to write simple rule. Actually, using the capabilities to nest conditions and change conjunctions (and) to disjunctions (or), very sophisticated rules can be written in the simple mode. Couple this with OBR's inference capability, which enables breaking complex rules into more atomic rules that can then be implicitly chained and re-used, you have a very powerful capability in a very simple to use form.</p>

<p>To learn more about the simplified authoring experience in OBR 11g, please see this <a href="http://www.oracle.com/technology/products/ias/business_rules/11/rules11simplerifthenrules_viewlet_swf.html">demo recording</a>.</p>

<p><strong> 3. Seamless integration with BPEL and Composite</strong><br />
First, seamless unification of components is a major theme for our upcoming 11g release; this provides our customers a very well integrated design time, run time, and management experience.</p>

<p>In context of Business Rules and BPEL, among other integrations, we have made the scenario where you want to externalize some logic from BPEL to rules very seamless. You can create a new rules dictionary from within BPEL, select the BPEL variables you want to use as inputs and outputs for your rules, and a dictionary is created for you that is completely ready to start writing rules - i.e. you do not need to manually import your facts (data model) etc. Of course, you can also re-use an existing rules dictionary from your BPEL process.</p>

<p>To learn more about the integration of OBR and BPEL, please see this <a href="http://www.oracle.com/technology/products/ias/business_rules/11/rules11bpel_integration_viewlet_swf.html">demo recording</a>.</p>

<p><strong>4. Rules for Human Task Routing</strong><br />
In our 10g product, we leverage OBR from our Human Workflow component in BPEL PM to manage vacation rules, delegation rules, load balancing rules, etc. </p>

<p>In 11g, we have a very powerful integration between OBR and Human Workflow for Task routing. Business Rules can be specified for determining the flow of a Task, such as whether the Task should be sent to the next participant, completed, escalated, or sent to a different participant. These rules are invoked by Human Workflow each time it needs to move Task from one participant to another or other Task state changes.</p>

<p>This feature is being significantly used by Fusion Apps for sophisticated approval routing.</p>

<p>To learn more about rules driven task-routing, please see this <a href="http://www.oracle.com/technology/products/ias/business_rules/11/rules11ruledrivenworkmanagement_viewlet_swf.html">demo recording</a>.</p>

<p><strong>5. Aggregate Conditions</strong><br />
Many times, we need to write rules that are based not only on one fact (data) but conditions that are based on having a view spanning multiple facts, i.e. aggregated conditions. In our 10g product, we already support some of these scenarios; we support writing rules that check for existence of a fact type or lack there-of.</p>

<p>In OBR 11g, we are introducing support for aggregate conditions. Out-of-box, we support common aggregation functions such as sum, average, count, min, max. You can provide your own aggregation functions too.</p>

<p>To illustrate the capability of this feature, if I want to write a rule which specifies that if an Order has more than 5 line items whose price is above a threshold, require manual approval, I can write a rule like (pseudo-code for illustration):<br />
<blockquote><em>numPricey = <strong>count </strong>of lineItems such that lineItems.price > threshold and<br />
numPricey > 5<br />
then ...</em></blockquote></p>

<p>To learn more about support for aggregate conditions, please see this <a href="http://www.oracle.com/technology/products/ias/business_rules/11/rules11aggregates_viewlet_swf.html">demo recording</a>.</p>

<p><br />
There are a lot more exciting enhancements in OBR 11g including Decision Functions that provide a declarative mechanism for creating rule flows/pipelines, Dictionary Links that enable splitting a virtual dictionary into multiple physical ones for re-use or finer grained versioning and access control, and MDS as a repository. These would be good topics for a future blog post.</p>

<p>We are very excited about OBR 11g and hope you will share the excitement. To learn more about the 11g release, please visit the <a href="http://www.oracle.com/technology/products/ias/bpel/techpreview/index.html">SOA 11g - Technology Preview</a> site.</p>

<p><br />
</p>]]>
      
   </content>
</entry>

<entry>
   <title>Smart Business Processes with Oracle Business Rules</title>
   <link rel="alternate" type="text/html" href="http://blogs.oracle.com/rules/2008/12/smart_bpm_with_oracle_business.html" />
   <id>tag:blogs.oracle.com,2008:/rules//557.9197</id>
   
   <published>2008-12-18T20:03:10Z</published>
   <updated>2009-02-26T20:38:21Z</updated>
   
   <summary>We&apos;ve just put a new whitepaper on Smart Business Processes with Oracle Business Rules on our official site....</summary>
   <author>
      <name>Phil Varner</name>
      
   </author>
   
   <category term="bpm" label="bpm" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="whitepaper" label="whitepaper" scheme="http://www.sixapart.com/ns/types#tag" />
   
   <content type="html" xml:lang="en" xml:base="http://blogs.oracle.com/rules/">
      <![CDATA[<p>We've just put a new whitepaper on <a href="http://www.oracle.com/technology/products/ias/business_rules/files/smart_business_processes_using_oracle_business.pdf">Smart Business Processes with Oracle Business Rules</a> on our <a href="http://www.oracle.com/technology/products/ias/business_rules/index.html">official site</a>.</p>]]>
      
   </content>
</entry>

<entry>
   <title>Rules Resources</title>
   <link rel="alternate" type="text/html" href="http://blogs.oracle.com/rules/2008/12/rules_resources.html" />
   <id>tag:blogs.oracle.com,2008:/rules//557.9195</id>
   
   <published>2008-12-18T19:39:06Z</published>
   <updated>2008-12-18T20:02:30Z</updated>
   
   <summary>This post gathers together some of the resources for learning how to do rules programming, and specifically how to use Oracle Business Rules. Currently, all publicly available documentation from Oracle is for the 10.1.3 version of OBR: The official webpage...</summary>
   <author>
      <name>Phil Varner</name>
      
   </author>
   
   
   <content type="html" xml:lang="en" xml:base="http://blogs.oracle.com/rules/">
      <![CDATA[<p>This post gathers together some of the resources for learning how to do rules programming, and specifically how to use Oracle Business Rules.</p>

<p><br />
Currently, all publicly available documentation from Oracle is for the 10.1.3 version of OBR: </p>

<ul>
<li><a href="http://www.oracle.com/technology/products/ias/business_rules/index.html
">The official webpage for Oracle Business Rules</a>
<li><a href="http://download.oracle.com/docs/cd/B31017_01/web.1013/b28965/toc.htm
">OBR User's Guide (10.1.3)</a>
<li><a href="http://download.oracle.com/docs/cd/B31017_01/web.1013/b28964/toc.htm
">Oracle Business Rules Language Reference (10.1.3)</a>
<li><a href="http://download.oracle.com/docs/cd/B31017_01/web.1013/b19040/index.html">OBR SDK Javadoc (10.1.3)</a>
<li><a href="http://download.oracle.com/docs/cd/E12524_01/relnotes.1013/e12523/rules.htm
">OBR 10.1.3.4 release notes</a> (there were only minor changes between point releases, so the documentation above listed as "10.1.3.1" applies to all of the 10.1.3 versions)
<li><a href="http://download.oracle.com/docs/cd/B31017_01/web.1013/b28965/decision.htm">Chapter 18 BPEL Process Integration with Business Rules</a> of the Oracle BPEL Process Manager Developer's Guide, which describes using the Decision Service
</ul>

<p>For questions or issues with OBR, the <br />
<a href="http://forums.oracle.com/forums/forum.jspa?forumID=320">SOA Suite category on the Oracle Forums</a> is the the best place to go.</p>

<p>Unfortunately, there aren't many books on rules programming out there.  Here are a few of the relevant ones:</p>

<ul>
<li>Jess in Action by Ernest Friedman-Hill - while the Lisp-style syntax may be daunting to many OO programmers, there's a lot of good information on how rules engines work in practice and on how to write rules.
<li>Smart (Enough) Systems by James Taylor and Neil Raden - this book mostly focuses on the business case for improved decision support, but has an excellent chapter on the current state of business rules engines (BRE) and business rules management systems (BRMS).
<li>Expert Systems: Principles and Programming by Giarratano and Riley - a thorough and deeply technical description of rules principles.
<li>Introduction to Expert Systems by Peter Jackson - another very technical book
</ul>

<p>Plenty to get you started in the wonderful world of rules!</p>]]>
      
   </content>
</entry>

<entry>
   <title>Asserting an entire XML document (10.1.3)</title>
   <link rel="alternate" type="text/html" href="http://blogs.oracle.com/rules/2008/12/asserting_an_entire_xml_docume.html" />
   <id>tag:blogs.oracle.com,2008:/rules//557.9171</id>
   
   <published>2008-12-17T22:44:45Z</published>
   <updated>2008-12-17T23:15:10Z</updated>
   
   <summary>When one calls the normal &quot;assert&quot; function on an object, only that fact is asserted. OBR also allows you to assert an object graph consisting of JAXB objects representing an XML document with the &quot;assertXPath&quot; function. This will assert the...</summary>
   <author>
      <name>Phil Varner</name>
      
   </author>
   
   <category term="1013" label="10.1.3" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="assertxpath" label="assertXPath" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="decisionservice" label="decision service" scheme="http://www.sixapart.com/ns/types#tag" />
   
   <content type="html" xml:lang="en" xml:base="http://blogs.oracle.com/rules/">
      <![CDATA[<p>When one calls the normal "assert" function on an object, only that fact is asserted.  OBR also allows you to assert an object graph consisting of JAXB objects representing an XML document with the "assertXPath" function.  This will assert the tree of objects starting with object passed to the function.  The most common path to assert is "//*", meaning the entire subtree, but any arbitrary XPath can be used.  assertXPath will assert only objects for which there is a 1-to-many relationship with the parent object.  In the JAXB generated code, by default this is represented by a property of List type.  </p>

<p>Objects in the hierarchy with a 1-to-1 relationship with their parent can be accessed directly via their parent's property, so it is not necessary to assert them in most cases.  This also means that when a schema definition has an object hierarchy with a 1-to-1-to-many relationship, the child and grandchild objects will not be asserted.  Some schemas define this type of relationship explicitly, but it can also occur in some situations when anonymous complex types are used.  </p>

<p>If the user wishes to have the entire tree below the 1-to-1 relationship asserted, then this tree must be explicitly asserted.  One way to do this is to write a rule that will match the parent fact type and call assertXPath with the the child fact type instance as an argument.  This rule can then be made to run before all other rules.  In the case of invoking a single ruleset from a decision service, this rule should be in the invoked ruleset with a priority higher than all other rules in the ruleset.  In the case of invoking a function, the rule should be in a ruleset which is pushed onto the ruleset stack last, so it will be executed first.  Because the rule will only match on the fact type, and not any of the properties of the fact type instance, the rule must be written like:</p>

<p>if (fact Parent p && not exists (fact Child c && p.child != c) )</p>

<p>Meaning, the parent exists but the child does not.  If only the parent fact is matched, then the rule will re-fire anytime the parent fact is changed, reasserting the child and re-firing any rules which depend on the child.  In Rule Author, "not exists" is implemented using the "there is no case where" form of a pattern.</p>

<p>When creating a decision service which invokes a single ruelset, there is a checkbox labeled "Check here to assert all decendants from the top level element".  This will cause the decision service to use assertXPath with the path as "//*" instead of the default of only asserting the root object.  If you wish to assert something other than "//*" in the decision service, the decisionservice.xml file can be edited to replace "//*" with the desired XPath expression.</p>]]>
      
   </content>
</entry>

<entry>
   <title>Three quick decision service tips (10.1.3)</title>
   <link rel="alternate" type="text/html" href="http://blogs.oracle.com/rules/2008/12/three_quick_decision_service_t.html" />
   <id>tag:blogs.oracle.com,2008:/rules//557.9170</id>
   
   <published>2008-12-17T20:58:46Z</published>
   <updated>2008-12-17T22:36:36Z</updated>
   
   <summary>Assert Fact and Watch Fact If the same fact type instance is used for input and output to the decision service, both Assert Fact and Watch Fact must be checked for that fact type in the decision service wizard. Editing...</summary>
   <author>
      <name>Phil Varner</name>
      
   </author>
   
   
   <content type="html" xml:lang="en" xml:base="http://blogs.oracle.com/rules/">
      <![CDATA[<p><strong>Assert Fact and Watch Fact</strong><br />
If the same fact type instance is used for input and output to the decision service, both Assert Fact and Watch Fact must be checked for that fact type in the decision service wizard.</p>

<p><strong>Editing a decision service</strong><br />
The only way to edit a decision service is to begin to create a new Decide activity.  Click on the edit "pencil" icon.  However, the only thing you can only change the function or ruleset which is called.  Also note that when you edit the decision service, the Decision Service drop down menu is reset, to the decision service you selected to edit is no longer selected and must be reselected.  If you need to change anything other than the function or ruleset called, you must create a new decision service.  </p>

<p><strong>Creating a Decision Service which uses a WebDAV repository</strong><br />
You cannot access the WebDAV connection wizard after starting the decision service wizard, so you must create the WebDAV connection from the Connections tab before starting the decision service wizard.</p>

<p><br />
</p>]]>
      
   </content>
</entry>

<entry>
   <title>File-based vs. WebDAV Rule Repositories (10.1.3)</title>
   <link rel="alternate" type="text/html" href="http://blogs.oracle.com/rules/2008/12/filebased_vs_webdav_rule_repos.html" />
   <id>tag:blogs.oracle.com,2008:/rules//557.9166</id>
   
   <published>2008-12-17T20:38:07Z</published>
   <updated>2009-01-06T17:34:06Z</updated>
   
   <summary>In production, it is recommended to use the WebDAV repository option. However, during development, this can be laborious, since the WebDAV repository is slower than the file-based repository, as it usually on a remote machine. Additionally, if the WebDAV repository...</summary>
   <author>
      <name>Phil Varner</name>
      
   </author>
   
   
   <content type="html" xml:lang="en" xml:base="http://blogs.oracle.com/rules/">
      <![CDATA[<p>In production, it is recommended to use the WebDAV repository option.  However, during development, this can be laborious, since the WebDAV repository is slower than the file-based repository, as it usually on a remote machine.  Additionally, if the WebDAV repository connection is over a slow link, the UI can pause for several seconds at a time while the repository is accessed.  The latency usually isn't an issue at runtime because the repository is accessed infrequently by the running decision service.  However, during design-time, it can be advantageous to use a file-based repository for development and then change the decision service configuration to use WebDAV when the application is ready for production deployment.  </p>

<p>There are two primary things that need to be done: (1) moving the dictionary or dictionaries from the file-based repository to the WebDAV repository, and (2) changing the decision service to use the WebDAV connection.</p>

<p>I've seen people try to just copy their file-based repository to their WebDAV repository, but this will not work.  The repository itself is nothing more than a collection of appropriately named XML files representing the rules.  A file-based repository is a zip file of these files, and a WebDAV repository is a directory of these files.  So, copying the file-based repository into the WebDAV directory is putting a repository inside another repository!</p>

<p>To move a dictionary between a file and WebDAV repository or vice-versa:<br />
1) In Rule Author, connect to the source repository.<br />
2) Choose the "export" tab.<br />
3) Export the dictionary and download the resulting export file.<br />
4) Disconnect from the source repository.<br />
5) Connect to the destination repository.<br />
6) Choose the "import" tab.<br />
7) Select the previously exported file and import that file.<br />
8) Save the dictionary.<br />
9) Done!</p>

<p>The next step is to modify the decision service to use the WebDAV repository.  To do this, open the file:</p>

<p>JDev_Oracle_Home\jdev\mywork\application_name\<br />
process_name\decisionservices\DecisionService\war\WEB-INF\<br />
classes\decisionservices.xml</p>

<p>In the ruleEngineProvider element, "repository" element must be changed from something like: </p>

<p>    &lt;repository type="File"&gt;<br />
      &lt;file&gt;repositoryresource:CreditRatingRepository&lt;/file&gt;<br />
    &lt;/repository&gt;</p>

<p>to something like:</p>

<p>&lt;repository type="WebDAV"&gt;<br />
    &lt;webdav&gt;<br />
        &lt;url&gt;http://myhost.mydomain.com:8080/rules/repository/&lt;/url&gt;<br />
        &lt;username&gt;bob&lt;/username&gt;<br />
        &lt;password encrypted="true"&gt;r9CqG45+Cg=&lt;/password&gt;<br />
    &lt;/webdav&gt;<br />
&lt;/repository&gt; </p>

<p>Instead of manually creating the "webdav" element in decisionservices.xml, I usually create a new decision servce which uses the WebDAV repository and then copy the "repository" element created for that decision service into the one I want to change.  This way, there's much less chance of a typo and I don't have to manually encrypt the password.<br />
</p>]]>
      
   </content>
</entry>

<entry>
   <title>Enabling debug output in a BPEL Decision Service (10.1.3)</title>
   <link rel="alternate" type="text/html" href="http://blogs.oracle.com/rules/2008/12/enabling_debug_output_in_a_bpe.html" />
   <id>tag:blogs.oracle.com,2008:/rules//557.9151</id>
   
   <published>2008-12-17T06:51:12Z</published>
   <updated>2008-12-17T07:02:24Z</updated>
   
   <summary>Section 18.7.2 of the Oracle BPEL Process Manager Developer&apos;s Guide 10g (10.1.3.1.0) contains instructions for enabling debug logging for a decision service. However, unless you are familiar with BPEL debugging already, there is one step missing. The logging is at...</summary>
   <author>
      <name>Phil Varner</name>
      
   </author>
   
   
   <content type="html" xml:lang="en" xml:base="http://blogs.oracle.com/rules/">
      <![CDATA[<p><a href="http://download.oracle.com/docs/cd/B31017_01/integrate.1013/b28981/decision.htm#sthref3331">Section 18.7.2</a> of the Oracle BPEL Process Manager Developer's Guide 10g (10.1.3.1.0) contains instructions for enabling debug logging for a decision service. However, unless you are familiar with BPEL debugging already, there is one step missing.  The logging is at the "debug" level, but the BPEL server sets the logging level to "info" by default.  </p>

<p>To change the logging level to "debug" so you can see the logging information from your rules:<br />
<ul><br />
<li>From the BPEL Control panel, click on the "Configuration" tab.  <br />
<li>From that tab, click on the "Logging" sub-tab.  <br />
<li>For the "Logger Name" "default.collaxa.cube.engine.bpel", select "Debug" for the "Logging Level.  <br />
<li>Click the Apply button at the bottom of the page.  <br />
</ul></p>

<p>Debugging output is now enabled and will be available in the OPMN log for the domain in which the process is deployed.<br />
</p>]]>
      
   </content>
</entry>

<entry>
   <title>File-based rules repository in a BPEL Decision Service (10.1.3)</title>
   <link rel="alternate" type="text/html" href="http://blogs.oracle.com/rules/2008/12/filebased_rules_repository_in.html" />
   <id>tag:blogs.oracle.com,2008:/rules//557.9142</id>
   
   <published>2008-12-15T21:58:21Z</published>
   <updated>2008-12-15T22:48:33Z</updated>
   
   <summary>In 10.1.3, the two types of rule repositories are file-based and WebDAV. WebDAV is recommended for production deployment, but some people may still want to use a file-based repository. Support for product lifecycle is not as strong when using a...</summary>
   <author>
      <name>Phil Varner</name>
      
   </author>
   
   <category term="1013" label="10.1.3" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="bpel" label="BPEL" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="decisionservice" label="decision service" scheme="http://www.sixapart.com/ns/types#tag" />
   
   <content type="html" xml:lang="en" xml:base="http://blogs.oracle.com/rules/">
      <![CDATA[<p>In 10.1.3, the two types of rule repositories are file-based and WebDAV.  WebDAV is recommended for production deployment, but some people may still want to use a file-based repository.  Support for product lifecycle is not as strong when using a file-based repository, so this post describes the manual steps that must be performed.</p>

<p>When you deploy the BPEL process with a decision service that uses file repository, a copy of repository is packaged with the decision service.  The decision service refers to this copy when executing.  To modify the rules without redeploying the BPEL process, you must modify this copy on the server.  To do this, go to the BPEL Console, click on your BPEL process, and go to the descriptor tab. This page contains a link to open the  deployed rule repository using Rule Author. </p>

<p>Changes to the deployed dictionary will be reflected in decision service instances created after the dictionary is saved.  A stateless decision service keeps a pool of rule engine instances which it re-uses, and will refresh these instances with new ones when it detects the dictionary has changed.  A stateful decision service creates a new rule engine instance every time it is invoked and will always be created with the latest version of the dictionary.</p>

<p>If you make changes to the deployed file-based dictionary, you must manually copy this file back into your JDeveloper project if you wish to have the changes persist in the next deployment of the decision service.</p>

<p><br />
</p>]]>
      
   </content>
</entry>

<entry>
   <title>Making rules repository access faster (10.1.3)</title>
   <link rel="alternate" type="text/html" href="http://blogs.oracle.com/rules/2008/12/making_rules_repository_access.html" />
   <id>tag:blogs.oracle.com,2008:/rules//557.9051</id>
   
   <published>2008-12-10T02:11:06Z</published>
   <updated>2008-12-10T02:21:53Z</updated>
   
   <summary>This post describes a performance enhancement available in the 10.1.3.3 and 10.1.3.4 releases which can significantly speed up the repository access, particularly in dictionaries with large numbers of rulesets. By default in 10.1.3, the rules repository stores each ruleset in...</summary>
   <author>
      <name>Phil Varner</name>
      
   </author>
   
   <category term="1013" label="10.1.3" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="performance" label="performance" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="repository" label="repository" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="webdav" label="webdav" scheme="http://www.sixapart.com/ns/types#tag" />
   
   <content type="html" xml:lang="en" xml:base="http://blogs.oracle.com/rules/">
      <![CDATA[<p>This post describes a performance enhancement available in the 10.1.3.3 and 10.1.3.4 releases which can significantly speed up the repository access, particularly in dictionaries with large numbers of rulesets.</p>

<p>By default in 10.1.3, the rules repository stores each ruleset in a separate XML document.  In a file-based repository, these documents are stored within a zip file.  In a WebDAV repository, these documents are stored in a WebDAV-visible directory.  This default mode for storing the rulesets is known as "multiple document format".  This format was first used in the 10.1.3.1 release, and continued through to the 10.1.3.3 and 10.1.3.4 releases for backwards compatibility.  However, multiple document format has negative performance ramifications, particularly with large numbers of rulesets in a WebDAV repository.  The 10.1.3.3 and 10.1.3.4 releases also have the option of storing all rulesets in a single document to provide better performance.  Multiple document format repositories must be manually converted to single document format to take advantage of these performance benefits.    </p>

<p>The following utility will convert a rule repository to single document format. All dictionaries that are not in single document format are converted. Once the repository is converted, all new dictionaries that are created will be in single document format.  This utility is contained in the rulesdk.jar file.  </p>

<p>These classes are required on the classpath when running these commands: xmlparserv2.jar, xmlmesg.jar, xml.jar, orai18n.jar, oraclepki.jar, ojpse.jar, http_client.jar, rl.jar, rulesdk.jar, jr_dav.jar, webdavrc.jar.</p>

<p>java oracle.rules.sdk.repository.SingleDocumentFormat<br />
  -type repository_type<br />
  -path file_path | -url webdav_url [-wallet wallet_path]<br />
where<br />
  repository_type is either file or webdav<br />
  file_path is the path to a file repository<br />
  webdav_url is the URL for a WebDAV repository<br />
  wallet_path is the path to an Oracle wallet containing WebDAV credentials<br />
A file_path or a webdav_url must be provided.</p>

<p>Additionally, there is a similar utility that converts a rule repository from single document format to the multiple document format. All dictionaries that are not in multiple document format are converted. Once the repository is converted, all new dictionaries that are created will be in multiple document format.</p>

<p>java oracle.rules.sdk.repository.MultipleDocumentFormat<br />
  -type repository_type<br />
  -path file_path | -url webdav_url [-wallet wallet_path]<br />
where<br />
  repository_type is either file or webdav<br />
  file_path is the path to a file repository<br />
  webdav_url is the URL for a WebDAV repository<br />
  wallet_path is the path to an Oracle wallet containing WebDAV credentials</p>

<p>A file_path or a webdav_url must be provided.</p>]]>
      
   </content>
</entry>

<entry>
   <title>Rules from BPEL:  Decision Service Usage Patterns Explained (10.1.3)</title>
   <link rel="alternate" type="text/html" href="http://blogs.oracle.com/rules/2008/12/rules_from_bpel_decision_servi.html" />
   <id>tag:blogs.oracle.com,2008:/rules//557.8946</id>
   
   <published>2008-12-03T20:20:55Z</published>
   <updated>2008-12-10T02:22:39Z</updated>
   
   <summary>Introduction The integrated way to use Oracle Business Rules (OBR) from a BPEL process is via the Decision Service component through a Decide activity. Chapter 18 BPEL Process Integration with Business Rules of the Oracle BPEL Process Manager Developer&apos;s Guide...</summary>
   <author>
      <name>Phil Varner</name>
      
   </author>
   
   <category term="1013" label="10.1.3" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="bpel" label="BPEL" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="decisionservice" label="decision service" scheme="http://www.sixapart.com/ns/types#tag" />
   
   <content type="html" xml:lang="en" xml:base="http://blogs.oracle.com/rules/">
      <![CDATA[<p><strong>Introduction</strong></p>

<p>The integrated way to use Oracle Business Rules (OBR) from a BPEL process is via the Decision Service component through a Decide activity.  <a href="http://download.oracle.com/docs/cd/B31017_01/web.1013/b28965/decision.htm">Chapter 18 BPEL Process Integration with Business Rules</a> of the Oracle BPEL Process Manager Developer's Guide explains the basic steps for doing this, but there's always more information than can go in the official documentation.  This post explains in greater detail how to use the various decision service configurations. </p>

<p><strong>Stateful vs. stateless</strong></p>

<p>By default, the decision service is invoked as a stateful service.  This allows the same decision service instance to be called more than once within the same BPEL process instance and maintain state between calls.  For example, we may retrieve some data from a database, make a call to a stateful decision service, branch in our process based on the result, access the database again, and call the stateful decision service again with our additional data.</p>

<p>If you are only making one call to a decision service within a BPEL process using the "Assert facts, execute rule set, and retrieve results" operation type, consider changing the decision service to be stateless.  This will improve performance because a stateful service invocation creates a new rule engine instance for each call, whereas a stateless service maintains a pool of services that can be reused.  Thereby, the stateless service call has lower CPU overhead for creating the service instance and does not require additional memory because the rule engine instances already exist as part of the pool.</p>

<p><strong>Ruleset invocation type</strong></p>

<p>The Ruleset invocation type allows you to select from several Operation types, as described in section 18.4.3.1 "Mapping Input and Output Facts to BPEL Variables" of the BPEL Developer's Guide.  The most common usage is the "Assert facts, execute rule set, and retrieve results" type as a stateless session.  The other operation options are usually used for stateful sessions, whereby we want to maintain the state of the decision service between multiple calls, for example, if we wanted to use facts generated in the rules engine during one call as available to another call.</p>

<p><img alt="RulesetOptions.jpg" src="http://blogs.oracle.com/rules/RulesetOptions.jpg" width="480" height="507" /></p>

<p>The primary advantage of using the Ruleset invocation type is it's simplicity, as the assert, execute, and retrieve operations are easily defined with in the Decide component.  The primary disadvantage of using the Ruleset invocation type is that only rules from one ruleset will be evaluated.  You cannot evaluate multiple rulesets against the same facts or use a pattern by which rules in one ruleset causes additional ruleset to be evaluated via the pushRuleset mechanism, because only the named ruleset is created in the rule engine instance.  </p>

<p>Note that if you have multiple calls to the same decision service within a BPEL process, even these calls do not maintain state between them, it is preferred to use a stateful session.  This way, if the rules are modified during the lifetime of the process, the process will still use the rules which existed when the process started.  Otherwise, there is a possibility that different rules can be used for different invocations of the decision service.  Multiple calls to a stateful decision service that do not (or should not) maintain state between them should be invoked with the operation "Assert facts, execute rule set, retrieve results, and reset the session", so any facts in the rule engine are removed between calls.</p>

<p><strong>Function invocation type</strong></p>

<p>The most useful invocation type in the decision service is to call a function defined in the rules dictionary.  This allows the user greatest flexibility in how the rules are used.  However, this pattern also requires the user to perform some actions which can be automatically performed with the Ruleset invocation type.</p>

<p><img alt="FunctionOptions.jpg" src="http://blogs.oracle.com/rules/FunctionOptions.jpg" width="409" height="508" /></p>

<p>There are two operation types for the Function invocation type, "Execute function" and "Execute function and reset the session".  These have equivalent functionality when called as part of a stateless decision service.  When called from a stateful decision service, resetting the session will cause all facts to be retracted, as with the similar Ruleset operation type.</p>

<p>A function called from the decision service by this invocation type must meet the following requirements:<br />
<ol><br />
<li>return a XML Schema element type <br />
<li>accept one or more XML Schema element types as parameters.  <br />
</ol></p>

<p>It is necessary that the return and parameter types be XML Schema element types rather than XML Schema complex types.  If complex types are used, the functions will not appear in the dictionary browser and therefore cannot be selected. </p>

<p>The body of this function must do three things:</p>

<ol>
<li>assert the input parameters as facts
<li>push one or more rulesets onto the ruleset stack
<li>call the "run" method
</ol>

<p>An example of a function which can be called from the decision service is shown below:</p>

<p><img alt="DecisionServiceFunctionExample.jpg" src="http://blogs.oracle.com/rules/DecisionServiceFunctionExample.jpg" width="564" height="372" /></p>

<p>Function body:</p>

<p>assertXPath("com.oracle.fmw.obr.test1", email, "//*");<br />
pushRuleset("RULESET_1");<br />
run();<br />
return email;</p>

<p>This is a very simple function body.  The function body can assert any number of parameters and push any number of rulesets onto the stack.</p>

<p><br />
</p>]]>
      
   </content>
</entry>

<entry>
   <title>Multiple imports or includes in an XML Schema</title>
   <link rel="alternate" type="text/html" href="http://blogs.oracle.com/rules/2008/12/xml_schema_multiple_imports.html" />
   <id>tag:blogs.oracle.com,2008:/rules//557.8917</id>
   
   <published>2008-12-01T22:09:51Z</published>
   <updated>2008-12-17T06:44:31Z</updated>
   
   <summary>A common way to modularize a large XML schema is to divide the schema into multiple documents and then &quot;import&quot; or &quot;include&quot; these documents into a primary schema document. For more information on these techniques, see this page. However, sometimes...</summary>
   <author>
      <name>Phil Varner</name>
      
   </author>
   
   
   <content type="html" xml:lang="en" xml:base="http://blogs.oracle.com/rules/">
      <![CDATA[<p>A common way to modularize a large XML schema is to divide the schema into multiple documents and then "import" or "include" these documents into a primary schema document. For more information on these techniques, see <a href="http://www.oracle.com/technology/pub/articles/srivastava_structures.html">this page</a>.</p>

<p>However, sometimes users will encounter an error like the one below when trying to import it into a dictionary:</p>

<blockquote>
[ERROR] src-resolve: Cannot resolve the name 'ns0:Header' to a(n) 'type definition' component.
  line 13 of baz.xsd
</blockquote>

<p>This error indicates that the imported schema has multiple imports with the same namespace.  The XML Schema specification says that it's at the discretion of the parser whether or not it wants to acknowledge all of them, and most don't. Xerces is the parser used in WebLogic, and does not.  An import has the meaning of "components from namespace X might be found in schema Y," so the parser looks in one of them and then returns that the component cannot be found.  The name which the error indicates is in one of the ignored schemas, so the name can't be found.  </p>

<p>The most common way around this is to create a schema that includes all of the schemas you want to have in the same namespace, and then import that schema into your primary schema.</p>

<p>Example:<br />
intermediate.xsd:<br />
<blockquote><br />
&lt;schema targetNamespace="foobar" ...&gt;<br />
   &lt;include schemaLocation="foo.xsd"/&gt;<br />
    &lt;include schemaLocation="bar.xsd"/&gt;<br />
     ...<br />
&lt;/schema&gt;</p>

<p>&lt;schema targetNamespace="baz"  ...&gt;<br />
    &lt;import namespace="foobar" schemaLocation="intermediate.xsd"/&gt;<br />
     ...<br />
&lt;/schema&gt;</p>

</blockquote>

<p>Also, it is common to use &lt;import /&gt; when the target schema has a targetNamespace, and use &lt;include /&gt; when the target schema does not have a targetNamespace.</p>

<p><br />
</p>]]>
      
   </content>
</entry>

<entry>
   <title>Rule Author and Firefox 3</title>
   <link rel="alternate" type="text/html" href="http://blogs.oracle.com/rules/2008/11/rule_author_and_firefox_3.html" />
   <id>tag:blogs.oracle.com,2008:/rules//557.8555</id>
   
   <published>2008-11-12T18:35:10Z</published>
   <updated>2008-12-10T02:24:21Z</updated>
   
   <summary>Rule Author does not work with Firefox 3. Rule Author uses the Oracle UIX framework, which provides AJAX-style functionality. UIX was developed before Firefox 3 was released, and unfortunately there are incompatibilities. One issue is when running Firefox and the...</summary>
   <author>
      <name>Phil Varner</name>
      
   </author>
   
   <category term="1013" label="10.1.3" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="browsers" label="browsers" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="chrome" label="chrome" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="compatibility" label="compatibility" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="firefox" label="firefox" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="firefox3" label="firefox 3" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="internetexplorer" label="internet explorer" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="ruleauthor" label="rule author" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="safari" label="safari" scheme="http://www.sixapart.com/ns/types#tag" />
   
   <content type="html" xml:lang="en" xml:base="http://blogs.oracle.com/rules/">
      <![CDATA[<p>Rule Author does not work with Firefox 3. Rule Author uses the Oracle UIX framework, which provides AJAX-style functionality. UIX was developed before Firefox 3 was released, and unfortunately there are incompatibilities.</p>

<p>One issue is when running Firefox and the application server on the same machine, when opening a dictionary within Rule Author using the "Browse" feature, only the name of the file and not the full path is filled into the text box.  This will result in an error message like:<br />
<blockquote>Cannot perform operation. 'RUL-01213: Error initializing the repository. Please refer to the base exception. Root Cause: 'ruleRepository' does not exist. '</blockquote></p>

<p>Also, there are several issues with the partial page rendering and the popup windows do not work, preventing the user from editing rules.</p>

<p>Firefox 2 and Internet Explorer 6 and 7 all work properly.</p>

<p>Google Chrome, though not officially supported, works properly and has the nice feature of being able to resize text entry windows for expressions. However, as of November 2008, Chrome does not have an autofill/autocomplete feature for text entry, so the user must manually enter the location of the dictionary, Java classes and jars, and XML schemas each time.</p>

<p>Apple Safari also works, but pop-up blocking must be disabled (unlike Firefox and IE, the pop-ups are silently blocked rather than prompting the user to allow them).</p>]]>
      
   </content>
</entry>

<entry>
   <title>Tips and workarounds for Rule Author version 10.1.3.x</title>
   <link rel="alternate" type="text/html" href="http://blogs.oracle.com/rules/2008/11/tips_and_workarounds_for_rules.html" />
   <id>tag:blogs.oracle.com,2008:/rules//557.8482</id>
   
   <published>2008-11-06T21:56:57Z</published>
   <updated>2008-12-10T02:24:54Z</updated>
   
   <summary>Phil Varner &amp; Chris Cowell-Shah Oracle Business Rules was first released as part of the Oracle Fusion Middleware 10.1.3.x stack. Since it was released, we’ve gained valuable knowledge about its use, and in particular about the use of the Rule...</summary>
   <author>
      <name>christopher.cowell-shah</name>
      
   </author>
   
   <category term="1013" label="10.1.3" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="11" label="11" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="ruleauthor" label="rule author" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="rulesdesigner" label="rules designer" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="tip" label="tip" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="workaround" label="workaround" scheme="http://www.sixapart.com/ns/types#tag" />
   
   <content type="html" xml:lang="en" xml:base="http://blogs.oracle.com/rules/">
      <![CDATA[<p><em>Phil Varner & Chris Cowell-Shah</em></p>

<p>Oracle Business Rules was first released as part of the Oracle Fusion Middleware 10.1.3.x stack. Since it was released, we’ve gained valuable knowledge about its use, and in particular about the use of the Rule Author rule development tool, in various customer environments. Understanding how other customers have successfully used Rule Author in OBR version 10.1.3.x can help make your own rules development experience more efficient and can make harnessing the power of rules that much easier.</p>

<p>Note that in many cases the tips provided below are obviated by changes made in OBR version 11 and in Rules Designer, the authoring tool that that replaces Rule Author in version 11.</p>

<p><br />
<strong>Updating the datamodel to reflect changes to XML schema</strong></p>

<p>Issue: XML fact types are based on XML schemas, and Java fact types are based on Java classes. When XML schemas are changed, you should re-import them to the datamodel in order to update the XML fact types. This updating happens automatically when Java classes change, but when XML schemas change, you need to take extra steps to update XML fact types.</p>

<p>Action in 10: When an XML schema changes, remove the schema from the schemas list and then re-add it to force the JAXB classes to regenerate and the import tree to be updated. Then select and import the changed elements.</p>

<p>Action in 11: Rules Designer contains a button that re-imports all XML schemas on command, updating all XML fact types automatically.</p>

<p><br />
<strong>Removing a fact type property, method, or field</strong></p>

<p>Issue: Removing fact type properties, methods, or fields can be tricky in Rule Author. Removing one of these items invalidates any rules that use it, which blocks dictionary updates. Unfortunately, Rule Author allows you to edit only one rule between dictionary updates. This means that whenever multiple rules are affected by the removal of a fact type element, you will find yourself in a catch-22: you must modify all rules before the dictionary can be updated successfully, but only one rule can be edited between updates. </p>

<p>Action in 10: To remove a property, method, or field from a fact type, first remove all references to it in all rules, then remove the fact type element. If there are references in any rules to a missing fact type element, a validation warning appears when that rule is next saved. Unfortunately this warning doesn’t describe where the reference to the missing item is, so you must manually search the rules for it. If the item occurs in more than one rule, another validation error appears when you update the dictionary. In that case, you must re-add the item to the data model, remove references to the item from all rules, and then try again to remove the item from the data model.</p>

<p>Action in 11: When you remove an element from a version 11 fact type, rules that use it return validation warnings, but you can still save the dictionary.</p>

<p><br />
<strong>Renaming a fact type property, method, or field</strong></p>

<p>Issue: Changing the name of a fact type property, method, or field takes several steps.</p>

<p>Action in 10: To rename a fact type property, method, or field, you need to both remove the original fact type element and create a new one with a different name. Here’s how to do this. First, add the new item. Next, change all references in rules from the old item to the new item. Finally, remove the old item according to the directions in “Removing a fact type property, method, or field” above.</p>

<p>Action in 11: Follow the same general procedure of adding a new item and deleting the old item. However, if you give the new item the same alias as the old item, Rules Designer will automatically replace any references in rules to the old item with references to the new item. You can then change the alias of the new item, and rules will maintain their references to the new item.</p>

<p><br />
<strong>Changing the signature of an RL function</strong></p>

<p>Issue: Changing the signature of an RL function does not update the expression table for each usage of the function. This can cause invalid RL to be generated.</p>

<p>Action in 10: When the signature of an RL function is changed (i.e., parameters are added or removed), perform the following steps for each use of the RL function:<ol><li>Open the usage in the action editor.<br />
<li>Copy and paste all parameter values to a text document.<br />
<li>Select a function other than the one that is changing. This clears the expression table.<br />
<li>Select the original function. The expression table contains the correct parameters, but the parameter values are blank<br />
<li>Copy and paste the parameter values from the text document into the expression table.</ol>Action in 11: Changing the signature of a function creates validation warnings for any references to the function. This makes it easy to see where to change the function call parameters.</p>

<p><br />
<strong>Adding an Action other than to the end of the action list</strong></p>

<p>Issue: Adding an action anywhere other than the end of the action list.</p>

<p>Action in 10: This is not possible.</p>

<p>Action in 11: You can create actions in, or move actions to, any position within the action list.</p>

<p><br />
<strong>Complex rule actions</strong></p>

<p>Issue: The limited number of rule action types and limited action management capability make it difficult to write complex rule actions.</p>

<p>Action in 10: Write complex rule actions as RL functions, and call them via a Call rule action.</p>

<p>Action in 11: A greatly expanded number of predefined actions and better action management mean that most rule actions should not need to call RL functions.</p>

<p><br />
<strong>Writing RL functions</strong></p>

<p>Issue: Writing RL functions in Rule Author is difficult</p>

<p>Action in 10:<ol><li>The bodies of RL functions are not validated for correctness at design-time. It is therefore possible to write an RL function body that will generate invalid RL code. When writing RL functions in Rule Author, we recommend that you frequently go to the “RL” tab, select the “DM” ruleset, click “Check RL Syntax,” and correct any errors shown.<br />
<li>You must refer to all Java classes by their fully qualified names. Classes used only in the body of the function (not in the parameters list) do not need to be imported into the datamodel, but must be on the JVM classpath at runtime.</ol>Action in 11: You can construct functions in version 11 in the same way that you construct rule actions, with validation checks at design time. There are several new types of predefined actions, including modify, assign new, for, and while. Free-form functions are allowed in 11 in order to preserve backwards compatibility with 10, but their use is discouraged. They are more difficult to use because the SDK automatically generates RL-compliant names for most items, and these names are difficult for you to determine even though you need to use the names (rather than aliases) while writing free-form functions. However, the predefined action types cover the vast majority of use cases, so free-form functions are rarely necessary.</p>

<p><br />
<strong>JAXB derived types</strong></p>

<p>Issue: The Oracle XDK JAXB implementation has a bug that prevents the proper functioning of “unbounded” elements in derived types. For example, the following XML schema snippet demonstrates the creation of a derived complexType:</p>

<p>&nbsp;&nbsp;&nbsp;&nbsp;&lt;xs:complexType name="base-type"&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;xs:sequence&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;xs:element name="foo" type="xs:string" minOccurs="0" maxOccurs="unbounded"/&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/xs:sequence&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&lt;/xs:complexType&gt;<br />
    <br />
&nbsp;&nbsp;&nbsp;&nbsp;&lt;xs:complexType name="derived-type"&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;xs:complexContent&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;xs:extension base="tns:base-type"&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;xs:sequence&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;xs:element name="bar" type="xs:string" minOccurs="1" maxOccurs="1"/&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/xs:sequence&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/xs:extension&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/xs:complexContent&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&lt;/xs:complexType&gt;</p>

<p>If this schema is used to generate JAXB classes and unmarshall XML documents, the resulting JAXB object graph will not contain any “foo” elements. This is a bug in the Oracle XDK.</p>

<p>Action in 10: Do not use complexType inheritance in schemas which will be used as the basis for XML Fact Types.</p>

<p>Action in 11: The Sun JAXB 2.0 reference implementation, which is used by default, does not have this issue.</p>

<p><br />
<strong>Writing RL functions that can be called from a BPEL Decision Service</strong></p>

<p>Issue: RL functions that can be called from a BPEL Decision Service must conform to a specific signature. If they don’t, the functions won’t appear when creating the decision service.</p>

<p>Action in 10: The RL function must return an XML fact type that represents an element (not a complexType) and must only have parameters of element type. XML fact types representing complexTypes typically have the suffix “Type” while element XML fact types typically do not this prefix.</p>

<p>Action in 11: Version 11 introduces the more robust concept of a “decision function,” which is the only thing a decision service can call.</p>

<p><br />
<strong>Defining a Pattern</strong></p>

<p>Issue: When creating a pattern, Rule Author presents three options: blank, “there is a case where.” and “there is no case where.” It is not always clear which option to use. If you choose “there is a case where,” the pattern variable does not appear as a valid option in the action part of the rule.</p>

<p>Action in 10: The blank option is the default and is a valid choice. It means “for each case” and will execute the rule’s actions for each instance of a fact matching the pattern. The other two options involve existential quantifiers. A rule defined with “there is a case where” will fire if there is at least one match, but the rule’s action does not get a reference to any specific fact instance that matched. Since the rule has no reference to a specific instance, the pattern variable doesn’t appear in the action option lists.</p>

<p>A rule defined with “there is no case where” will only fire if no fact matches the rule’s pattern. In this case, the rule’s action would not be able to reference a fact instance.<br />
</p>]]>
      
   </content>
</entry>

</feed>
