When you develop ADF Web Application you often use the ADF ApplicationModule Tester (BC4J Tester) to quickly test your business components data model and your self-written code in any EntityObject, ViewObject or ApplicationModule. For more information about how to do this look at JDeveloper & ADF: Use the Application Module Tester (BC4J Tester) to Test all your BusinessLogic.
Users who use one of the latest JDeveloper versions 12.2.1.1.0 and newer may have noticed, that the BC4J Tester application starts without an error, but doesn’t show the dialog. I run into this a couple of times lately and decided to dig into this problem. On the Oracle Development Spaces, I saw some threads about this too.
The reason for this behavior is that any EO, VO or other methods in the application module have an error, which can’t be found during compile time.
Use case
To show the effect, we start with a simple Workspace and a model project which only has one ViewObject in the Application Module’s data model
Implementation
OK, so how do implement this use case?
We do this by adding a transient attribute to the EmployeesView and use a SQL default expression to do the calculation
sum(Employee.SALARY) OVER (PARTITION BY NULL ORDER BY NULL)In the image below we see the definition of the transient attribute in the ViewObject
Shay Shmeltzer mentioned in one of the ODC threads, that the reason for this is that there is an error in the application module (ViewObject, EntityObject or AM method). As the only thing we added is the SQL statement for the transient attribute, it’s clear that the statement must have an error. It’s simply a missing ‘s’ character, as the DB table we use is named ‘Employees’ and not ‘Employee’. So the correct statement is
sum(Employees.SALARY) OVER (PARTITION BY NULL ORDER BY NULL)This will solve this problem and the BC4J Tester will start up and show (see the images above). But what if we added more things to multiple objects?
HOW TO FIND THE ERROR THEN?
I did not manage to get the same output using JDev 12.2.1.1.0 or newer, but you can get the same message in the message window.
-Djbo.debugoutput=consoleThe option is added in the model projects ‘Run/Debug’ option in the project’s properties
For more
No comments:
Post a Comment