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.

APEX 4.0: Export feedback, take it to the next level

Team development is one of the new features of APEX 4.0, one option to use with this feature is Feedback. In short, Feedback allows users to easily report “bugs” for an application. (Like we APEX developers can program bugs… NOT!).

There are already 2 blog posts that cover the way you can add a feedback page to your application and how to access your feedback as developer.

This blog post will describe how you would export your feedback from a production system to the development system where you as developer try to make/solve things. After changes are made you want to inform your users what has been modified…

1. Setting your environment variables
The first thing you have to check before you want to export/import feedback, is the name of your workspace. If you use the same name for a workspace in both environments then we will have to distinct the development environment from the production environment. If you don’t do this, the export/import feature for feedback will not work. You can distinct the environments by altering the Feedback Synchronization Source Identifier, this will default be the name of your workspace. Changing the identifier can be done by using the Internal workspace -> Manage Workspace -> Workspace Details -> Edit Workspace Information.

Continue reading

ApEx 4.0: Date Picker Item Minimumdate and Maximumdate

One of the big improvements of ApEx 4.0 in my opinion is the rebirth of the date picker Item. The old version of the date picker was a popup that opened a calender, it was ok but a lot of developers already used something more sexy like the jQuery Ui Datepicker. This required some custom development and was’t out of the box functionality.

In ApEx 4.0 the date picker got a new look and feel based on the jQuery Datepicker. It opens a lot faster and is overall more simple to use. You don’t have to create a validation anymore to check if the user has specified a valid date, this is done automatically.

Some new properties are available for the date picker:

Continue reading

ApEx 4.0: Websheet Objects

When creating a new workspace you might have noticed that there will be some extra tables on your schema.
All these table start with the name APEX$_ and are used for the websheets feature of the new version of ApEx.

If you don’t use websheets (at start) and you don’t want these extra tables present on your schema then you can prevent the creation of these tables by following the next steps:
– Login into the internal workspace
– Go to Manage Instance -> Feature Configuration
– Set “Create Websheet objects in new workspaces” to No

Please keep in mind that the above action will still allow developers to make websheets. If these objects do not exist then the developer will see a warning message when he/she tries to create a websheet. You then will able to create these objects again:

If you have the Websheet Objects on your schema and you wish to remove them then go to “
Home -> Administration > Manage Service -> Websheet Database Objects” and there you can safely remove these objects.