|
| Copyright © Cloud Software Group, Inc. All Rights Reserved |
This section guides you through creating a simple process definition. The process, which will be named FileTest, polls a directory for a specified file and writes a new file to the same directory each time the file changes. The new file’s name includes the type of change that occurred to the original file (create, modify, or remove). The new file’s content is the same as the polled file’s content, but the time of the change in the file is appended to the end of the file. The time of the file change is represented as the number of milliseconds since January 1, 1970.
Before you start to design the process, create a directory. Then create text file with some simple content (for example, "The cherry blossoms are beautiful.") in the directory. The file will be needed by the File Poller activity. This example uses the directory c:\tibco\test and the file PolledFileTest.txt.
1. In TIBCO Designer, select the project name (e.g. tutorial) in the project panel.If no palettes are in the palette panel, click the Switch Palette Modeicon to display the palettes.
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.For introductory information about processes, see TIBCO BusinessWorks Concepts. For detailed information about processes, see the TIBCO ActiveMatrix BusinessWorks Process Design Guide.
If the File palette is not one of the available palettes, choose Palettes > Activities > File to make the palette available.
3.
a. Name the File Poller TestFilePoller.
b. Click the Browse button to the right of the File Name field and select the file you want to poll. Use the Select File dialog to locate the directory and file you created.
d. Click the Apply button.
6.
8.
11. Choose Project > Save from the menu.The goal in this exercise is to create a file that has the name File<changeType>.txt, where <changeType> is the type of change that occurred to the original file (create, modify, or remove). The contents 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"The display in the right panel changes to display a concat XPath expression.
b.
c. In the left panel, select the Data tab, choose the $TestFilePoller/EventSourceOutputTextClass/action element 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, then add the string ".txt" (include the quotes).$TestFilePoller/EventSourceOutputTextClass/action, ".txt")
6. Click the Apply button to accept the formula and dismiss the XPath Formula Builder by clicking Close. Then click the Apply button in the Input tab of the activity.
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>>.concat($TestFilePoller/EventSourceOutputTextClass/fileContent/textContent," ",$TestFilePoller/
g. Click the Apply button to accept the formula and dismiss the XPath Formula Builder by clicking Close.
9. Click the Apply button on the activity’s Input tab, then choose Project > Save to save your project.
|
| Copyright © Cloud Software Group, Inc. All Rights Reserved |