Weblog

Oracle Business Rules: Proof of the pudding…

Recently I have been evaluating Oracle Business Rules (10.1.3.1) for one of our customers.
I started with the sample application, the Car Rental Sample and the Wine Demo, which you can find here
Working samples with simple data models and corresponding rule definitions.

The next step was to use a ‘real’ xml fact and corresponding schema. I loaded the XML schema using the Rules Author, imported the xml fact definitions and defined a ruleset containing a single and simple rule (calling println for an element value).

For the Rules client I generated the required java classes using the JAXB binding compiler and asserted my first xml fact.
I got an error from the Jess Rules engine, complaining about fact names containing dollar symbols. Fact names are equal to the class names that the JAXB compiler generates. And the compiler generates (for non-simple schemas) Java classes containing inner class definitions.


Caused by: Jess reported an error in routine Variable.Variable.
Message: Variable name cannot contain '?' or '$'


I hoped that removing the dollar symbols from the alias names would overcome this error, since removing dollar symbols from the real names is not an option. These names are automatically generated.
Unfortunately – but not surprisingly – the same error was thrown. The only thing that surprised me a bit was that the Rule Author does allow fact names containing dollar symbols.

I decided to use Apache XML beans instead of JAXB and as a consequence Java fact definitions instead of XML fact definitions. The reason is that Apache XML beans does not generate classes containing inner classes.
When running the inference engine after asserting a XML fact an error was thrown stating that the JAXB properties file was missing. So, I decided after skipping XML fact definitions also to skip asserting XML facts and to assert Java facts.

But when I asserted a Java (XMLBean) fact and run the inference engine I encounted the following error:


oracle.rules.rl.exceptions.JavaException: exception in invoked Java method
Caused by:
org.apache.xmlbeans.impl.values.XmlValueNotSupportedException: Could not get a Java Date type from a Schema complex type

It appears that XMLBeans are not applicable for the Rules engine (yet) and I decided to freeze the evaluation.

Other experiences: I started to create a WebDAV based repository using the Oracle database server Release 2. Unfortunately, the WebDAV interface appeared to be unstable, corrupting the repository. After recreating the repository several times I decided to use a file based repository.
I presume that this instability has nothing to do with Oracle Business Rules but with the XMLDB server.

Also error reporting of Oracle Business Rules is very limited. I frequently hit the following strange error message: 5}' is undefined.
My final conclusion is that the product is not really useable for non-flat xml schemas at the moment. But the potential is enormous and I can not wait to evaluate the next release!

Enabling forms user sessions in the EM website

If you enter the midtier EM website and browse to Forms -> User sessions you have the ability to monitor and trace all forms processes. By default this ability is turned off and has to be enabled by setting em_mode=1 and allow_debug to true in the formsweb.cfg and a restart. This doesn’t always work, a workaround is to go to Forms -> Configuration and click edit. Change the em_mode and allow debug here.

If you change the parameter oracle.forms.configFileName in oc4j.properties located in $ORACLE_HOME/j2ee/OC4J_BI_Forms/config to point to a different location for your formsweb.cfg the em_mode and allow_debug parameters should still be changed in the original formsweb.cfg in $ORACLE_HOME/forms/server. Oracle for some reason keeps looking for this old file.

Ten SOA success stories

Joe McKendrick has an interesting list of 10 companies where SOA has been successfully used in the past year: Ten companies where SOA made a difference in 2006. With a new ‘technology’ like this it’s always good to look at what works and what not, and what companies have done to make it a success.

Javapolis: Flex

A lot is happening regarding user interface technology. Spurred by the recent AJAX and RIA developments, many new UI frameworks are introduced. AJAX enabled JSF components can be used, or you can use JSP in combination with other frameworks like DOJO or DWR. Google WebToolkit (completely open source since this week) takes a different approach, by allowing you to code your interface completely in java, and generating all the required user interface code (html, javascript, etc). Adobe Flex is yet another option. As it’s hard to tell at this moment what will be the best user interface technology choice for the future, it’s important to keep an eye on all. Time to find out what Flex is all about.

You create Flex UIs using MXML files. A MXML file is a XML document, similar to a JSF page, which describes your user interface. Flex provides a lot of different components you can use, like buttons, datagrids, layout panels, etc. So in this sense it’s similar to JSF. Using Actionscript (Ecmascript) you can add behavior to your application. The MXML files are compiled into flash, and run in your webbrowser using a flash player. Adobe is working on a project called Apollo which will enable you to install Flex application on your computer, so you can run them without a browser.

The big benefit of Flex is that you can create very dynamic graphical interfaces. It’s all vector based, so you can draw whatever you need. One example demoed by Adobe was a car insurance claim application, where the user can graphically input the situation of a car crash. This is a good example, as it shows that users will benefit from a more graphical user interface.

Because of the vector graphics Flex will also scale on most display devices you use. We will see a lot more different screen sizes in the future, with different DPI (dots per inch), which makes it important that user interface can adapt to you screen resolution. I think this will be a big benefit for Flex.

Adobe demoed that it’s easy to synchronize user interfaces from different users, changes to data are immediately displayed, so webstore sales people can easily help customers when filling out forms for example. Flex also contains ways to handle data entry conflicts. It’s also pretty straight forward to communicate with a backend written in java (other server side technologies are also supported).

Usually when i think of Flash interfaces i see a couple of problems:

  1. indexing by search engines – search engines can do some indexing of flex applications, but they won’t be able to index all your dynamic data. I think this is a big disadvantage. Right now, if you enter the title of a book in google, you will probably see a link to amazon on the first page of search results. I think this is very important for Amazon. You can’t achieve this with Flex. To solve this Adobe suggests you use a combination of Flex and html or Ajax. Current JSF implementation have the same problems with search engines though. Not a good idea to implement Amazon with JSF.
  2. bookmarking and emailing urls to specific pages. I often send somebody an email to a specific page in a webstore: “have a look at this book”, or “this is a nice house”. This is hard to do with a flash application. A Flex extension exists that will allow you to create url’s that specify a specific state of a flex application. This extension, in combination with html or ajax will allow you to create bookmarkable and mailable web applications.
  3. another common problem with flex interfaces is accessibility. According to Adobe this has been solved however, Flex works with most screenreaders.
  4. ease of use. Many people think of web applications as crippled applications. They think that users want complex user interfaces similar to desktop applications. I think this is a mistake. The simplicity of html interfaces has made it possible for many people to use computers. Desktop applications are quite often too complex. I think it would be a mistake if every web application would function like a desktop applications. Look at what microsoft has done to office. One of the biggest improvements of the new office is it usability. In other words, the previous versions of office were difficult to use. Flex enables you to move this complexity to the web. But, it’s all up to the developer how he uses this technology. You can’t blame the technology, if the developer creates an application that is too difficult to use.

I think the current problem with Flex is that it isn’t a complete solution. Adobe suggests you use it in combination with Html or ajax. Ajax is already a complex solution, adding Flex to this only makes it more complex. I think we need a single user interface technology. Of course it could use Flex or Ajax under the covers. But this complexity should be hidden from the developers. This could be an opportunity for JSF. A developer can use JSF components without being bothered with the technology used by the component.

Some sites that use flex:

Interesting links:

CSS3 Advanced Layout Module

This week the CSS3 working draft of the Advanced Layout Module passed by during a web surfing session. I think every webdeveloper which uses div-elements to define a grid layout, must agree with me that things become more complex and time-consuming when the grid-layout becomes more complex. The main reason for this is that you have to deal with a lot of floating issues and inevitable changes to indenting and text/images sizes influences your grid as well.

In the working draft an alternative way to define a grid layout is proposed: Template-based positioning. I can describe it here in my own words, but I couldn’t do it better than how it is done in the working draft:

The properties in this specification work by associating a layout policy with an element. Rather than making an element lay out its descendants in their normal order as inline text or as blocks of text with margins (the policies available in CSS level 1), these policies cause an element to define an invisible grid, in which descendant element will be placed. One policy also allows elements to be stacked similar to tabbed cards, of which only one is visible at any time.

Since layouts on the Web have to deal with different window and paper sizes, the rows and columns of the grid can be made fixed or flexible in size.

The typical use cases for these properties include:

  • Complex Web pages, with multiple navigation bars in fixed positions, areas for advertisements, etc.
  • Complex forms, where the alignment of labels and form fields may be easier with the properties of this module than with the properties for tables and margins.
  • GUIs, where buttons, toolbars, labels, icons, etc., are aligned in complex ways and have to stay aligned (and not wrap, for example) when the window is resized.
  • Tabbed dialog boxes, with only one “card” visible at any one time.
  • Here’s is a simple example of using template positioning for defining a three-rows grid layout:

    
    body { display: "aa"
    "bc"
    "dd" }
    #header { position: a }
    #navigation { position: b }
    #body { position: c }
    #footer { position: d }
    <div id="header">
    <div id="navigation">
    <div id="body">
    <div id="footer">
    

    In the above example you can see that the grid-layout is defined in the body element using a display attribute that defines the tabular structure of the grid. The position property is used to fill the slots with specific content.

    One of the advantages, in my opinion, of template positioning is that the structure of the grid can immediately be infered from the display property. When float and clear properties are used this becomes more difficult.

    Because the specification is still in its working draft stage (even the examples are still in Dutch ;) ), I think it will take some time when the common browser vendors have implemented it so you can use the concepts in your web design. Nevertheless, the ideas in the proposal sounds great to me.

    Posted December 14th, 2006 by | 3 Comments »

    BPM on SOA and the role of changemanagement

    Bruce Silver wrote a nice post on BPM and SOA.
    I agree on his analysis that these 2 worlds are slowly merging. An Service Oriented Architecture will only be efficient when the business processes on top of it are efficient. It is good to see that the Oracle SOA Suite gets more and more tooling for Business Process Analysis (BPA), simulation and Business Activitity Monitoring (BAM). The tools you need for process improvement or BPM.

    In my opinion change management also plays a central role in both BPM and developing a SOA. The changes IT has on the business is known. But why is IT only managing the changes in the software and not the changes it imposes on the organization? The currently known software development methodologies also don’t have an answer for this question.

    In a recent post I showed the impact of a SOA implementation and the effect of an intervention on adoption of a new system and new business processes.  It shows that the use of techniques from requirement engineering and change management pay off.

    In the BPM world change management is more common ground. Only I also see an emphasis on tooling and techniques. I hope that with the merging of BPM, SOA and change management the gap between business and IT will be closed and we will add more value to the business. In the end this is the only Key Performance Indicator IT will be measured against.
     

    Posted December 13th, 2006 by Ronald Doelen | 1 Comment »

    Javapolis: Axis 2

    Paul Fremantle, developer on the Axis 2 project, gave an overview of Axis 2. It took him a while to get to the interesting bits, the first hour was an overview of SOA en Webservices. He had a nice picture showing train carriages attached to each other. These carriages are, in some sense, also loosely coupled. This is necessary, as it’s impossible for the whole train to start and stop at the same speed at the same time. Big IT systems are in a sense similar, as you need some space for movement. Messaging queues and asynchronous messaging gives you this movement, avoiding rigidly coupled systems, that fall over when a part doesn’t respond as quickly as expected.

    Paul is also the author of WSIF, which enables you to publish services through a WSDL contract, without using web services. Paul doesn’t think WSIF is very important, as Web Services will become the most important way of communicating with services. Web services may not always be the optimal solution, but as it has become a real standard, web services will be the way to invoke services. This is similar to how all networking is now done using TCP/IP. It’s more important to use a standard than to always use the best technical solution.

    Axis 2 has greatly improved performance over Axis 1, mainly because of the improvements in handling XML. Axis 2 uses AXIOM to work with the XML, and you can configure what framework you want to use for xml data binding. JAXB2, XMLBeans, JIBX and ADB are supported.

    Paul demoed how you can do asynchronous web service calls, either by registering a callbackhandler ( a separate thread is started to wait for the response) or by specifying that a separate listener should be started to wait for the response (a http webservice is started). To enable this, in Axis 2 you can specify that you want to engage the WS-Addressing module.

    Using the Rampart 1.1 module Axis 2 supports WS-Security 1.1, WS-Secure conversation, WS-Security policy, and WS-trust (SSO for web services). Internet explorer uses WS-secure conversation and and WS-Trust for something called Windows Cardspace, which is a new version of MS-Passport).

    Axis 2 also supports WS-ReliableMessaging using the Sandesha 2 module. This implements WSRM 1.0, and CD3 of WSRM 1.1. WS-ReliableMessaging is usually used to garantee that message are delivered exactly once, in the correct order. Hibernate can be used to persist messages.

    MTOM is also supported by Axis 2, which means you can create web services that use attachments, and are also interoperable with the .Net world. Axis 2 MTOM implementation has been tested with documents over 1GB in size, which should be big enough for most current applications. Also, in contrast to WS-attachments, MTOM attachments are secured when you use WS-Security.

    Posted December 13th, 2006 by Andrej Koelewijn | 5 Comments »

    Javapolis: Inside the Agility Cube

    In this presentation Kevlin Henney discussed 6 perspectives which are important in Agile development: practices, organization, architecture, tools, skills and attitude. According to Kevlin you need to address all 6 in your agile development process. People implementing an agile process will usually have 1 or 2 perspectives that they care for and focus on, but it is important to consider all perspectives.

    Kevlin had some interesting points in his presentation. I liked a slide he had with pictures from different white boards used in agile development. One was used to display a teams progress during a milestone. The white board had four columns, if i remember correctly, one for unstarted user stories, one for user stories in development, one for user stories being tested, and one for finished user stories. The board also displayed 2 rows, one for feature related items, and one for architectural related items. (This paper by Henrik Kniberg has some more white board examples used during agile development: Scrum and XP from the Trenches.) According to Kevlin it’s useful to have some ceremony: for example, a daily status meeting, and at the end of every milestone a meeting to demo the added functionality.

    Recently i’ve seen the issue of technical debt being discussed in a number of articles. Kevlin also mentioned it a couple of times in his presentation. It means that small shortcuts during development will cause problems at some later point. The more shortcuts you make, the bigger the problems you can expect. Small shortcuts often occur in the form of code copying or quick implementations that aren’t according to the system architecture. The shortcuts will give you a quick win, maybe allowing you to meet a deadline, but these shortcuts will cause problems. Maintenance for example will become more difficult, you may have to modify code in multiple places to fix one problem. Technical debt will also impact the effort it takes to implement new features.

    Regarding Test Driven Development (TDD) Kevlin mentioned that a junit test is not a piece of code to test your method, it is a specification in code.

    Kevlin is a good speaker, he had a lot of generic good advice, and from his examples you can tell he has a lot of experience, but overall i thought the presentation was a bit too long. He could have made his point in less time.

    Posted December 11th, 2006 by Andrej Koelewijn | No Comments »

    Javapolis: Pragmatic SOA

    Javapolis started this morning, and some things have improved. First, and most important, free wireless internet is available, although it was quite slow in the conference room i was in this morning. Another improvement: no more queuing for lunch, the sandwiches are available on a couple of tables, you can take as many sandwiches as you like. And some people are really hungry! I saw a guy walking around with a french bread, some sandwiches, and a ciabatta. He probably booked a hotel without diner.

    Anyway, one topic, the first presentation i went to this morning was called Pragmatic SOA, presented by some people from Oracle. It was a good overview of all the different standards involved in building end to end SOA project, unfortunately the presentation didn’t go very deep. The speakers were basically trying to show that JDeveloper has excellent support for building standards based SOA solutions without turning it too much into a sales pitch.

    The speakers discussed the standards in the following layers of a SOA solution:

    One interesting demonstration was how you can map between java and xml using toplink. This means that you have a single solution for going from xml to java to the database. If you annotate your pojo classes you can’t generate your class files from an xml-schema every build (you’d overwrite your annotations), so you need an external mapping between the xsd and java, which is what toplink enables you to do. And then toplink can persist the same classes into your database. You can also specify that a java webservice should use a toplink serializer class to transform xml payload into java objects.

    Another interesting topic was on Oracle’s BPEL test framework. It’s basically a junit like test framework for BPEL processes. You can take an existing BPEL instance and transform it into a test or you can create new tests. These tests can be run from ant, so you can include them in your nightly builds. In your test you can emulate services, or introduce system and service failures. Very useful, i especially like the fact that you can run the tests in your nightly build, and that you’re not dependent on some developer manually running the test in JDeveloper.

    Posted December 11th, 2006 by Andrej Koelewijn | No Comments »

    Spring introduces class-based configuration with annotations

    On Rod Johnson’s weblog, I read an interesting posting in which he introduces and explains the new class-based java configuration option for Spring. With annotations you are able to configure your beans within java classes. According to Rod, this new configuration option is more targeted to developers rather than infrastructure developers.

    I wonder which method is more efficient in use; XML based or class based configuration. Due to the fact that you can use both options, I think the best way to configure an enterprise application is by using a mix of both options. Class-based configuration by pure developers to wire their beans and leave XML configuration to infrastructure developers to weave infrastructure specific resources into the application.

    Posted December 4th, 2006 by | 1 Comment »

    Technology
    Ben jij slim genoeg voor IT-eye