![]() |
Copyright © TIBCO Software Inc. All Rights Reserved |
This section guides you through creating a simple process definition using TIBCO Designer Add-in for TIBCO Business Studio. The process, which is named TestFileOperations, polls a directory for a specified file and writes a new file to a specified result 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 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. 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 for the test data. Then create a text file with some simple content (for example, "Roses are red and violets are blue.") in the directory. This file will be needed by the File Poller activity. This example uses the directory C:\TEMP\testdata and the file PolledFileTest.txt. The result directory is specified in a global variable and can be modified before running the process.
1. Open the TIBCO Designer project created in the previous section (for example tutorial) in the TIBCO Designer perspective. You can do so in the following ways:If no palettes are displayed in the palette view, select the menu Designer >Palettes > Options > Switch Palette Mode to display the palettes.
3. From the palette view, drag and drop a Process Definition resource into the DABS Main view. You can also add a resource using the Right-click > Add Resource menu in the DABS Main view.
4. In the DABS Main view, type the name TestFileOperations in the Name field to rename the process. Then click Apply.
5.
1. To open the Global Variables view, select Window > Show View > Global Variables in the menu bar.
3. Click theicon to add a global variable. Edit the newly added global variable’s name and value. (for example, the global variable name is set to ResultFileDirectory and value is C:\TEMP\testresult)
4. Click OK to save and close the Global Variables editor.
1. Double-click the TestFileOperations process in the Project Explorer to open the process in the DABS Main view.
If the File palette is not one of the available palettes, choose Designer > Palettes > Activities > File to make the palette available.
a. Name the File Poller CheckFile.
b. Click Browse 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. (for example, C:\TEMP\testdata\FilePollerTest.txt)
c. Accept default values for the Polling Interval, Include Existing Files, and Exclude File Content fields. The Content as field is set to text by default. Select the appropriate encoding for your operating system in the Encoding field.
d. Click Apply.
6.
7.
9. Choose File > Save from the menu.
1.
c. Add "\TestResult-" between <<string1>> and <<string2>> and ".txt" after <<string2>> so that the new file is created in the specified directory, with name TestResult-action.txt.
d.
e.
f.
g. Select the textContent field in the Activity Input pane and click the XPath Formula Builder icon.
i. Add " ", between <<string1>> and <<string2>> so that there is a space between the two strings in the concat function.
j.
k. concat($CheckFile/EventSourceOutputTextClass/fileContent/textContent," ",$CheckFile/EventSourceOutputTextClass/
l.
4.
![]() |
Copyright © TIBCO Software Inc. All Rights Reserved |