Wednesday, August 25, 2010

Test Case : Passing Parameters to Bounded Taskflows using Oracle Dynamic Tab Template

Recently I posted a blog showing what we need to do in addition to the existing code to pass parameters to bounded taskflow in Oracle's Dynamic Tab Template, but from few comments that I received it seems that there are still certain doubts or issue in order to get it working. So here is the test case that explains the stuff.

Test Case:
My test case is very simple, I have a jspx page with Dynamic Tabs Template. It has a link on the navigation area, clicking the link launches a popup that takes two input values. On click of 'OK' it launches the taskflow and passes the input values as taskflow parameter, which is displayed inside the taskflow on a page. Here is the screenshot:



As I said in previous blog we do need to download latest jar for this template which has these functionality added. Download the oracle-page-templates-ext.jar from here Or go to JDeveloper Help -- check for updates. On check for updates wizard, source step (step 2), check 'Official Oracle Extensions and Updates' and click next.


 Scroll to find 'Oracle Dynamic Tabs Page Template 1.02', check the option and click on finish to install the extension.


If you have downloaded the jar from my link you need to go to folder where Jdeveloper is installed ......\Middleware\jdeveloper\adfv\jlib. Rename the existing oracle-page-templates-ext.jar to oracle-page-templates-ext.jar.backup. Pasted the jar you just downloaded. If you have downloaded if from 'Check for Updates' then you don't need anything to worry about. Once you have installed the required template, we can go on creating the test case.

For test case, create a new jspx page with using Oracle Dynamic Tab Shell as page Template. Expand the page implementation detail and select radio button for 'Automatically Expose UI components in a New Manage Bean' and provide the details for Name, Class and Package.


Now create a taskflow that needs two taskflow parameters as follows:


Now create a jsff page and drop two input text fields on them. Set there values as value of input parameters, here is the code for the page:


Drop this page on the taskflow and set it as default activity.


Now lets bind the taskflow to the UI shell. Go to UI shell and on the navigation facet drop a popup with Dialog that takes two input text parameter. Also drag and drop a command link and drop an showPopupBehavior that would be used to launch the popup. Here is how it looks into structure window:

Also here is the how source looks like:


Once we launch the popup and get the input parameter, we will need to pass it too the bounded taskflow that we wanted to do and launch the taskflow itself.

Associate dialogListener method with the dialog listener property of the dialog which would look like       dialogListener="#{backingBeanScope.RunMeBackBean.dialogListener}", we can already see this in the code for jspx page above. One thing that we need to notice is the path of the taskflow passed. It should always be in pattern "/WEB-INF//<>TaskflowName>.xml#"

You can also download a test case here.

3 comments:

  1. On the taskflow it is the name associated with the 'Control Flow Case' or you can say the arrow that links the two taskflow activity.. or value of 'From Outcome'.

    Or its the value you select in Action property of a command/navigation component to navigate to different Taskflow activity.
    Hope that helps...

    ReplyDelete
  2. Hi Amit,
    If we have single taskflow which cotains an router and navigates to 2 different pages based on input parameter passed, task flow is showing the same page which is navigated first -- even when input parameters change?

    Any workaround on how to get this working?

    Thanks,
    Chaitanya

    ReplyDelete
  3. I don't think you would need any workaround as this isn't a bug. If you have dropped the taskflow as region.. make sure Refresh property for region binding on pageDef is set to 'ifNeeded'. This will make sure when value is changed region is re-executed with new value.

    You can also try to put an output text on jsff to see what is the value of pageFlowScope param inside the taskflow. My first guess would be region is not getting re-executed when value changes or may be EL expression for Router is not correct.

    ReplyDelete