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.

  • Self-service APIs are not available in this release.

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.

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 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

host

Used for design-time data.

   

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

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 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

Exports the entire repository (without policy details) if no other options are specified.

ant -f ant-b2b-util.xml b2bexport

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 "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 fro 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 Deploying Agreements

Validates and deploys all agreements in the repository. If an agreement is deployed, then it is deployed again. The older version of the agreement is then in an inactive state. This feature is in preview mode for this release.

Note:

Validation can be turned off by enabling the property oracle.tip.b2b.deploy.validation=false in b2b-config.xml, which is found in
DOMAIN_HOME/config/soa-infra/configuration/

Turning off validation is useful when deploying large numbers of agreements, where you are certain that the data is valid. It requires a SOA Server restart.

ant -f ant-b2b-util.xml b2bdeploy

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

Options Description Domain Required

tpanames

One or more names of agreements to be deployed

Agreement names must be separated by a comma

No


Example 18-8 Deploys the Agreements Acme_GC_Agreement1 and GC_Acme_Agreement1

ant -f ant-b2b-util.xml b2bdeploy -Dtpanames="Acme_GC_Agreement1,GC_Acme_Agreement1"

18.6 Validating B2B Metadata

Validates B2B metadata, including agreements, trading partners, and documents. All agreements are validated if no options are specified. This feature is in preview mode for this release.

ant -f ant-b2b-util.xml b2bvalidate

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

Options Description Domain Required
args

File names of the trading partner, agreement, or document protocol

File names must be separated by a comma

Yes


Example 18-9 Validates All Agreements

ant -f ant-b2b-util.xml b2bvalidate

Example 18-10 Validates Agreement tpa_ID1234.xml

ant -f ant-b2b-util.xml b2bvalidate -Dargs="tpa_ID1234.xml"

Example 18-11 Validates Trading Partner tp_MyCompany.xml and Agreement tpa_ID1234.xml

ant -f ant-b2b-util.xml b2bvalidate -Dargs="tp_MyCompany.xml,tpa_ID1234.xml" 

18.7 CPP/CPA Templates

Creates a cpp_cpa.properties template file, which is used in the propfile option. This feature is in preview mode for this release.

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

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-12 Creates a Property File Template That Is Used in the propfile Option

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

18.8 CPP/CPA Import

Converts an ebXML standard cpa.xml file to an Oracle B2B metadata file, which must then be imported into Oracle B2B. This feature is in preview mode for this release.

ant -f ant-b2b-util.xml b2bcpaimport

propfile

Table 18-7 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-13 Converts CPA-Formatted XML to an Oracle B2B ZIP File

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

18.9 CPP/CPA Export

Converts an Oracle B2B metadata file (data exported from Oracle B2B) to an ebXML standard cpa.xml file (a CPA-ready configuration). This feature is in preview mode for this release.

ant -f ant-b2b-util.xml b2bcpaexport

Table 18-8 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-14 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.10 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