Data Source, select SearchStringVar

Data Source, select SearchStringVar

for Attribute, and click OK. Select the new SearchStringVar1 binding in the Bindings box, and in the Property Inspector, change the id property to SearchString to give the binding a more meaningful name.

Click the Design tab to return to the visual editor, and select the inputText field. In the Property Inspector, click in the Value field and use the menu to the right of the field to choose Expression Builder. In the Expression Builder dialog box, expand the ADF Bindings folder, the bindings node it contains, and the SearchString binding. Scroll down to select the SearchString bind- ing’s inputValue property. Note that a corresponding EL expression appears in the Expression text box above, and then click OK to use that expression. Now the text field is bound to the page definition variable you created, using the attribute binding.

In the Application Navigator, expand the Page Flows folder inside Web Content in the ViewController project. Drag the find-employee task flow, and drop it into the center of the panelGroupLayout (inside the decora- tive box) that is already on the page. When the Create context menu appears, choose Region to add the bounded task flow to your page as a region. Because the find-employee task flow has a required parameter named searchString,

The Route to Success

Use task flow routers for conditional navigation.

ORACLE MAGAZINE

JANUARY/FEBRUARY 2010

the Edit Task Flow Binding dialog box appears. Enter the same EL expression you used previously— #{bindings .SearchString.inputValue} —into the Input Parameters table’s Value field. This con- figures the region to get the value of its searchString parameter from the page definition variable the user populates, using the text field you configured earlier. Click OK to create the region.

USING A WILDCARD RULE AND A DEFAULT ROUTER Now that the containing page is set up, you’ll complete the declarative configuration of the task flow. Double- click the find-employee task flow in the Application Navigator to open it in the editor. The diagram contains four annotations to remind you of the steps required to complete the task flow’s func- tionality. (After you complete each step, feel free to delete the reminder note.)

Multiple activities will enable the user to complete the task flow, so rather than cluttering up the diagram with many navigation case lines that all connect to the Done task flow return activity, you can keep the diagram readable by creat- ing a wildcard control flow rule. Drag

a Wildcard Control Flow Rule from the Component Palette (select View -> Component Palette, if necessary), and drop it onto the diagram close to the existing Done activity. Accept the default name, *, by pressing Enter. Next, select the Control Flow Case tool in the Component Palette. First click the wildcard rule icon and then the Done activity to connect them. When the box for assigning a name to the control flow case appears, enter Done and press Enter. You can think of the flow as this: From wherever we might be, if the outcome is Done, we’ll come here next.

Next you’ll configure a router activity as the default activity in the task flow to perform conditional handling of the passed-in parameters. If the parameter value is not null, your router will navi- gate to the initializeTaskFlow method call activity to perform the necessary model-layer setup before showing the first view activity. If the parameter value is null, the router will go directly to the

Done activity to complete the task flow without performing any work.

To create a router activity, drag a Router from the Component Palette and drop it onto the diagram near the STEP 2 note. Change the new router’s name to ProcessParameters . To mark the router as the default activity, right- click the router’s icon and choose Mark Activity -> Default Activity. Then select the Control Flow Case tool in the Component Palette. First click the ProcessParameters router activity and then the initializeTaskFlow method call activity to connect them. Name the control flow case Initialize . Select ProcessParameters (the router activity) in the diagram, and use the Property Inspector to set the value of its Default Outcome property to Done—the name of the wildcard rule you created. In the Cases table in the Property Inspector’s General category, click the green plus icon to create a new router case. Enter #{pageFlowScope.searchString != null} as the Expression, and for Outcome select Initialize from the list. Because #{pageFlowScope.searchString} is where the searchString task flow parameter is configured to store its value, this condi- tion will route to the Initialize activity when the parameter’s value is not null.

INITIALIZING A TASK FLOW WITH A CLIENT INTERFACE METHOD The HRModule application module uses a custom method named initialize FindEmployeeFlow() to encapsulate all the model-layer business logic neces- sary for initializing the task flow. You’ll expose this method on the client inter- face, so you can then drag it from the Application Navigator’s Data Controls zone and drop it onto the initializeTask Flow method call activity. This will cause the initializeFindEmployeeFlow() method to be invoked declaratively before the first view activity renders.

Start by double-clicking HRModule in the Model project in the Application Navigator to open it in the editor. Select the editor’s Java page, and then click the pencil icon in the title bar of the Client Interface section. When the Edit Client Interface dialog box appears, select the

initializeFindEmployeeFlow() method in the Available list, click > to shuttle it into the Selected list, and click OK.

To take a closer look at what this method does, click the hyperlink to the right of the Application Module Class label to navigate to the HRModuleImpl class in the code editor. As the com- ments explain, the method accepts a string argument; sets two view object bind variable values on the EmpView1 view object instance; executes its query; and then returns an integer result to indicate whether zero, one, or multiple rows were retrieved.

To see how the EmpView1 view instance is configured, return to the HRModule editor, navigate to its Data Model page, select the EmpView1 view instance in the Data Model tree on the right, and click the Edit button. In the Edit View Instance dialog box, note that the FindByEmpnoEnameOrJob view criteria is applied to the view instance. As its name implies, that view criteria uses the bind variable values being set in the initialization method to find an employee based on employee number, name, or job. Click Cancel to close the dialog box, and click back on the

find-employee task flow editor (find-

employee.xml tab).

Next, you’ll drag the initialize FindEmployeeFlow() method from the Data Controls onto the method call activity in the task flow. Expand the Data Controls section of the Application Navigator. Right-click HRModuleDataControl, and choose

Dokumen yang terkait

ALOKASI WAKTU KYAI DALAM MENINGKATKAN KUALITAS SUMBER DAYA MANUSIA DI YAYASAN KYAI SYARIFUDDIN LUMAJANG (Working Hours of Moeslem Foundation Head In Improving The Quality Of Human Resources In Kyai Syarifuddin Foundation Lumajang)

1 46 7

Analisis Komparasi Internet Financial Local Government Reporting Pada Website Resmi Kabupaten dan Kota di Jawa Timur The Comparison Analysis of Internet Financial Local Government Reporting on Official Website of Regency and City in East Java

19 819 7

FAKTOR-FAKTOR YANG BERPENGARUH TERHADAP PENDAPATAN TENAGA KERJA PENGRAJIN ALUMUNIUM DI DESA SUCI KECAMATAN PANTI KABUPATEN JEMBER The factors that influence the alumunium artisans labor income in the suci village of panti subdistrict district jember

0 24 6

The Correlation between students vocabulary master and reading comprehension

16 145 49

The correlation intelligence quatient (IQ) and studenst achievement in learning english : a correlational study on tenth grade of man 19 jakarta

0 57 61

An analysis of moral values through the rewards and punishments on the script of The chronicles of Narnia : The Lion, the witch, and the wardrobe

1 59 47

Analyzing The Content Validity Of The English Summative Tests In Vocational Schools (A Case Study In Odd Semester Of Second Year Technology Major In Tangerang Vocational Schools)

1 50 155

The Effectiveness of Computer-Assisted Language Learning in Teaching Past Tense to the Tenth Grade Students of SMAN 5 Tangerang Selatan

4 116 138

The correlation between listening skill and pronunciation accuracy : a case study in the firt year of smk vocation higt school pupita bangsa ciputat school year 2005-2006

9 128 37

PENGARUH KOSENTRASI SARI KUNYIT PUTIH (Curcuma zediaria) TERHADAP KUALITAS TELUR ASIN DITINJAU DARI AKTIVITAS ANTIOKSIDAN, TOTAL FENOL, KADAR PROTEIN DAN KADAR GARAM The Addition of White Turmeric (Curcuma zedoaria) Concentrated Base on Quality Antioxidan

1 1 8