|
| Copyright © Cloud Software Group, Inc. All Rights Reserved |
The Parse Data activity takes a text string or input from a file and processes it, turning it into a schema tree based on the specified Data Format shared configuration.
You can use any mechanism to obtain or create a text string for processing. For example, you can use the Read File activity to obtain text from a file, or you can retrieve a text field from an adapter message. You can also specify a text file to read using this activity.You might use this activity in a number of situations. For example, you may have a file that consists of multiple lines of comma-separated values (as in data obtained from a spreadsheet). You may also want to insert that data into a database table. To do this, read and parse the file into a data schema with the Parse Data activity. Then use a JDBC Update activity to insert the data schema into a database table.
The Data Format shared configuration to use when parsing the text input. See Data Format for more information. Input can either be a text string or a file. If the input is a text string, supply the string to the textString input item. If the input is a file, supply the file name and location to the fileName input item. This is useful if you have a large number of records and you want to read the input in parts (to minimize memory usage). Checking this check box causes the startRecord input item to appear. See Parsing a Large Number of Records for more information on how to read the input stream in parts. If an error occurs, the error information is separated from the output of the successfully parsed records and is provided in the output schema of the activity. See Output for more information on how the error information for the records that failed parsing is provided.See TIBCO ActiveMatrix BusinessWorks Process Design for more information about mapping and transforming input data.
The schema specified by the Data Format resource is contained in this output item. During parsing, if any of the Required data items are missing, the records are displayed in the Error Row. If there are missing Optional items, the records are displayed in the Output Row. true if no more records are available for parsing. false if there are more records available.When the ID field is declared Optional, and is missing, it is not an error. The records appear in the output string :The Error Output tab lists the possible exceptions that can be thrown by this activity. See TIBCO ActiveMatrix BusinessWorks Error Codes for more information about error codes and corrective action to take.
3. Select the Parse Data activity and click the group icon on the tool bar to create a group containing the Parse Data activity. See TIBCO ActiveMatrix BusinessWorks Process Design for more information about working with groups.
4.
5. The loop should exit when the EOF output item for the Parse Data activity is set to true. For example, the condition for the loop could be set to the following: string($ParseData/Output/done) = string(true())
6. Set the noOfRecords input item for the Parse Data activity to the number of records you want to process for each execution of the loop.
7. If you do not check the Manually Specify Start Record field on the Configuration tab of the Parse Data activity, the loop processes the specified noOfRecords with each iteration until there are no more input records to parse.You can optionally check the Manually Specify Start Record field to specify the startRecord on the Input tab. If you do this, you must create an XPath expression to properly specify the starting record to read with each iteration of the loop. For example, the count of records in the input starts at zero, so the startRecord input item could be set to the current value of the loop index minus one. For example, $i - 1.
|
| Copyright © Cloud Software Group, Inc. All Rights Reserved |