OBUG APEX SIG

Today iAdvise has given a presentation during the OBUG APEX SIG at Oracle Belgium. The title of the presentation was “APEX Plug Ins: How to use them, How to build them.“.

The goal of the session was to give a general introduction on

  1. What are plug-ins ?
  2. How can you use them as an APEX Developer.
  3. How can you write them as an PLUG In Developer.

Especially part 3 of the presentation was a real challenge. We did a live demonstration of how you can gradually build up a new plug in from scratch. In 5 steps Stijn Van Raes demonstrated how to construct a “Clearable Text Item” plug-in. It is not the most complex plug-in, but it allowed us to describe every single step, pointing out the existing Plug-In API’s that you may use when writing your code. At every step, the necessary PL/SQL code was explained,  the resulting options for the APEX Developer demo’ed and  the effect at run time for the end user. Where relevant the resulting HTML code was inspected by using Firebug.

Because there is not yet that much documentation on those Plug-In API’s and their usage —  unless in the internal PL/SQL Packages of the APEX engine itself or in existing plug-ins–, we decided to make a kind of APEX4.0 Plugin Cheatsheet which lists the most important API procedures and functions and the different record types they use.

For the people who were interested, it was also possible in the afternoon to attend a hands-on session and try out everything we explained in the morning. We have elaborated two tutorials that repeated every single step with some extra explanation and the necessary code snippet. Everybody who attended the hands-on finished both tutorials without any problem.

UKOUG: Forms Migration

There were a lot of sessions on forms, most of them handled about migration.
So, here’s a little wrap up of the forms migration sessions I followed on the UKOUG conference.

When thinking about migration, you need to think again before making a decision.
Do it for the right reasons, make a good analysis and plan everything upfront.
The right reason is not because there’s a migration tool that migrates everything.
Such tool does not exist.
This is what most experienced people will tell you, unless they sell a migration tool.
Allthough, this is even told by Steven Davelaar(Oracle The Netherlands), who gave two sessions:
– Guidelines for moving from Forms to ADF and SOA
– JHeadstart Forms2ADF generator: Moving form Oracle Forms to a best practice ADF application
Two very interesting sessions on migration.

The first session was about making the decision, the strategy and the pitfalls.
Before you even want to migrate, ask yourself the proper questions and make an analysis:

  • current situation: forms version, designer, how is it used(standard or “creative forms”),…
  • current functionality: integration with standard functionalities
  • current DB model & future plans
  • current UI: need for a redesign?
  • current documentation: if there is none, what are you going to migrate?
  • current end users:  how are they using the application, are they happy?
  • current IT staff: are they eager to learn? (everything will be new)
  • what direction to you want to move to: richer ui, customization & personalization,…

And start with the beginning: pull out the logic from forms!
Well do this anyway, this will leave all options open, no matter what presentation layer.

Migration has a lot of pitfalls, so watch out!
When migrating, a re-design and re-implementation is probably needed.
Steven ended that session with the following sentence:

Make lasagna (layered approach) and/or ravioli (service oriented approach) instead of spaghetti (like most forms application with code and business logic in forms and on the database)

The second session was about the tool JHeadstart and how it can help you in a best practice migration.
He reminded us on the monday session: define a strategy before you start!
He explained what JHeadstart was (not a migration tool!): an ADF generator and a best practice toolkit.
It generates metadata(XML), not code.
A part of JHeadstart is the Forms2ADF generator, it generates metadata from your forms application.
The demo he gave was pretty impressive, he took an old forms application (that he made in 2002) and generated a new ADF application.
But watch out, it doesn’t migrate everything: not one line PL/SQL is converted, it’s only documented though in JHeadstart.
You have to choose by yourself where to implement that code(business logic on the database, forms logic in the different ADF layers).
What are the JHeadstart benefits: autocreated ADF business components, metadata, best practice architecture.
Steven mentioned also OraFormsFaces, this an integration module to let your forms run in a JSF web application.
Definitly check this tool when you’re thinking about moving/integrating forms to/into ADF.

Another session on migration: “Is Apex the new forms?”
Not a great session, but they started also with the same idea as Steven: analyse before migrating and put all Business logic on the database.
The session was given by an employee of PITTS, so of course the migration tool of the company was shown.
This tool takes a form as input and creates an Apex import script.

It was not as detailed as the demo that Steven did about JHeadstart, but maybe it can be used as best practice.
The tool didn’t convince me…it even didn’t convince the speaker, as his conclusion was simple: “Is Apex the new forms?  No!  Or at least not yet.”
At least he was honest: the tool is no silver bullet and there are limitations.

Conclusion: when doing a migration, think…and think again.
Do you have good reason to migrate?
Then analyse.
Don’t try to find the silver bullet…

New Patch available for ApEx 4.0

ApEx 4.0.1 is available for download, if you are running ApEx 4.0 then I suggest you upgrade as soon as possible.

- If you are already running ApEx 4.0 then download the patch from Oracle support, look for patch nr 9976149.
– If you are still running and older version then 4.0 then download ApEx from apex.oracle.com.

The new version nr of APEX is 4.0.1.00.03.

ApEx 4.0: ORA-001821 randomly showing up

This week, I had a problem with ApEx 4.0 where ORA-001821 was randomly showing up, not only in the applications but also in the ApEx Builder.

ORA-1821

The problem was that we queried a table across a database link but to a database version prior to 10gR1. Please note that other applications will also suffer from this one application where you used this database link.

Oracle describes the problem as:

In Application Express 4.0, the internal applications were modified to have an application date format of ‘DS’. The ‘DS’ date format was first introduced in database version 10gR1.

With the application date format of ‘DS’, each page view has the database session parameter NLS_DATE_FORMAT set to ‘DS’ by the APEX engine. Then, when a query is performed against the remote database (9iR2 or earlier), the remote database is unable to handle the request and says that ‘DS’ is an invalid value for NLS_DATE_FORMAT.

You can already download a patch that solves the problem, in Oracle support search for “note 1155453.1 – ORA-1821 When Querying a Table Across A Database Link After 4.0 Upgrade

ApEx 4.0: Map not showing data points correctly

In ApEx 4.0, when working with a map region (World without Greenland) (Map world/world_wo_gr.amap) you might experience that not all data points are correct.
For example: when you work with the map “World without Greenland” and you choose a query with Series Type of Bubble, Switzerland is positioned in America while Spain is in the ocean.

ApEx 4.0 data points not showing correctly

Oracle recognizes the bug (9950531) and will supply a fix in upcoming patch 4.0.1.
Meanwhile as a workaround the next action is suggested: setting “Series Type” to “Map”, and the countries will be correctly labeled

Oracle Forms 11g and Apex using external events

I remembered an old post of Roel Hartman where he integrated a form into apex.
He used a part of OraFormsFaces by Wilfred van der Deijl: the CommunicatorBean.
Using this CommunicatorBean forms could react on “external messages”.
Now with Forms 11g reacting on external events, this CommunicatorBean isn’t necessary any more(sorry Wilfred).

This is how I did it using external events…
First things first: set up the advanced queueing mechanism.
Check this tutorial which includes setting up advanced queueing.
I created a little form based on emp(nothing fancy)…

The new feature in forms:

With the following properties:

What should forms execute when this event happens?
This has to be specified in the When-event-raised trigger.

In this case we retrieve the payload and extract the empno from it.
The empno is used to set the default where clause on the block.
When there’s an empno on the queue, forms will query that employee.
That’s all for the forms part…
Now I created a little Apex page with two regions:

The Employee details will be our form.
So I put our form in the HTML using an iframe:

Using a “select list” it’s possible to select an employee.

This is the result:

Now the purpose of the select list is to choose an employee and show the detail information in our form.
In order to do this, the select list calls a javascript function.

This javascript function is created in the HTML header

The code behind this:

<script language=”JavaScript” type=”text/javascript”>
function getEmployee (){
var emp = $x(‘P2_EMPNO’);
// send request
var ajaxRequest = new
htmldb_Get(null,&APP_ID.,’APPLICATION_PROCESS=get_emp’,0);
ajaxRequest.add(‘P2_EMPNO’,emp.value);

// get response
ajaxResult = ajaxRequest.get();
ajaxRequest = null;
}
</script>

This javascript function calls an application process and uses the empno as parameter.
The application process put the empno on the queue.

When changing the select list, the form is queried

This is a solution to integrate forms into another application whether it’s Apex, ADF or another web applicaton.
When it can put something on the queue, forms can react on it.
And yes, I could do it using the javascript feature in Forms 11g. I know…
And for Apex it’s probably a better solution, as we can skip the AQ part and make calls to and from forms in Javascript.

Oracle Open World 2010: Forms in the Middle of Middleware

People attending Open World to have a closer look at fusion technologies and how to integrate them in your existing applications, need to check out the following session:

  • ID#: S315945
  • Title: Oracle Forms in the Middle of Middleware with Oracle Product Management
  • Track: Application Servers, Application Grid, and Development
  • Date: 22-SEP-10 Time: 13:00 – 14:00
  • Venue: Marriott Marquis Room: Salon 9

Together with Grant Ronald we will talk you through the possible scenario’s to modernize your existing forms applications. After each scenario we will demo the functionalities and showcase some of the success stories we’ve conducted together with our benelux customers.

The different scenario’s include upgrading to 11g to use the event-driven architecture, integrate with existing applications such as apex, .net, google maps, bpel, …

In other words if you’re using fusion technologies such as BPEL, OSB, ADF, … you can easily integrate these with your existing forms applications using the new features provided in 11g.