18 B2B Command-Line Tools

B2B command-line tools are available for a number of tasks.

Note:

Command-line tools are for administrator use only. No security or permission checks are performed to prevent the logged-in user from purging, importing, or exporting data.

This chapter contains the following topics:

18.1 Prerequisites for Running the Command-line Tools

Do the following before using the command-line tools:

  1. Set ORACLE_HOME to your Oracle Fusion Middleware installation directory and then set the following environment variables:

    • ANT_HOME - $ORACLE_HOME/.../modules/org.apache.ant_1.7.0
      
    • JAVA_HOME - $ORACLE_HOME/.../jdk160_11
      
  2. Create jndi.properties.

    cd $ORACLE_HOME/bin
    ant -f ant-b2b-util.xml b2bcreate-prop
    
  3. Edit the jndi.properties file to include the weblogic password.

18.2 Purging Data

Note:

Before purging data, exporting or archiving data is recommended.

No security or permission checks are performed to prevent the logged-in user from purging data.

The following utility purges both design-time and run-time data and resets the environment to the installation time.

ant -f ant-b2b-util.xml b2bpurge

Table 18-1 lists the options for this command-line utility.

Table 18-1 Options for ant -f ant-b2b-util.xml b2bpurge

Option Description Domain Required
mode

Specifies purging design-time or run-time data.

DT
RT

No

msgState

Deletes messages with the specified message state. Used for run-time data.

MSG_COMPLETE
MSG_ERROR
MSG_WAIT_TRANSMIT
MSG_WAIT_FA
MSG_WAIT_BATCH

No. If msgstate is present, then start and end must be used.

start

Deletes messages that are created on or after the specified date. Used for run-time data.

dd-MMM-yyyy

No

end

Deletes messages that are created on or before the specified date. Used for run-time data.

dd-MMM-yyyy

No

purgecontrolnumber

Deletes control numbers. Used for run-time data.

true

false (default)

No


Example 18-1 Removes Design-Time Data

ant -f ant-b2b-util.xml b2bpurge -Dmode=DT

Example 18-2 Purges Run-Time Data

ant -f ant-b2b-util.xml b2bpurge -Dmode=RT

Example 18-3 Purges Run-Time Data, Including Control Numbers

ant -f ant-b2b-util.xml b2bpurge -Dmode=RT -Dpurgecontrolnumber=true

Example 18-4 Purges Messages with the Specified State Between the Specified Dates

ant -f ant-b2b-util.xml b2bpurge -Dmode=RT -Dstart=01-FEB-2009 -Dend=10-FEB-2009 -Dmsgstate=MSG_COMPLETE

18.3 Importing Data

Note:

No security or permission checks are performed to prevent the logged-in user from importing data.

The following utility imports a configuration ZIP file to the repository. Basic validation is performed, but it is not a complete validation as with deployment validation. No data is overwritten unless you use the overwrite option.

ant -f ant-b2b-util.xml b2bimport -Dlocalfile=true -Dexportfile="/tmp/export.zip"

Table 18-2 lists the options for this command-line utility.

Table 18-2 Options for ant -f ant-b2b-util.xml b2bimport

Option Description Domain Required
exportfile

Location of the export (ZIP) file

-

Yes

overwrite

Overwrites the existing business elements. For example, an existing delivery channel with the same trading partner name as a delivery channel in the import file is replaced if this option is set to true.

true

false (default)

No

localfile

If the export file location exists on the server, then set this option to true to improve performance. The export file must be on the server on which B2B is running.

true

false (default)

No


18.4 Exporting Data

Note:

No security or permission checks are performed to prevent the logged-in user from exporting data.

The following utility exports the entire repository (without policy details) if no other options are specified.

ant -f ant-b2b-util.xml b2bexport

Table 18-3 lists the options for this command-line utility.

Table 18-3 Options for ant -f ant-b2b-util.xml b2bexport

Option Description Domain Required
exportfile

Location of the ZIP file where the exported data is stored

/tmp/export.zip (default)

No

tpname

The trading partner name to be exported

Name of the trading partner

No

tpanames

One or more agreement names to be exported. If one agreement is exported, then the ZIP file contains the folder /soa/b2b. If multiple agreements are exported, then the ZIP file contains an individual ZIP file for each of the agreements.

Agreement names must be separated by a comma

No

active

Exports agreements that have been deployed and are in active state.

true

false (default)

No

policies

Set to true to export the entire repository with user and role details, which is needed for the policy store. A warning is displayed to remind you to export the policy store also.

See Section 10.2, "What Is Copied When You Import or Export from the Import/Export Tab," for more information.

true

false (default)

No


Example 18-5 Exports the Trading Partner Acme to /tmp/Acme.zip

ant -f ant-b2b-util.xml b2bexport -Dtpname="Acme" -Dexportfile="/tmp/Acme.zip"

Example 18-6 Exports an Agreement from Design-Time with Listening Channel Details to /tmp/acmeGc.zip

ant -f ant-b2b-util.xml b2bexport -Dtpanames="Acme_GC_Agreement1" -Dexportfile="/tmp/AcmeGc.zip"

Listening channels are deactivated while exporting and must be reactivated after you import data.

Example 18-7 Exports Multiple Deployed and Active Agreements to /tmp/export.zip

ant -f ant-b2b-util.xml b2bexport -Dtpanames="Acme_GC_Agreement1, GC_Acme_Agreement1" -Dactive=true

No listening channels are exported.

18.5 CPP/CPA Templates

The following utility creates a cpp_cpa.properties template file, which is used in the propfile option.

ant -f ant-b2b-util.xml b2bcreate-cpaprop

Table 18-4 lists the options for this command-line utility.

Table 18-4 Options for ant -f ant-b2b-util.xml b2bcpaimport

Option Description Domain Required
propfile

Property file that stores configuration details for b2bcpaimport and b2bcpaexport

-

Yes


Example 18-8 Creates a Property File Template That Is Used in the propfile Option

ant -f ant-b2b-util.xml b2bcreate-cpaprop

18.5.1 Properties of cpp_cpa.properties

The following properties can be configured as part of the cpp_cpa properties file:

18.5.1.1 CPA Import Properties

The CPA import properties are as follows:

  •   oracle.tip.b2b.ebms.BPSSDocument (Optional Property)
    

    This property holds the absolute path for the BPSS document, which is used to get the BPSS document details to be imported into the Oracle B2B repository. If the property does not exist, then the values are imported from the CPA document. Multiple BPSS documents are separated by ; (semi-colon).

  •   oracle.tip.b2b.ebms.CPADocument (Required Property)
    

    This property is used to get the absolute path of the CPA document to be imported into the Oracle B2B repository.

  •           oracle.tip.b2b.ebms.xsdLocation (Optional Property)
    

    This property is used to specify the absolute path of the schema file location. This schema file is used for document validation. It is used only when a BPSS document is specified.

  •                   oracle.tip.b2b.ebms.internalDeliveryChannel.protocol    (Optional Property)
    

    The default internal delivery channel is an AQ queue. If you want to add a specific internal delivery channel (JMS/FTP/FILE/SFTP), then this property is used in Oracle B2B configuration. Specify all the required properties with respect to the specific transport protocol. Then use the specific channel to send messages to back-end applications.

18.5.1.2 CPA Export Properties

The CPA export properties are as follows:

  •   oracle.tip.b2b.ebms.OutputFolder (Required Property)
    

    This property is used to place the generated CPP/CPA files in the specified location.

  •   oracle.tip.b2b.ebms.Host (Required Property)
    

    This property is used to set the host trading partner.

  •           oracle.tip.b2b.ebms.HostEndPoint (Required Property)
    

    This property is used to set the host endpoint while generating the CPP/CPA export.

  •                   oracle.tip.b2b.ebms.HostCertificateAlias (Optional Property)
    

    For secure message transfer, this property is used to get the host certificate details to the CPP/CPA export.

  •                           oracle.tip.b2b.ebms.TPCertificateAlias (Optional Property)
    

    For secure message transfer, this property is used to get the trading partner certificate details to the CPP/CPA export.

  •                           oracle.tip.b2b.ebms.BPSSExport (Optional Property)
    

    This Boolean property is used to generate the BPSS document.

18.5.1.3 Common Properties

The common properties are as follows:

  •           oracle.tip.b2b.ebms.LogDirectory (Required Property)
    

    This property is used to store the log files.

  •   oracle.tip.b2b.ebms.LogLevel (Required Property)
    

    This property is used to specify the mode of the logs, such as DEBUG, INFO, or ERROR.

  •           oracle.tip.b2b.ebms.LogType (Required Property)
    

    This property is used to specify whether the log file is stored as text or XML.

18.6 CPP/CPA Import

The following utility converts an ebXML standard cpa.xml file to an Oracle B2B metadata file, which must then be imported into Oracle B2B.

ant -f ant-b2b-util.xml b2bcpaimport

Table 18-5 lists the options for this command-line utility.

Table 18-5 Options for ant -f ant-b2b-util.xml b2bcpaimport

Option Description Domain Required
propfile

Property file that stores configuration details for b2bcpaimport and b2bcpaexport

-

Yes


Example 18-9 Converts CPA-Formatted XML to an Oracle B2B ZIP File

ant -f ant-b2b-util.xml b2bcpaimport -Dpropfile="/tmp/cpp_cpa.properties"

18.7 CPP/CPA Export

The following utility converts an Oracle B2B metadata file (data exported from Oracle B2B) to an ebXML standard cpa.xml file (a CPA-ready configuration).

ant -f ant-b2b-util.xml b2bcpaexport

Table 18-6 lists the options for this command-line utility.

Table 18-6 Options for ant -f ant-b2b-util.xml b2bcpaimport

Option Description Domain Required
propfile

Property file that stores configuration details for b2bcpaimport and b2bcpaexport

-

Yes


Example 18-10 Converts an Oracle B2B ZIP File to a CPA-Formatted XML File

ant -f ant-b2b-util.xml b2bcpaexport -Dpropfile="/tmp/cpp_cpa.properties"

18.8 Errors During Import

If you get the following broken pipe error, use Oracle WebLogic Server Administration Console to increase Maximum Message Size to 200000000.

[java] Exception in thread "main" java.lang.Exception: java.rmi.UnmarshalException: Broken pipe;
nested exception is:
[java]  java.net.SocketException: Broken pipe
[java] at oracle.tip.b2b.utility.B2BCommandLineUtility.upgradeRepository(B2BCommandLineUtility.java:548)
[java]  at oracle.tip.b2b.utility.B2BCommandLineUtility.main(B2BCommandLineUtility.java:601)
[java] Caused by: java.rmi.UnmarshalException: Broken pipe; nested exception is:
[java] java.net.SocketException: Broken pipe