Friday, September 11, 2015

Nodalpoint's Blog

We have recently started a company blog to share knowledge on a wider area of Experience and Technology

You will find very interesting posts of mine and my colleagues concerning Oracle Middleware and big-data technologies.

Nodalpoint BLOG

Thursday, May 7, 2015

Copying BPM Processes

Working on the design of a large project i am designing BPM Processes in the latest  JDeveloper 12.1.3 with the BPM addon.

I had the need to copy a process in order to make a similar one, and i found an option by right clicking on the process:

Yet on selection it Fails:
???
The work around i found is 'Notepad'!!!
  • copy the source .bpmn file with a new name
  • Open with Notepad and find and change the process name and id attributes with the new name and id:

Then if you Refresh the folder in Jdeveloper the new process is visible and editable.

An other issue that i have is with Sub-processes. If you expand and collapse them the layout is usually distroyed and if you generate process image it always displays expanded:
So i try to avoid expanding and use print screen and crop for the image.

The devil in the details...


Monday, March 16, 2015

ADF code review (crime #1)

Doing code review is like reading a mystery novel. You always wander why… and you rarely find logical answers.

An example of ADF code in managed beans:
            try {
                OperationBinding ob = ADFUtils.findOperation("Rollback");
                ob.execute();
            } catch (NullPointerException npe) {
                //Probably due to being the first time... no worries.
            }

Why would someone want to hide such an exception?

And then you check the ADFUtils. findOperation method:

    public static OperationBinding findOperation(String name) {
        OperationBinding op = getDCBindingContainer().getOperationBinding(name);
        if (op == null) {
            throw new RuntimeException
("Operation '" + name + "' not found");
        }
        return op;
    }


And you see that NullPointerException will never be thrown since it is overridden with a  RuntimeException.

In any case, if there is no operation in the binding it is a development bug. Why would someone want to hide it?

One more unresolved crime…

Monday, February 2, 2015

One Application Module to rule them all?

I was called to help on an ongoing ADF project
There were only one application module.
It is live in production for the past 2 years with around 20000 concurrent users at peak times
It has around 200 view instances.


So I ask:
Me: why only one?
Response: In order to have just 1 connection per user.
Me: Ok, but that could be done by other means
Response: Ok but if not one, how many? Why not only one?

...I had seen various posts in the net, so I took a look again.
I see an old post from Frank that actually suggests one root application module and many nested.

I also see a more resent episode on ADF Architecture TV from Chris.
He states that this is a wrong question and depends on the requirements but actually implies that in most cases it could be done with only one root application module and Task flows transaction management.

So, why not only one root application module (even with many nested)?
It seems to me similar to the question ‘why not only one java class (even with many nested classes)’.
Apart from the obvious:
  • The additional ‘Shared’ module that is suggested for static lists for better performance
  • The Implementation class of the module that will be huge.
  • The frustration to find out which view objects are used in which cases.
  • The  conflicts resolution when many developers works on the same module
Some additional reasons in order not to use only one Application Module
  1. Heavy Rollback operation. When rollback is performed all initiated view objects of the application or nested application modules are requeried by default.
  2. Heavy passivation - activation. Similar to rollback all initiated view objects will be passivated-activated by default.
  3. Handle errors after post. In order to handle errors after posting data there is an application module parameter bo.txn.handleafterpostexc. When this parameter is set to true then the related application module performs passivation before each transaction in order to perform activation in case of exception. I am not sure how and if this works on nested application modules.
  4. In case you want to expose some functionality as web services, a single Application module will create a single web service that will be heavy and coupled. I am not sure how this work with nested application modules.

Alternatively I have used the following approaches with numerous application modules and minimizing the database connections at the same time:
  1. The ‘do connection pooling’ approach
  • 300 root application modules
  • No Task flow transaction management 
  • Set application module properties: jbo.doconnectionpooling="true" and jbo.txn.disconnect_level="1"
With this setup we had less than 5 active connections for 100 concurrent users in production. 

According to the documentation this has a performance overhead for getting and releases the connection each time an application module use it. Yet it is recommended when minimizing the database sessions is a priority.
       
       2.  The ‘Use existing transaction’ approach
  • numerous root application modules
  • Task flow transaction management with a main task flow that always start a new trasactions and regions that ‘Use existing transaction if possible’
  • The main task flow has one application module that logicaly is used as root, the regions have other application modules that are automatically nested according to usage.
This setup has typically 1 connection per user. Caution is needed on commit and rollback in order for the transaction not to be lost from the main task flow (i.e. use DataControlFrame commit and rollback)

So in my opinion it is not a good practice to have only one application module unless you have only 1 simple business use case.

Monday, December 29, 2014

More than a year without a post.

I just realized than it’s been more than a year without a blog post.
No I haven’t stop working on fusion technology. It’s probably because I work more….
I have 5 versions of jdevelopers in my pc. One for each different project.

It’s a confusion to work on so many different versions of jdevelopers. There are differences in behavior and in design time that you need to cope with. So why do different projects need to be in different jdeveloper’s versions?

Mostly because older projects are in production and even though enhancements and second project phases are in development, the cost to migrate to newer jdeveloper versions is high.

Also jdeveloper versioning is a little confusing, since most 11.1.2.X versions are older than 11.1.1.6 and 7 versions.
11.1.2.X versions were the first versions using JSF2 yet they don’t have SOA or BPM.
In my opinion 11.1.2.X versions should not have been used for live projects. If you check the quantity and quality of bugs fixed in the release notes of later versions you would agree.

Even jdeveloper 12 versions did not have SOA and BPM until the latest release 12.1.3 release on June 2014.
So it seems like a good time now to push our customers to 12c migration within 2015.

I wish you all a happy new year.

Saturday, July 13, 2013

ADF-BPM Integration: Custom Worklist.

A custom worklist is something commonly required from customers that use both ADF and BPM.
There are some user tasks that must go through a BPM process and other tasks that are performed directly.
So usually in the ADF application a worklist to display the BPM Tasks is required.

Oracle fusion gives many options to approach this and this can cause confusion.

Direction 1
My first approach some years ago was to use the exposed task flows of the BPM worklist:
See Oracle® Fusion Middleware Developer's Guide for Oracle SOA Suite,
32.13 Creating Reusable Worklist Regions
‘Some features available in worklist are exposed as standalone reusable components that can be embedded in any application. Moreover, these standalone task flows provide many customizations through parameters that enable you to build and customize a worklist application to meet requirements.’
The first attempt looked impressive to the moment that I tried to perform some customizations. The parameters are not well documented so I was using the trial and error methodology.
I could not customize it enough…see http://adfbugs.blogspot.gr/search?q=worklist
Also there was no way to override any of the worklist functionality (e.g add a link to another ADF task flow)

Direction 2
So we went ‘by the book’ and used the java api as described in the next chapter of Developer's Guide
33 Building a Custom Worklist Client

Along with some help from RedStack posts we managed to create the worklist we needed
http://redstack.wordpress.com/worklist/

Direction 3
Yet by reaching the next chapter of the Developer’s Guide
34 Introduction to Human Workflow Services
you see that there are also web services exposed to query and edit human tasks.
I though, why to use the java api and so many libraries? After all we are doing SOA and we should use the web services to create the custom worklist, and to update human tasks from ADF.
First I tried the easy way, to directly create data bindings from TaskQueryService web service. The result was the following:

I could not manage to create the correct structure of the input parameters in order to call the web service. Especially the ‘Predicate’ iterators were a nightmare.

So I tried a web service proxy:


A lot of types are created, similar but not the same with the java api and I managed to create and pass the correct parameters for the web service to run and return the Task list.

One issue was that the dates was exposed as iterators in the bindings?!

Yet the show stopper was that the Task type created from the web service do not have the getPayloadAsElement and setPayloadAsElement methods as the Java Api has. I did not find any way to update the human task payload from the web service.

The bottom line is that even though there seems to be 3 directions, only the second, seems to be the safe way to go for now.

Friday, April 5, 2013

New (11.1.1.7) Oracle Fusion release



Sorry for the long time to post.

I would like to say that i was very bussy but that could hardly describe it.

New full fusion version (11.1.1.7) is released from oracle this week.
this is mostly a bug fixing and new features releases (not the technology upgrade).

I guess that the 12c full fusion technology upgrade is not expected soon (may be at end of the year)

I see some interesting new features in release notes of jdeveloper:

Also there seems to be many additional features in BPM:

See also a great post of Chris about Why to migrate to this version:

I will evaluate our applications in the new release and let you know.

Wednesday, December 12, 2012

ADF Table Click to Edit functionality

I haven't been posting lately, i feel sorry for that.

This is mostly because i am up to my head with new projects, BPM, SOA, BI and other fusion middleware technologies. Also because:
  • we are using Jdeveloper 11.1.1.6 that is stable
  • we are using more or less the well known functionality
  • end users have started to get used to ADF functionality
 Still we need to keep walking, so i keep an eye from time to time, on the latest jdeveloper version 11.1.2.3.0 and functionality that we don't frequently use like the  ADF Table 'Click to Edit'.

Actually its a fancy functionality that make the table look nice and works fine with navitating either with mouse or by 'Tab' or arrows.
It is easy to implement, just set editingMode="clickToEdit" in editable ADF table.

everything works fine apart from the Date picker that does not work in Firefox 17 and it is not related with click to edit functionality (see forums.oracle.com )

Everything work fine until you press CreateInsert button.
Then a new row is inserted and highlighted yet it is not editable, the previous selected row is editable.


If you click on any other row by mouse nothing happens, rows don't become editable.
Arrows navigation don't work and If you try to navigate with tab it never go to the new row.
So the only applicable action is to click with mouse in the new row.

If you make a mistake not to fill the required fields and click on a different row, then validation errors appear as expected.
After that if you press rollback, even if it seems that the table is back to normal some rows are not editable any more when you click on them.
Sometimes rows display as duplicate on the table with these steps.
So it seems that click to edit functionality does not work properly for newly created rows on editable tables.
What we do to override this is that we create a popup dialog for new row data to be inserted and committed before they are editable in the table.

Test Case

Tuesday, July 24, 2012

Focus is Lost in IE8 when value is changed in Input List of values

New bug in Jdeveloper 11.1.1.6 version. It was not reproduced in 11.1.1.4.
It also happen only in Internet Explorer 8, not in 9 and not in Firefox.
When a value is selected or typed in an Input List Of values then the focus (cursor) goes to the internet explorer tab. This causes frustration to user's and delay in data entry.
Details in java.net/jira/browse/ADFEMG-31

Friday, May 11, 2012

Cannot commit orddoc Attribute through jdbc datasource

This is a new issue in JDeveloper version : 11.1.1.6.0
After migrating adf application from jdeveloper 11.1.1.4 to 11.1.1.6 the uploading of files in an ORDDOC database field fails with error:
java.sql.SQLException: Undefined type
at oracle.jpub.runtime.Util._convertToOracle(Util.java:277)
at oracle.jpub.runtime.Util.convertToOracle(Util.java:167)
at oracle.jpub.runtime.MutableStruct.getDatumAttribute(MutableStruct.java:323)
at oracle.jpub.runtime.MutableStruct.getDatumAttributes(MutableStruct.java:347)
at oracle.jpub.runtime.MutableStruct.toDatum(MutableStruct.java:118)
at oracle.ord.im.OrdSource.toDatum(OrdSource.java:93)
...

Defect 14058697 has been created  in oracle support

details in ADFEMG-22

At this time, disabling the wrapping seems to be the only viable option.
see Using Unwrapped Data Type Objects
http://docs.oracle.com/cd/E21764_01/web.1111/e13737/ds_tuning.htm#CHDEIBCE
We tested in test case and in our application and this workaround works.

Friday, May 4, 2012

java.net adfemg updates

ADFEMG-19 Combo Box not supported for ADF Faces?
lodged ER 14034162.

ADFEMG-20 ListOfValuesModelImpl : No row found for rowKey.
 new bug in jdeveloper 11.1.2.1, bug 14034129 logged and Fix scheduled 12.1.2.0.0.

ADFEMG-14Input List Of Values, autosuggest behavior
9316480 is lodged and Workaround suggestions are posted.

 

Thursday, April 5, 2012

Input List Of Values, autosuggest behavior

By default when you type a value in an input list of values the query is executed always with the LIKE operator.

This is very annoying for users that do heads-down data entry.
Also if the field is a number executed query force full table scan causing performance issues.

We just need the option to disable auto-suggest behavior (on design time) so that the query is executed with '=' operator and the LOV does not open when the value entered is valid.

You can find the details in

http://java.net/projects/adfemg

Tuesday, April 3, 2012

ADF Code Corner OTN Harvest and ADF EMG project at java.net

I would like to thank Frank Nimphius for asking and publishing my point of view for various ADF matters into OTN Harvest Summary of March 2012.
You can find this and other valuable material in Oracle ADF Code Corner.
There is also a new promissing initiative by Chris Muir and Frank Nimphius by creating an ADF EMG project at java.net. There is an issue tracking jira project there for keeping track of adf issues.
I will try to contribute to this effort by posting bugs there and just a reference summary to this blog.
I will try to find other inderesting roots for this blog.

Saturday, March 17, 2012

SDO web service from business components validations.

This issue was found by my colleague and friend Gabriel Sideras that was assigned the task to create web services from our business components.
He noticed that sometimes the entity validations was not executed from the web service. This happens when the entity primary key has checked the attribute refresh after insert.
This is reproduced at the attached test case that a simple createDepartment web service is created with HR department entity and view.



If you run the web service in Analyser and Send a request without any data then the entity validations are performed and JBO validation errors are shown in the response:


Yet if you change the DepartmentId attribute of entity which is the primary key and it is filled by a database trigger to be Refresh after Insert and you run the WS again then if you Send a request without any data the entity validations are not executed and the error that is shown is the dml failure from database.


This is a serious issue for us since we try to reuse (at least) the entities of our application to expose web services so this would require changes of implementation of primary keys.

It reproduce in jdeveloper 11.1.1.4 and 11.1.1.6.

Monday, February 27, 2012

New Jdeveloper 11.1.1.6 reproducable issues

New fusion and Jdeveloper version 11.1.1.6 is available since last week.

I hear there are a lot of upgrates for SOA and BPM.
For ADF there are some enchancements for touch-enabled devices and bug fixes.

Some inderesting bug fixes in relase notes that we care about are:

12434470

reopening search and select dialog shows old data in the table

12825879

lov on query does not validate correctly and fires a blind query

12825973

lovs do not display changed values during the current session

12991181

af:inputlistofvalues in af:table only shows 25 rows

12376375

attributedescriptor.setreadonly(true) doesn't make the field readonly


I went through the posted bugs since 11.1.1.4 in this blog and unfortunately most of them still reproduce in 11.1.1.6:

Rollback does not refresh current row of af:table after validation errors.

Attribute Validation on Input List of Values attribute

Number precision and scale bug

Range paging and Table Selected Row Bugs

Tab selection and Enable User Customization on Session bug.

ExecuteEmptyRowSet and Range Paging. (Fixed in 11.1.2)

Partial Page Rendering ChangeEventPolicy="ppr" bug. (Fixed in 11.1.2)

Dependent LOV in table shows invalid values

Invalid values in choice lists

Application Module cannot get principal when you use transaction controller in task flows (Fixed in 11.1.2)

Table Filter Number format bug

Cannot use a region in a page more than one time

Access Keys are accessible even from a modal popup

Friday, February 17, 2012

Bad performance on quering Roles in weblogic Enterprise Manager

There are about 400 application roles defined in our application.
In a production environment there are about 1000 users that have groups of these roles so there are about 7000 role assignments.
We the policy store to be Database based for production environment (as it is recommended by documentation) in order to support clustering Weblogic environment.
Then the hole performance of Enterprise Manager was much worse than in file based. It took about 8 minutes to query the roles. This was happening also in every action , create, assign, remove role.
We run statistics and clean procedure in the database Policy Store but with no improvement.

So Service Request in oracle support is posted and they managed to reproduce it and post a bug: 13597913.

As a workaround we still use File Based Policy Store and synchronize system-jazn-date files between clustered servers.

Tuesday, December 20, 2011

Access Keys are accessible even from a modal popup

When a popup is open in a page in default (modal) mode then the rest of the components of the page are not accessible with mouse, yet if buttons have Access keys they are still functional allowing the user to brake the functionality.

n the attached test case run testpopup page
Press Edit button to open popup
Press Alt+Shift+c access key of Commit button

Expected: Nothing should happen
Actual: Commit is performed and popup is closed.



Test case.

SR is posted for this and Bug 13338347: ACCESS KEYS SHOLD BE DISABLED BASED ON THE CONTEXT

Yet the Oracle development consider this as a Browser issue. 'The issue is not in the scope of the ADF Product as this is the feature of the browser. '

We are working on a workaround about this issue.
We are based on the fact that when a button is disabled then the access key is not functional.
So on popup FetchListeners we disable the buttons of the main page and on popupCancelListeners we enable buttons again.
It seems to work, yet we need to check any side effect and we need to implement it for all popups.

Thursday, October 6, 2011

Pressing 'Tab' in LOV field new bug in jdeveloper 11.1.2.1

Trying to evaluate latest version of jdeveloper 11.1.2.1 in order to migrate our applications that is still in 11.1.1.4 i hit on the following bug.

While navigating through panel form fields with tab key, all validations of the page are thrown as if a full submit was performed.
This happens when you have input list of value field and the focus is on the field and you press tab key. The input list of value is autosubmit in order to refresh other fields

In the test case run testTab page and press CreateInsert button. Click on Department or Job List of value field and press Tab key. All validations of the page appear.
I also notice that errors appear in Greek even though my browser language is in English.



Test Case:
http://adfbugs.googlecode.com/files/TestLOVTab.zip

Bug 11939353 was already logged in oracle support which is fixed in a future release.

also in OTN Thread: Validation issue
https://forums.oracle.com/forums/thread.jspa?threadID=2254388&start=15&tstart=0

According to this thread a workaround exist in Didier's blog:
How To Avoid The JBO-27014 Error During The AutoSubmit

Sunday, August 28, 2011

Cannot use a region in a page more than one time?

In our application we use regions for reusability and consistency.
For example we have An address region that we reuse in order to show and edit a person address and a company address. We pass the address owner as a parameter to the region in order to show corresponding data.

Yet if regions are placed in the same page then both regions show the same data even if they get different parameters.

This is because of automatic application modules nesting.
The framework see that AddressModule is already in data control and it use the same for both regions due to shared data control scope.

It does not happen if we don't use shared data control scope, yet then we have a different database connection for each region. It does not seems right to have different connection to get different data!!?

In the test case i have a simple Department Task flow that query for specific department depending on passed parameter inDepId


Then in a page i place the same region 2 times with different parameter passed in each region.
Yet when i run the application both regions show the same data.



Is there a way to show different data without having different database connection?

Test Case:

http://adfbugs.googlecode.com/files/TestRegions.rar

Tuesday, August 16, 2011

Rollback is executed when a region is refreshed

We are using Task flows as regions in jdeveloper 11.1.1.4 in the latest project.
I have just noticed that when a region refreshes then a data control transaction rollback is executed transparently.
This does not happen the first time the region is displayed but every time it is refreshed after that.
This cause unexpected behavior of loosing data and the current rows of any other shared transaction task flow.

Could this be an expected (designed) functionality? Why?

As a test case I have 2 application modules (DepartmentsModule and Employees module) and a page that has departments and a region that has Employees with ‘share transaction if possible’ in the EmployeesTaskFlow.
Also the EmployeesTaskFlow get as parameter the current DepartmentId and has Refresh condition ifNeeded so that it refresh every time I navigate into departments.

Yet when I press next button I loose any change made on current department and I stay in the same row.
What I see in log is that Rollback is executed as a consequence of region Refresh and releaseViewPort.



Is this expected behavior or a bug?

I will check also what happens in 11.1.2 that it seems the nesting implementation have changed:
http://one-size-doesnt-fit-all.blogspot.com/2011/08/task-flows-sayonara-auto-am-nesting-in.html

It reproduce also in 11.1.2

Test Case
http://adfbugs.googlecode.com/files/TestRegionRollback.zip

A Perfect explanation and solution is given by Oracle Support. I will put it as is here:
@ At the point when the customer decided the region should share the
@ transaction with its parent, he also made the region a potential actor on the
@ parent transaction. Since the transaction mode on the region is not 'Always
@ Use Existing Transaction', the region transaction is not necessarily created
@ by the parent (and I will come back to that later), the behavior of the
@ region becomes the behavior of the parent even if they don't share the same
@ datacontrol. That is because both datacontrol are in one transaction since
@ the transaction is shared. When the region refresh, it rollback the
@ transaction which rollback both datacontrol.
@ .
@ To make the share mode work, the main point the customer should pay attention
@ to is that the transaction should be created by the parent, not by the
@ region. If it is created by the region, then the region become the owner of
@ the transaction and will rollback when the region is refreshed. If the
@ transaction was created by the parent it will work as expected.
@ .
@ What you need to do is ensure that the transaction is owned by the parent.
@ You need to have it created before the region. They are several ways to do
@ that:
@ 1) Have the parent page in a bounded taskflow with 'Always Begin New
@ Transaction' mode on.
@ 2) Call beginTransaction() on the DataControlFrame in an action that
@ navigates to the parent page with the region.
@ 3) Have a method activity that executes beginTransaction() on a request bean
@ before navigating to the parent page with the region.
@ The code to do begin the transaction is:
@ .
@ public void beginTransaction()
@ {
@ BindingContext context = BindingContext.getCurrent();
@ .
@ String dcFrameName = context.getCurrentDataControlFrame();
@ DataControlFrame dcFrame = context.findDataControlFrame(dcFrameName);
@ dcFrame.beginTransaction(new TransactionProperties());
@ }
@ .
@ To prevent the region from owning the transaction and run into these types of
@ issue for share mode, you can set the transaction mode on the taskflow to:
@ or 'Always Use Existing Transaction' in the
@ property inspector. If the transaction does not exist, an exception is
@ thrown.
@ .
@ I modified the original test case to illustrate the different options. Open
@ the workspace and look at adfc-config.xml. Run the Start page, withoutTrans
@ is the original test case, withTrans and beginTrans are 2 options that work.
@ .


Resolution Test Case
http://adfbugs.googlecode.com/files/TestRegionRollback2.zip
Hello

Unfortunately it seems that the issue is not fully resolved.
This works until a Data control frame commit or Rollback is executed.
Then it seems that the parrent looses control again of the transaction and regions rollback again on every refresh...
In the test case i added 2 buttons that do :

DataControlFrame dcFrame = context.findDataControlFrame(dcFrameName);
dcFrame.commit();
and
DataControlFrame dcFrame = context.findDataControlFrame(dcFrameName);
dcFrame.rollback();

The test case work fine until any of the commit or rollback transaction is pressed
Then Next button still causes rollback to be executed.

This means that still i cannot control the full data control frame transaction when i have regions with parameters.

New test case
http://adfbugs.googlecode.com/files/TestRegionRollback3.zip