Another day with JRules 7 Information Center – “Getting started” about Rule Studio…again?

I must admit that it came as a nice surprise when I realized I had already done the Getting started chapter in the WebSphere ILOG JRules V7.0.2 Information Center. It appeared so familiar, but I couldn’t figure out why until…the end of the tutorial 🙂 It’s not that bad whatsoever since the more tutorials I come through the better, doesn’t it?

The difference between these two sessions is that I took notes from the first session in Polish (cf. “Getting started” o Rule Studio z InfoCenter) whereas this time it’s going to be in English. So here are my notes.

Business rules express a business policy. Business rules are written using the Business Action Language (BAL). They’re written by policy managers and lay out a foundation for Business Object Model (BOM).

Technical rules are written in Rule Studio using the ILOG Rule Language (IRL).

The vocabulary is a layer of natural language on top of the Business Object Model (BOM).

You can start the tutorial by importing a complete project. Just import it with the Rule Studio Samples and Tutorials assistant…

…and select the one you’re interested in which in this particular case is vocabulary_answer.

As it can serve as an excellent reference I decided not to do it and follow the steps in the tutorial to develop the sample application myself.

It boiled down to importing a Java project carrental-xom to be used as the Execution Object Model (XOM), creating a standard rule project with the New Rule Project assistant…

…that references the XOM…

…creating a Business Object Model (BOM) entry in the rule project…

…and verbalize it by default. Verbalizing is the process of associating terms and phrases to elements of the BOM.

The approach is called a bottom-up approach to creating a vocabulary in Rule Studio – you use existing application objects (e.g. a Java project that models application concepts) as the basis for your vocabulary.

A class can have its own verbalization…

…and so can its members.

You can change the verbalization of a class or its members in the BOM editor in the Class or Member tab.

When a class or a member doesn’t have its verbalization, you can create it by clicking Create a default verbalization.

You create a rule package and use the Intellirule Editor to create a business rule to test your vocabulary. It is recommended that you store your rule artifacts in rule packages, not directly in the rules  folder. After you create a new business rule, the Intellirule Editor opens.

In the Intellirule Editor, type the contents of the rule in the Code section using the Content Assist mechanism.

You can extend the BOM to add the method that corresponds to your needs in the vocabulary, then map it to the XOM. To do it, you need to associate IRL mapping code to the method.

If terms or phrases in the default verbalization are ambiguous, you can edit them to clarify their meaning. You edit a class verbalization of the BOM editor using the Edit Term dialog. You edit member verbalization, that is, the navigation and action phrases, in the Template field, using text and Content Assist. If you want to edit the subject used in phrases, you use the Edit Term dialog. Methods with arguments such as Session.displayMessage are verbalized by default without many modifications. You need to modify the verbalization of these methods to clarify their meaning.

A way to make the vocabulary more specific is to allow policy managers to select values in a domain. You can create an enumerated domain of literals in the BOM to allow policy managers to choose the car rental branch from a drop-down list.

In “Task 6: Creating a domain” it turned out that the state vocabulary was not available and I had to verbalize the state field of the Branch class myself. Also, there’s a typo in the rule where “display the message:” contains the colon whereas it should not since the Session.displayMessage(String) method was verbalized with the template: “display the message {0} in {this}”. No colon there.

After an hour I concluded the tutorial.

Congratulations! You have completed this tutorial and learned how to set up a vocabulary for rule editing.

One response to “Another day with JRules 7 Information Center – “Getting started” about Rule Studio…again?

  1. Thanks for sharing your experiences! The ILOG BRMS team is watching/reading with interest… 🙂

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s