This post is about usage of taskflow template for handling navigation. Whenever I google about taskflow template, the links available used to show the exceptionHandling done through taskflow template. Wondered about other scenarios where Taskflow Template can be used. Here goes one sample for taskflow template usage.
Consider the following usecase :
Taskflow has multiple pageFragments and other taskflow call activity. Then how to handle return from the taskflow and enter proper pageFragment or taskflow.
Each pageFragment includes another reusable pageFragment "navigation.jsff " to have links available to navigate across functionality. Sample Fragment Code :
Here goes the sample for navigation.jsff -
Now user is inside view1 of tf1 and click on ViewPersonPolicy link. One way of defining navigation is all taskflows has taskflow return activities (outcome = next action string ) defined so that it returns from the taskflow (tf1 ) and enters proper taskflow as requested.
Here comes the usage of taskflow template. Define all taskflow return activities with proper outcome in template then generate tf1, tf2, and tf3 based on that template . On clicking of any link in navigation.jsff proper taskflow return activity will be used to exit which has outcome for the requested pagefragment.
You will get more idea after looking at the application code available for download here.