The new JDeveloper version 12.2.1 is just out and has a lot of new features to investigate. In this post we see how remote task flows work. Yes, they are finally here and they are working. At least if you install a patch available from support.oracle.com.
The downloadable version on JDev 12.2.1 has a small bug which prevents you from running remote task flows (refer to https://community.oracle.com/thread/3816032). Support and the dev team quickly delivered a patch for this. To get the patch, open a service request and ask for a patch for bug 22132843.
Let’s start. We need two applications to show how remote task flows are implmented. One is the remote task flow producer, one consumes the remote task flow. An application can be both, producer and consumer. For this sample we keep it simple and define one app as producer and one as consumer.
This application is really simple as it consists of only one page and one task flow which shows the departments and its employees of the HR DB schema.
The image above shows the running application stand alone. The single page has the header and a simple task flow beneath it to show the departments and their employees.
There are two properties to set in the task flow.
1) in must be remote invocable
2) the transaction must be isolated
Next we have to make the application aware that it should be a remote task flow producer. For this we edit the projects properties and select the ‘ADF Task Flow’ node.
Please note is the second checkbox selected which allows anonymous users to access the remote task flow. This should not be used in a production environment as this would allow anybody to access the task flow. The doc shows how to secure the access to a remote task flow (see link below).
These settings will add a special servlet and a servlet filter to the web.xml file of the application.
There are more things to consider which you find in the docs at How to Configure an Application to Render Remote Regions
That’s it for the simple producer application.
The second application is simple too. Here we use a single page which again uses the HR DB schema to show the departments as an editable table in a panel splitter. On the right of this we show the remote task flow of the producer application.
In the image above the remote task flow isn’t visible as it is not added at the moment.
To make the remote task flow available we need to run the producer application. Here we have to be careful if we try this out using the embedded WebLogic Server. As only one application can be started in debug mode, we need to start the producer application as a normal application.
In the consumer application we set the project properties for the ADF Task Flow to allow it to consume remote task flows
Now we create a remote task flow connection. Open the resource palette and select to create a ‘Remote Region Producer…’ from the IDE connections.
Here we fill in the needed info like the path to the remote producer servlet which will get us the names of all remote task flows the application holds. To access the remote task flow we define the URL endpoint
The details about what to fill in are again from the doc.
In the consumer application we now open the one page and drag the remote task flow from the ressource palette onto the page and drop it in the right hand splitter
This will give us the known image in design mode as if you use a normal region
We are ready to run the consumer application and get