Understanding navigations in Taskflow with train
This post illustrate different kind of manipulation with navigation in Taskflow with train.
Create Taskflow with train
A taskflow with train can be created by selecting CreateTrain checkbox in CreateTaskflow wizard.
Add train component to each train stop view.
Change the label for the train stop in the train component -
Select the train stop (view activity) in the diagram and look at the property inspector, choose the Train Stop tab and set the value of display-name property to a string or an EL Expression
1. Simple Train -
Added a input parameter skipValue to Taskflow for later use. Value passed is the name of viewActivity.
Use skip property of train stop to stop access to a viewActivity of the Train -
Using the taskflow parameter to update the skip property of activity to skip the train sequence.
By default a train is sequential. For a non-sequential behaviour pass modify the sequential property of the TrainStop.
Drag and drop the taskflow as a region on page and analyze the output.
Navigation to stview4 can be done directly. It's no more sequential.
Also stview3 is skipped in train navigation.
2. Complex Train -
How to call a view activity between two train stops -
Created a taskflow with train having three view activity. Here we are trying to make a method call when navigating from view1 to view2 .
Drag and drop wildCard Control Flow rule and method. Use control flow case as mentioned in below diagram.
ctView1 contains a button with action "addText".
For direct navigation without calling method use train. To invoke methodcall use button with action "addText".
Application can be download from here.