Category: Word Ribbon

Fun with Aliases and Strings #2

Fun with Aliases and Strings #2

Returning to the ” Aliases and Strings”  theme of the previous post, where we looked into an example of String concatenation. Just a reminder, in the previous article you created the entity model and set up a couple of relationships, before using a rule to decide if the ticker tape instance is a member of a relationship called  the next ticker tapes.

So here is the continuation of the document you saw in the previous steps:

Aliases and Strings #2

The first part should look reasonably familiar, since it builds on the example with the next ticker tapes. But is uses the second relationship, called the closest ticker tape. Note the wording closest ticker tape not ticker tapes. We are aiming for the closest one, or if you prefer, the next one in line. So for ticker tape number 3, the closest would be number 4.

Dodgey Ticker

We again use an alias, but things get a bit sticky in the following parts. Where did the further ticker tape come from? Well, perhaps unsurprisingly, it’s another alias. You see, we already used the other ticker tape in the conclusion so we need to use another word : in this case further was my personal choice, but it could have been another word that meant something in this context. So by now we have the following, expressed in conversational style :

Compare ticker tape A (with other tapes, let’s say B, C and D). B,C or D will be called the closest ticker tape if the following is true.

  1. B,C or D have an ID that is higher than the ID for A
  2. Using the next ticker tapes as your starting point (so, B C and D)
  3. Compare them (so B compared to C, B compared to D etc) to this rule
  4. Is B’s ID is less than or equal to C (for example)?

So we end up with the ticker tape that is in the next ticker tapes AND has an ID that is less than or equal to the other next ticker tapes. So it is the closest one.

I’m reminded of this excellent conversation from Monty Python since it can get a bit confusing at first:

video

The final rule concerns whichever ticker tape has the longest string. And that string is what you are about to create, for each and every instance of your entity.

We’re coming with you!

You will generate a string of text for each of the entity instances (so, for each of the ticker tape instances). And this string will be the driver of a logical loop.

Firstly, let’s set your scene and remind of the context:

  1. “Text 1”
  2. “Text 2”
  3. “Text 3”

Each ticker tape has a text message, for example “Text 1” . This message should be concatenated with the other text messages to form a long “final” string. Each should have a comma inserted between them, into the final string, and of course a “.” at the end. Just to make a nice tidy “final” string. It might look like “Text 1, Text 2, Text 3.”.

Aliases and Strings #2

So each instance has a text string, and a “final text”. The “final text” will be the ticker tape text string concatenated with the closest ticker tape’s text string, plus a comma if required – for example if there are no “next ticker tapes” for a given tape, it’s because we have reached the end of the instances (number 4 , if there is no number 5).

The following attributes give us the numbers used in the table above:

Aliases and Strings #2

And the final (final) global attribute:

Final String Result

Aliases and Strings #2

In the next part of this series, there will be a chance to look back on the techniques, observe the warning message and generally investigate your logical loop.

Aliases and Strings part three will be with you in a few days, In the meantime of course you can read the online help here.

OPA Word Rules – Level Up!

OPA Word Rules  – Level Up!

As the summer lethargy begins to bite (at least if you are in the Northern Hemisphere) I find my colleagues are missing from their desk – vacations long planned are finally here! It is with this in mind that today I am sharing a lighthearted post about Word rule levels. But there is a nice payoff in the end of the post, which some of you will might already know but it might be useful for some, occasionally.

Let’s look at the following document snippet and ask ourselves a question (this screenshot comes from the RetailDiscounts example project).

OPA Word Rules - Level Up!

The picture above shows a fairly typical nested level structure, which improves clarity and helps both the rule author and the rule validator / subject matter expert because it makes the goal and conditions clear. And we can see in this case, there are 2 levels used (level one is yellow, level two is salmon pink).

How low can you go?

The question is, how many levels can you have? Note, that this question is not “how many levels should you have?” which is altogether more nuanced and more in the domain of best practices – and if you are in doubt about that, I strongly suggest you read Jasmine’s famous PDF here.

So, how many can you have? Well, let’s look a the Word Ribbon  – there is a drop-down to help us:

OPA Word Rules - Level Up!

So that’s the answer, right? Five levels, each with their own color.  Or is it?

It’s not Summer, it’s Easter! OPA Word Rules – Level Up!

Some might qualify this as an Easter Egg in computer geek-vocabulary. It’s an unexpected feature – but there are actually SIX levels. Not five.

Take a look at the following screenshot, notice the styles have been displayed for clarity.

OPA Word Rules - Level Up!

In the (albeit very infrequent) case of needing a sixth level, you can access it by pressing the Increase Indent button on the toolbar, while the cursor is on the fifth level (or you can press F12 on your keyboard).

Have a nice day!

Back to Basics 5 – Using the Go To Button in Oracle Policy Modeler

Back to Basics 5 – Using the Go To Button in Oracle Policy Modeler

Alright so this one is a bit strange, but I wanted to point out a piece of screen Real-Estate that in my humble opinion does not get used enough. The Go To Button in Oracle Policy Modeler in the Microsoft Word Ribbon that you see when you are editing Word Documents using Oracle Policy Modeler. Let me demonstrate by showing you a screenshot, as this will hopefully make things clear.

the Go To Button in Oracle Policy Modeler

To be honest, the name on the button bugs me. It is not really a “Go To” button at all. For me, luddite that I am, “Go To” means go somewhere in my document. And while the Go To button in Oracle Policy Modeler does indicate location, it does not go anywhere. In fact you have to put your mouse on the relevant item to get it to work. It is more a “what’s here?” button if you ask me. And yes, it tells me of the different properties of the item I have put the cursor on. Like this:

the Go To Button in Oracle Policy Modeler -- Results Window

As you can see in the screenshot above, the mouse was clicked on the conclusion. Then the Go To button was clicked. The dialog that was displayed reveals the text and any locations it appears in the Project (for example if you have your logic in two separate Word files, they will both appear here). In addition there are shortcut buttons to edit the Attribute or jump into the Oracle Policy Modeler Debugger. But the best part, if you ask me, is the ability to pin the window and open one, or many, more at the same time. Sometimes when debugging a document written by someone else it can be useful to have these all displayed as reference points – or just because you are trying to keep track of several things at once. If you pin a window, you can go right ahead and “Go To” again on another Attribute or whatever takes your fancy.

the Go To Button in Oracle Policy Modeler Pinned Wiindows

This picture is too big to display immediately so you can click it to go to full size. These simple things can be the source of saved time and heartache – for finding misspellings and so on – and I’m happy to be talking about them here on the ODE OPA Blog. Oh, and I did a little dance just now as we passed the 100 post landmark. Woohoo!

Worldwide
Logo by Southpaw Projects LLC