Sample of XMLSplitter Activity

This sample highlights the use of XMLSplitter activity. It accepts input XML file as file name. It splits the XML file according to the Fragment criteria, that is, Size of Fragment. This activity writes all the fragments to the disk and at the output, it provides the total number of fragments generated and the fragment store location path where fragments are written to the disk. The file names used in this sample are specified in module property.

Prerequisites

Before executing the project, set the module property LargeXML_Root to the location of the plug-in samples folder. For example, if the plug-in samples are available in $TIBCO_HOME/bw/palettes/lx/<version>/samples, set LargeXML_Root to $TIBCO_HOME/bw/palettes/lx/<version>/samples. The rest of the input and output paths are configured using this module property.

Procedure

  1. In the samples directory, select <TIBCO HOME> bw > palettes > lx > <version> > samples and double-click tibco.bw.sample.palette.bwlx.LargeXMLPluginSample.
  2. In Project Explorer, expand the tibco.bw.sample.palette.bwlx.LargeXMLPluginSample project.
  3. Set the default ApplicationProfile to match your operating system.
  4. Fully expand the Processes directory and double-click XMLSplitter.bwp. In Module Descriptors > Components, you can see XMLSplitter.bwp.
  5. Click Run > Debug Configurations.
  6. In the left tree of the Debug Configuration wizard, expand BusinessWorks Application and select BWApplication.
  7. Click the Applications tab and then click Deselect All if you have multiple applications. Select the check box next to tibco.bw.sample.palette.bwlx.LargeXMLPluginSample.application.
  8. Click Debug. This runs the sample in the Debug mode.
  9. Click the Terminate icon to stop the process.

Result

  • The number of split files created as per Fragment Criteria in $TIBCO_HOME/bw/palettes/lx/<version>/samples/LargeXML/data/output/.

Understanding the Configuration

The following activity is used in this sample:

  • XMLSplitter: The activity splits a large XML file into multiple fragments depending on the specified fragment criteria and outputs it to the configured location without allowing any processing of fragments in the Active Matrix BusinessWorks process.