![]() |
Copyright © TIBCO Software Inc. All Rights Reserved |
1. Create a directory for the input file. For example, c:\projects\bwtest.
2. Create a file in the directory named PolledFile.txt.
1. In TIBCO Designer, select the project name (bwtutorial) in the project panel.
2. In the palette panel, select the Process palette.If no palettes are in the palette panel, click the Switch Palette Modeicon to display the palettes.
3. From the palette panel, drag a Process Definition into the design panel.
4. In the configuration panel, type the name FileTest in the Name field to rename the process. Then click Apply.
5. Save your project by choosing Project > Save from the menu.
1. Select the FileTest process in the project tree.
2. Find the File palette in the palette panel and select it.
If the File palette is not one of the available palettes, click Palettes > Browse to display the Palette Browser. Type File in the Filter string/pattern field and click Filter. Select the File palette and click Close.
3. Drag a File Poller activity into the design panel (but not on top of the Start activity).
a.
b.
c. Select text in the drop-down list in the Content as field, and select the appropriate encoding for your operating system in the Encoding field. Other fields should use defaults.Figure 66 Adding Activities to the Process
d. Click Apply.
5. Drag a Create File activity into the design panel and place it to the right of TestFilePoller.
6. Name the Create File activity CreateTestFile, and click the Overwrite checkbox, and then click the Apply button.Figure 67 Enter the Details in Configuration Tab
7. Drag a Write File activity into the design panel and place it to the right of the CreateTestFile activity (before the End activity).
8. Figure 68 Activity Icons
9.
13. Choose Project > Save from the menu.The goal in this exercise is to create a file that has the name Filechange_type.txt, where change_type is the type of change that occurred to the original file (create, modify, or remove). The content of the changed file is then written to the new file, and the time the change in the file occurred is appended to the end of the contents. For example, if the text in the changed file is The cherry blossoms are beautiful. the content of the new file will be The cherry blossoms are beautiful. 1017163931036.
1. Figure 69 Mapping Data Flow between Activities
3. Click the plus (+) sign next to the process variable $TestFilePoller in the Process Data panel and expand the schema tree containing the output of the TestFilePoller process starter.
4. In the right panel, expand the tree and select the fileName field in the Activity Input pane, and then click theicon.
a. Select the Functions tab, expand the String folder, select concat, and drag it into the XPath Formula panel.
b.
c. In the left panel, select the Data tab, choose the $TestFilePoller/EventSourceOutputTextClass/action item and drag it over << string2 >>. A red box appears over << string2 >> indicating you can release the data over this item and the correct XPath expression will appear.
d. Add a comma after $TestFilePoller/EventSourceOutputTextClass/action, and then add the string ".txt" (include the quotes).$TestFilePoller/EventSourceOutputTextClass/action, ".txt")
6. Click the Apply button to accept the formula, and then click Close. Click the Apply button in the configuration panel of the activity.
7.
a. Select $CreateTestFile/CreateActivityOutputClass/fileInfo/
fullName and drag it to the fileName item in the Activity Input pane.You do not need to use the XPath Formula Builder to map this item because you do not need to use XPath functions. The content of the field is exactly the same as the value of the $CreateTestFile/CreateActivityOutputClass/fileInfo/fullName process variable.
b.
d. Add " ", between <<string1>>, and <<string2>> so that there is a space between the two strings in the concat function.
e. Click the Data tab and drag $TestFilePoller/
EventSourceOutputTextClass/fileContent/textContent over << string1 >>.
f. concat($TestFilePoller/EventSourceOutputTextClass/fileContent/textContent," ",$TestFilePoller/
g.
9. Click the Apply button on the activity’s configuration panel, and then choose Project > Save to save your project.
![]() |
Copyright © TIBCO Software Inc. All Rights Reserved |