After my last week presentation on ODTUG Kaleidoscope'08 - Development with Oracle JDeveloper/ADF 11g Reusing 10g Best Practices, I was discussing with a guy from auditory and he have talked to me about problems with remote task flow invocation in JDeveloper 11g. So, in this post I will cover this topic. Generally speaking, possibility to call remote task flow is new feature in JDeveloper 11g and there are still problems in Technology Preview 4 in this area. You can refer to OTN Forum post - TP4 error with calling remote taskflow. Actually, currently it works, but only when calling remote task flow directly with complete URL. In my sample application I have implemented this case.
You can download two parts - JobsLocal.zip and JobsRemote.zip. Those two parts are completely separate applications, however from JobsLocal I'm calling remote task flow available in JobsRemote application. Implemented functionality - in JobsLocal user can select Job from a table and pass selected Job key to remote application, where master-detail form for Job and Employees is opened according to passed key value. Both applications are implemented based on HR schema from Oracle XE database.
JobsRemote application contains bounded task flow - this task flow is called from JobsLocal:
You can notice back control flow case pointing to URL View activity. This activity is used when going back from Remote application - in this case I'm going back by calling jobs page from Local application by URL:
If you will run this sample on your local computer, make sure that you are using correct URL.
Task flow in JobsRemote application accepts parameter for setCurrentRowWithKeyValue action:
When task flow in Remote application is defined and components on the page are created, its time to create deployment profile - ADF Library JAR File. We will pack our Remote application as JAR file in order to use defined task flow in Local application:
In order to create JAR after deployment profile is set, just right-click on ViewController and choose Deploy -> Deployment Profile Name -> to ADF Library:
Now its time for JobsLocal application, at first add generated JAR library to Application Resources by selecting New Connection -> File System... in JDeveloper 11g section called Application Resources:
In opened dialog - Create File System Connection, provide Connection Name and Directory Path. Optionally you can Test connection and if Status is positive press OK button:
Library with JobsRemote application task flow is added and you can drag and drop it to the task flow in JobsLocal:
When you will drag and drop it, JDeveloper 11g will create it as Task Flow Call activity:
Only one thing you will need to do is to provide URL for remote application. In our case, I'm constructing URL dynamically in Backing bean method (make sure it is correct in your environment):
getRemoteTaskFlowURL() method retrieves selected row key from Jobs table and adds it as a parameter to remote task flow URL. I'm using the same name for parameter as it is defined in task flow from JobsRemote application.
You can run both applications in parallel directly from JDeveloper 11g, just you will need to use Integrated OC4J option, by default Embedded OC4J option is used. You can switch just by opening Tools -> Java EE Runtime Preferences.
At first, you will need to run bounded task flow from JobsRemote application, since this task flow is called from JobsLocal.
When JobsRemote will be up and running, run jobs.jspx page available in JobsLocal application, you will get similar screen:
In my case I have selected row with JobId = SA_MAN. When Edit Job button is pressed, it navigates to task flow available in remote application - JobsRemote by passing selected job key value:
Remote application is opened with correct data for provided key. You can edit and save data from this screen. Button - Back, through URL call will navigate to original jobs.jspx page in JobsLocal application: