Compression Service
The Compression service is used within a business process to compress or decompress of a document.
The following table provides an overview of the Compression service:
System name | CompressionService |
---|---|
Graphical Process Modeler (GPM) category | All Services |
Description | Provides the ability to compress (deflate) a document
or group of documents in the business process context. It also provides
the ability to decompress (inflate) a document. The following options
are available with the Compression service:
|
Business usage | Used within a business process to perform compression or decompression of a document. |
Usage example | If you have a .zip file in the primary document, you can use this service to decompress the file and start a business process for each document found. |
Preconfigured? | Yes |
Requires third party files? | No |
Platform availability | All supported Sterling B2B Integrator platforms |
Related services | No |
Application requirements | No |
Initiates business processes? | If decompressing files, and Decompress_result is set to Start_bpml, child business processes are started for each document in compressed file. |
Invocation | Runs as part of a business process. |
Business process context considerations | This service uses the primary document and can also compress other documents in the business process context. |
Returned status values | Returned status values:
|
Restrictions | When decompressing, if you choose to put a specific document in the primary document area, but fail to specify a filename when multiple files exist in the compressed input file, Sterling B2B Integrator selects the first of the files present, as determined by the compression utility that produced the compressed file. |
How the Compression Service Works
- Compression
- Decompression
The Compression option is used to deflate files, and it enables you to define the level of compression used. You can also use the Compression option to store files without compressing them.
The Decompression option inflates a compressed file, then enables you to use the resulting decompressed files in business processes. The Decompression option can be configured to start a business process for each file, or it can put a specified document in the primary document. For example, if the primary document in a business process contained a .zip file, you could use the Compression service to decompress the file and start a business process for each document contained in the .zip file.
If the compression or decompression completed without error, a Done message is written to the status report. If it was unsuccessful, an error message is written to the status report.
The following figure shows the basic flows for compression and decompression:
Business Process Example
- The File System adapter collects one document.
- The business process moves the document to the business process context.
- The File System adapter collects a second document.
- The Compression service deflates both documents.
<process name="Comp_Deflate_lvl0">
<sequence>
<operation name="FileSystem">
<participant name="FileSystem"/>
<output message="outputMessage">
<assign to="Action">FS_COLLECT</assign>
<assign to ="collectionFolder">/input</assign>
<assign to ="filter">Excel.xls</assign>
<assign to ="useSubFolders">false</assign>
<assign to ="bootstrap">false</assign>
<assign to ="deleteAfterCollect">false</assign>
<assign to ="extractionFolder">//dummy</assign>
<assign to="." from="*"></assign>
</output>
<input message="inputMessage">
<assign to="." from="*"></assign>
</input>
</operation>
<assign to="ExcelDoc/@SCIObjectID" from="string(//PrimaryDocument/@SCIObjectID)"
append="true"/>
<operation name="FileSystem">
<participant name="FileSystem"/>
<output message="outputMessage">
<assign to="Action">FS_COLLECT</assign>
<assign to ="collectionFolder">/input</assign>
<assign to ="filter">Text.txt</assign>
<assign to ="bootstrap">false</assign>
<assign to ="deleteAfterCollect">false</assign>
<assign to ="useSubFolders">false</assign>
<assign to ="extractionFolder">//dummy</assign>
<assign to="." from="*"></assign>
</output>
<input message="inputMessage">
<assign to="." from="*"></assign>
</input>
</operation>
<operation name="Compress">
<participant name="CompressionService"/>
<output message="outputMessage">
<assign to="." from="*"></assign>
<assign to ="compression_action">compress</assign>
<assign to ="compressed_filename">DeflatedFile.zip</assign>
<assign to ="compression_level">0</assign>
<assign to ="compression_type">Deflate</assign>
</output>
<input message="inputMessage">
<assign to="." from="*"></assign>
</input>
</operation>
</sequence>
</process>
Implementing the Compression Service
- Configure the pre-installed copy of the Compression service, or create a new configuration. For information, see Configuring the Compression Service.
- Use the Compression service in a business process.
Configuring the Compression Service
To configure the Compression service, you must specify settings for the following fields in the GPM:
Field | Description |
---|---|
Config | Name of the service configuration. Required. |
bpml_name | Name of the business process to start. Required if you selected Start_bpml for Decompress_result field. Valid value is a string. Decompression parameter only. |
compressed_filename | What to name the compressed file. Valid value is a string: file name with extension. Default is CompressedFile<date/timestamp>.zip. Date/Timestamp is in the format CCYYMMDDHHMMSSMMS. Compression parameter only. |
compression_action | Whether to compress or decompress documents. Valid values are Compress and Decompress. |
compression_level | Level of compression. Valid values are 0 - 9 (default is 0). Compression
parameter only. This value represents a sliding scale of likely resulting compression-level vs. speed of encoding. Value ranges from 0 (do not attempt compression, just store uncompressed) to 9, representing the maximum capability of the service. |
compression_type | Compression method. Valid values are Deflate and Store (default is Deflate). Compression parameter only. |
decompress_result | What to do with decompressed files. Valid values are Start a business process and Put a specific document in the primary document. Decompression parameter only. Required. |
doc_to_compress | Whether to compress all docs or just the primary doc. Valid values are All and Primary Doc (default is All). Compression parameter only. |
file_name | Name of file to put in primary document. Valid value is a string: name of file
with extension. Defaults to first document in the list. Decompression, primary_doc parameter only.
Note: When decompressing: if you choose to put a specific document in the primary document area, but
fail to specify a filename when multiple files exist in the compressed input file, Sterling B2B Integrator will select the first of the
files present, as determined by the compression utility that produced the compressed
file.
|