XMLSplitter Activity

The XMLSplitter 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 ActiveMatrix BusinessWorks process.

For more information on how the XMLSplitter activity splits the large XML, refer to XML Split Elements.

General Tab

The General tab has the following fields.

Field Literal Value/ Module Property/ Process Property? Description
Name No The name to be displayed in the process definition
Description No A short description of the activity
Input XML Source(Mandatory) No The format of the input XML:
  • file name
  • input stream
  • output stream
Fragment Criteria(Mandatory) No The criteria used for fragmenting:
  • size of fragment - split size in bytes
  • number of records
Fragment Criteria Value

(Optional)

Yes The value of Fragment Criteria.

Note: You can also specify the fragment criteria value on the Input tab. The fragment criteria value specified on the Input tab overrides the fragment criteria value specified on the General tab.

Fragment Element Name No The name of the XML element used for splitting the input XML document into fragments. If the elementName is specified on the Input tab, it takes preference over the Fragment Element Name, specified on the General tab.

If you want to consider the parent elements during fragmenting, specify the child element name.

For example: child_element

For more information on how the XMLSplitter activity fragments the large XML, refer to XML Split Elements.

Fragment Element Level No This field denotes whether the fragment elements are at the same level or at different levels. This field is available only when the Fragment Element Name has a relative path, without slashes.

You need to select Same level, if the fragment elements are all at the same hierarchical level. If they are at different levels, you need to select Different Level.

Create Non-Existing Directories (Optional)

No

When this check box is selected, the activity creates all directories in the specified path, if they do not already exist.

If this check box is not selected and one or more directories in the specified path do not exist, it throws an exception.

Note: If you open your project in a version earlier than ActiveMatrix BusinessWorks Plug-in for Large XML 6.1.3, you need to provide a relative path in Fragment Element Name to use the Fragment Element Level field.

Input Tab

The input for the activity is the following.

Input Item Datatype Description
fileName String Complete path of the XML file to split.

It is available only when File is selected as the Input XML Source on the General tab.

inputStream ObjectReference Object reference of the Input Stream or Output Stream mapped from the output of FileToStream or GetFragment activity.

It is available only when Input Stream is selected as the Input XML Source on the General tab.

outputStream ObjectReference The Output stream ObjectReference mapped from the GetFragment activity.

It is available only when Output Stream is selected as the Input XML source on the General tab.

elementName String The name of the XML element used for splitting the input XML document into fragments. If the elementName is specified on the Input tab, it takes preference over the Fragment Element Name, specified on the General tab.

If you want to consider the parent elements during fragmenting, specify the child element name.

For example: child_element

For more information on how the XMLSplitter activity fragments the large XML, refer to XML Split Elements.

fragmentSize Integer Maximum size of the fragment (in bytes) to be used for fragmenting
fragmentPrependName String

Prefix to be added to the file name when creating the fragment name.

If fragmentPrependName is not set, the default fragment name used is "XMLFragment-".

If fragmentPrependName is set, the fragment name is created as fragmentPrependName+numberoffragment+". xml". For example, splitterOutput-1.xml, splitterOuput-2.xml, splitterOuput-3.xml, and so on.

noOfRecords Integer Maximum number of records to be used for fragmenting
fragmentStoreLocation String Location where the split files are to be stored

Output Tab

The output of the activity is the following.

Output Item Datatype Description
totalFragments Integer Total number of fragments created
fragmentStoreLocation String Location where the split files are stored

Fault Tab

The Fault tab lists the possible exceptions that can be thrown by this activity. See TIBCO ActiveMatrix BusinessWorks Error Codes for more information about the error codes and corrective actions to take.

Exception Thrown When...
XMLSplitterException This is a Generic Splitter Activity Exception. This Exception provides errors related to fragment processing.
FileNotFoundException Cannot find the file provided in the fileName parameter.
FragmentCriteriaException This exception provides errors related to fragment criteria.

The excessSplitElement in FragmentCriteriaException holds the excess split element in binary form. You can handle these errors to process the excess split elements separately.