The Import service automatically imports Sterling B2B Integrator resources exported by using the Resource Manager.
The following table provides an overview of the Import service:
|Graphical Process Modeler (GPM) category||All Services|
|Description||This service is used in a business process to automatically
import Sterling B2B Integrator resources
exported using the Resource Manager, including:
|Business usage||In a hub and spoke relationship, a hub company could use this service to programatically update information on their trading partners' systems.|
|Usage example||A hub needs to update its trading partner information with all of its spokes. At the same time, it plans on rolling out new XML schemas and translation maps. The hub creates an installable bundle interactively by means of the resource manager. The bundle is sent to the trading partners affected. The bundle is picked up by the trading partners and processed by a business process set-up as the updates from trading partner hub x. This process includes the Import service. The service checks the security context and, assuming it is correct, opens the bundle and updates the local system with the updates automatically.|
|Requires third-party files?||No|
|Platform availability||All supported application platforms|
|Related services||This service is designed to work in conjunction with a transport type service. The transport service brings the resources into the local system.|
|Application requirements||Before using this service, a security context for the installable resource bundle must have been created using the Security Context utility.|
|Initiates business processes?||No|
|Business process context considerations||The Import service configuration may contain context and identity values for a security context, which are used during the business process execution to fetch the passphrase for verification if the file being imported contains encrypted data. If the passphrase is required but the values are not for the correct passphrase or no security context information is available (either the values from the service configuration or the passphrase value stored for each configuration in the Sterling B2B Integrator database), the Import service will fail.|
|Returned status values||Returned status values:
|Testing considerations||Export a set of resources from Sterling B2B Integrator to a file called Export.xml. Import these resources in to another Sterling B2B Integrator server. Check the status report. There must not be any errors and it should be possible to test the imported resources.|
How the Import Service Works
The Import service exercises the same functionality as the Import Resources option in the Resource Manager, with one exception—the service has no user interaction, so the service does not ask for confirmation of options. When using the Import service, all available resources are imported, and all imported versions are set as the defaults, where applicable.
You create a security context for an installable bundle, which can prevent unauthorized users from creating or updating resources.
The Import service works with the Security Context utility in the application. The utility is called securityContext.sh (for Unix) or securityContext.cmd (for Windows). It is located in the bin directory of your Sterling B2B Integrator installation.
- A developer at company A exports a resource bundle to be sent to company B, where the bundle will be imported. If required for the type of resource to be exported, the developer creates a passphrase for the resource bundle as a part of the export process.
- After the export is complete, the developer sends the resource bundle to the company B system administrator, and also informs the system administrator of the passphrase.
- The system administrator at company B uses the Security Context utility to enter the passphrase into the Sterling B2B Integrator database and to create a security context.
- The system administrator passes the resource bundle and the name of the security context to a developer.
- The developer configures the Import service in the GPM, using the context and identity values from the security context that the system administrator provided.
For more information about creating a security context, see Using the Security Context Utility.
Implementing the Import Service
- After receiving a resource bundle from a trading partner, create a security context for it. For information, see Using the Security Context Utility.
- Create an Import service configuration. See Managing Services and Adapters.
- Configure the Import service.
- Use the Import service in a business process.
Configuring the Import Service Configuration
To configure the Import service, you must specify settings for the following fields in Sterling B2B Integrator:
|Backup||Identifies the path where the backup is saved. If the path is invalid during backup, the file is written to <install>/tmp and a message is added to the Import Report indicating the location. If the parameter is not specified, then the backup is not generated.|
|Config||Name of the service configuration.|
|Context||The company from which the resource files are obtained. Required if the file to be imported contains encrypted data; otherwise, optional. Example: Company_x|
|Identity||An ID to identify various passphrases received on various dates from the same company. Required if the file to be imported contains encrypted data; otherwise, optional. Example: 10Jan2004|
|KeepExistingControlNumbers||Specifies whether the control numbers in the import file will be imported. The default for this parameter is No, which specifies that the control numbers in the import file will be imported. If you change this parameter to Yes, it specifies that for existing envelopes and control numbers, control number values in the import file will not be imported. If a version of an envelope or control number being imported already exists in the system, the import process will overwrite the value specified in the import file with the existing control number value for that envelope or control number.|
Output from Business Process to Service
The following table describes the output from the business process to the Import service:
|Filename||The name of the resource file, including full path information. Valid value is any valid path and filename.|
Using the Security Context Utility
There are three actions you can perform with the security context command: list, get, and set. The security context command file is located in the bin directory of your Sterling B2B Integrator installation.
|list||Lists all security contexts available.||UNIX: install_dir/bin>securityContext.sh
Windows: installdir\bin>securityContext.cmd list_context
|set||Updates the database in Sterling B2B Integrator with the
new context. Takes three parameters:
set context identity passphrase
Windows: install_dir\bin>securityContext.cmd set context identity passphrase
Returns the following message: Context saved.
|get||Returns the passphrase value for the context. Takes two parameters: context and identity.||UNIX: install_dir//bin>securityContext.sh
get context identity
get context identity
Returns the following values: context, identity, password
In the following example, the Kimata company's system administrator, Jill, creates a security context called MaxxMart for an exported resource bundle just received from their trading partner, MaxxMart. Jill sets the identity for this context to dec19 (date it was received from the trading partner). MaxxMart also sent Jill the passphrase that they created for the resource bundle: bubblegum.
install_dir\bin>securityContext.sh set MaxxMart dec19 bubblegum
In the second example, Jill wants to find out what security contexts are on her Sterling B2B Integrator system, and uses the list_context action to find out. There are three contexts on the system: MaxxMart, Taylor, and Zapf.
install_dir\bin>securityContext.sh list_context Contexts: MaxxMart,Taylor,Zapf
In the third example, Jill wants to know what the passphrase is for the security context named Taylor that has an identity of jan20. She uses the get action and finds that the passphrase is thunder.
install_dir\bin>securityContext.sh get Taylor jan20 Taylor,jan20,thunder
Business Process Example 1
The following example illustrates using the Import service in a business process to import a resource file called dec19 from Company_x:
<process name="ImportService"> <sequence> <operation> <participant name="ImportService"/> <output message="Xout"> <assign to="Context">company_x</assign> <assign to="Identity">dec19</assign> <assign to="." from="*"></assign> </output> <input message="Xin"> <assign to="." from="*"></assign> </input> </operation> </sequence> </process>
Business Process Example 2
The following example illustrates using the Import service in a business process to import a resource file called april1 from RomansFloorsAndMore, using the Keep Existing Control Numbers option (specifying that for existing envelopes and control numbers, control number values in the import file will not be imported, and i)f a version of an envelope or control number being imported already exists in the system, the import process will overwrite the value specified in the import file with the existing control number value for that envelope or control number:
<process name="ImportServiceWithKeepExistingControlNumbers"> <sequence> <operation> <participant name="ImportService"/> <output message="Xout"> <assign to="Context">RomansFloorsAndMore</assign> <assign to="Identity">april1</assign> <assign to="KeepExistingControlNumbers">True</assign> <assign to="." from="*"></assign> </output> <input message="Xin"> <assign to="." from="*"></assign> </input> </operation> </sequence> </process>
Viewing the Import Service Status Report
Once you have imported resources using the Import service in a business process, it is a good idea to check that all resources were imported successfully. Also, you may need to use the report for troubleshooting if the service and business process fail. You can view the status report from the Business Process Detail page.
- From the Business Process menu, select Monitor > Current Processes. Current business processes are displayed in a list.
- Click the Instance ID next to the desired business process. The Business Process Detail page for that business process displays.
- In the Status Report column, click the Info icon for the Import service. The report is opened in another window. The status of each resource that the service attempted to import is shown, which enables you to verify whether each was successfully imported or not.
- Invalid passphrase (the passphrase in the database doesn't match the passphrase in the resource bundle).
- No passphrase in situation where passphrase is required (possibly there was no security context created for this resource bundle).
- Either the context or identity value in the Import service configuration used in the business process is wrong or was left blank.
The following is a sample status report for an import bundle. There is one error for a resource that could not be imported (transport account password):
Name: UpdateTPInfo Instance ID:1053 Service Name: Import Service Status report on 2004-03-12 14:45:19.16 for service: Import Packaging :: packaging_1079119091618 :: update :: SUCCESS :: Resource successfully imported. Identity :: MaxxMart :: update :: SUCCESS :: Resource successfully imported. Transport :: HTTP Transport :: create :: Message :: Error decrypting transport account password...value will be stored as it was in import file. Transport :: HTTP Transport :: update :: SUCCESS :: Resource successfully imported. Document Exchange :: MaxxMart Doc Exchange :: update :: SUCCESS :: Resource successfully imported. Delivery Channel :: ABCD :: update :: SUCCESS :: Resource successfully imported. Profile :: MaxxMart1 :: update :: SUCCESS :: Resource successfully imported. End of report ImportService stayed in queue 7 ms