In Oracle ADF, it is possible to call a Java method, implemented on an Application Module or on a View Object, from a task flow. This can be useful to execute business logic at specific points within a task flow, e.g. to filter query results or to update data for view objects which will be displayed in the succeeding view activity. Suppose we have the following simple method defined in the Application Module’s implementation class, and this method is also exposed through the Application Module’s client interface:
public void updateData(String theData) { ... }
This method will then appear in the Application Module’s data control, and we can simply drag&drop the operation into the task flow:
This will generate a bunch of files in the background, in order to make it possible to call the method implemented on the Application Module in the Model layer from the UI layer through the binding layer. Since the JDeveloper IDE does a lot of work automatically in this case, lets examine how we can add this method call activity more manually. This will help to understand what is actually done by JDeveloper in case we simply drag&drop the operation from the Data Controls panel.
Let’s see how to manually add the Method Call Activitiy in the next section.