21 B2B Command-Line Tools

This chapter describes the B2B command-line tools that are available for a number of tasks such as archiving date, purging data, importing and exporting data, batching operations, deploying agreements, and so on.

This chapter includes the following sections:

21.1 Prerequisites for Running the Command-line Tools

There are several things you should do before you run the command-line tools.

  1. Set the ORACLE_HOME, ANT_HOME, and JAVA_HOME environment variables.

    ORACLE_HOME is set to your Oracle Fusion Middleware installation directory. For example:

    set ORACLE_HOME=C:\oracle\wls_home
    set ANT_HOME=%ORACLE_HOME%\modules\org.apache.ant_1.7.1 
    set JAVA_HOME=%ORACLE_HOME%\jdk160_18 
    
  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 correct values for each of the properties present in the file.

Note:

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

2. After running any command-line tool, you should re-log into the B2B Console. The B2B Console caches some metadata and any command-line action which may have updated the metadata could lead to invalid cached data. Therefore, it is advisable to always re-login into the B2B Console after using command-line operations.

3. In summary, if you are executing the B2B command utility and a user session is opened in the UI simultaneously, then it is advisable for the user to log out of the B2B UI and log back in again to see the candidate changes done by the command utility.

4. Most of the command-line tools cannot be run without providing the JNDI credentials. To restrict the command-line tools from anonymous use, provide the following information in the jndi.properties file:

java.naming.provider.url=t3://localhost:8001 
java.naming.factory.initial=weblogic.jndi.WLInitialContextFactory
java.naming.security.principal=weblogic
java.naming.security.credentials=weblogic_password
 

Note:

For any B2BCommandline utility, by default, the ANT run shows BUILD SUCCESSFUL and system code 0 (zero) is returned even in the case of client or server side error. In case you want the ANT run to FAIL for each client or server side error, then you need to set exitonerror parameter to true.

You can do this in either of the following two ways:

  • Specify -Dexitonerror=true on ANT command line

    ant -f ant-b2b-util.xml b2bpurge -Dagreement=<AGR_NAME> -Dmode=DT -Dexitonerror=true
    
  • Setting the exitonerror parameter as global setting:

    Create a properties file called ant_general.properties with the value exitonerror=true in the directory where ant-b2b-util.xml is present ($ORACLE_HOME/bin).

With this configuration, for all client or server errors, all ANT commands will fail with the message BUILD FAILED and the system exit code will be set to -1.

21.2 Archiving Data

Oracle B2B uses Oracle Data Pump as the archiving mechanism for Oracle B2B runtime instance data in Oracle database. Oracle B2B enables archiving functionality only when the Oracle B2B repository is Oracle database. You can configure start date, end date, and message state to archive and/or purge the runtime data.

In order to improve the performance and synchronize archive and purge activity, a new column (JOB_ID) is added in each runtime table - B2B_BUSINESS_MESSAGE, B2B_EXT_BUSINESS_MESSAGE, B2B_APP_MESSAGE, B2B_WIRE_MESSAGE and B2B_DATA_STORAGE.

Oracle B2B will mark the target runtime data (by start date, end date, and message state) with a unique JOB_ID. If you select to archive the runtime data, Oracle B2B will invoke Data Pump PL/SQL API with JOB_ID to export the runtime data. Oracle B2B will purge the runtime messages by JOB_ID if you also want to purge them.

After the runtime data is archived/exported, Oracle B2B can also use Oracle Data Pump to import the runtime data into an Oracle B2b repository.

Before archiving data, you must set up the permissions and the archival directory.

Note:

The b2b_archive utility only supports Oracle database. No other databases are supported.

To do initial setup:

  1. On the machine running the database, create a directory in which to dump the archive file. For example:

    mkdir /tmp/archive
    
  2. Grant permissions to this directory so that the database process can write to it.

    chmod 777 /tmp/archive
    
  3. Log in to the database as sysdba.

    sqlplus / as sysdba
    
  4. Set up the B2B_EXPORT_DIR.

    SQL> create or replace DIRECTORY B2B_EXPORT_DIR as '/tmp/archive'
    
  5. If your SOA schema user is b2b_soainfra, the user needs to be granted permission for the export.

    SQL> grant read, write on directory B2B_EXPORT_DIR to b2b_soainfra;
    SQL> grant exp_full_database  to b2b_soainfra;
    

Note:

Make sure that the initial setup steps detailed above are performed before attempting to archive.

To archive data:

  1. Log in as the soainfra schema user.

    $ sqlplus b2b_soainfra/password
    
  2. Execute the archive procedure. For example:

    SQL> exec B2B_ARCHIVE_INSTANCE_MSGS('2010/06/23 12:23:23','2010/06/24 12:46:24','MSG_COMPLETE',null,null,null,null,null,null,'myDump.dmp')
    

    The signature of the procedure is

    exec B2B_ARCHIVE_INSTANCE_MSGS(p_startDate,p_endDate,p_msgState,p_tpName,
    p_direction,p_msgType,p_tpaName,p_idType,p_idVal,filename);
    

    Table 21-1 lists the options for this utility.

Table 21-1 Options for B2B_ARCHIVE_INSTANCE_MGS Utility

Options Type Description

startDate

varchar2

Starting date for archival

endDate

varchar2

Ending date for archival

msgState

varchar2

State of the business message

tpName

varchar2

Trading Partner name

direction

varchar2

Message direction

msgType

varchar2

Message type

tpaName

varchar2

Trading Partner Agreement name

idType

varchar2

The sender ID_TYPE, or identifier type, which uniquely identifies a trading partner and defines how to exchange documents.

idVal

varchar2

The sender ID_VALUE, or identifier value. The value associated with the identifier type.

filename

varchar2

Name of the archive file to be created by the database. File names MUST be unique. Verify that a file with this name does not exist in that directory.

21.3 Purging Data

Before purging runtime data, you must set up the configuration properly. If not done properly, then the archive will fail with a misleading error.

Note:

The configuration setup isdescribed in Archiving Data.

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

The b2bpurge utility only supports Oracle database. No other databases are supported.

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

ant -f ant-b2b-util.xml b2bpurge

Table 21-2 lists the options for this utility.

Table 21-2 Options for b2bpurge Utility

Option Description Domain Required
mode

Specifies purging design-time or runtime data. (see Note below)

DT

RT

Yes

msgState

Deletes messages with the specified message state. Used for runtime 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.

purgecontrolnumber

Deletes control numbers. Used for runtime data. When set to true, all the runtime data is truncated from B2B tables. This option not available when data is deleted for a specific date range.

Archiving will only occur is this option is set to false.

true

false (default)

No

fromdate

Deletes all messages, which created on or after this date.

Date format

dd/mm/yyyy hh:mm AM/PM

No

todate

Deletes all messages, which created on or before this date.

Date format

dd/mm/yyyy hh:mm AM/PM

No

tp

Based on trading partner.

-

No

direction

Direction of the message

-

No

msgtype

Type of the message

-

No

agreement

Name of the agreement

-

No

idtype

The sender ID_TYPE, or identifier type, which uniquely identifies a trading partner and defines how to exchange documents.

-

No

idvalue

The sender ID_VALUE, the value associated with the identifier type.

-

No

archive

Should archive

-

Default value is true

commitfrequency

Specifies the number of records after which the database commit takes place

Value of the frequency; default is 5000

No

archivename

File name of archived file

-

No

partitioned

Indicates if the database is partitioned. Based on the value of this parameter, Oracle B2B allows you to purge data normally or based on database partitions.

true

false

No

partitioncleanmode

Specifies the mode of cleaning for a partition that is identified for cleanup.

In case of absence of partitions, or non-date parameters are provided, this parameter is ineffective.

Note: This parameter is effective only when the partitioned flag is set to true.

DROP: Indicates that the clean up mechanism is to drop the partition (Default).

TRUNCATE: Cleans up the partition by truncating it rather than deleting it.

STATEMENT: Statement mode does not clean up the tables, but only creates a drop statement and writes the statement to a file in the SOA_PURGE_DIR directory. In this mode, no change is made to the database.

No

logmode

Indicates the log level. There are two variations, CONSOLE_ * that uses the dbms_output mode of logging (applicable only when the procedure is invoked directly through a client) and the other modes that log to a file in a SOA_PURGE_DIR directory.

ERROR

INFO

DEBUG

CONSOLE_ERROR

CONSOLE_INFO

CONSOLE_DEBUG

No

refreshmw

Controls whether to completely refresh the b2b_system materialized view.

true (default; when any truncate or drop operation is performed)

false

No

rowlimit

Limits the number of records to be deleted; this is a nonimportation-specific feature

-

No

timelimit

Limits the time the purge job runs. The accuracy depends on commitfreq because the check is performed after each commit cycle; this is a nonpartition-specific feature

-

No

cascadedelete

Deletes all the artifacts related to a specific document ID or CPA ID.

true

false

No

Note:

When only -Dmode=RT -Dtp=trading_partner_name options are used, this option deletes all records matching Trading Partner name with SenderName or in Receiver Name.

Example 21-1 Removes Design-Time Data

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

Example 21-2 Purges Runtime Data

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

Example 21-3 Purges Runtime Data, Including Control Numbers

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

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

ant -f ant-b2b-util.xml b2bpurge -Dmode=RT -Dfromdate="05/10/2012 11:51 PM" -Dtodate="06/10/2012 12:01 AM" -Dmsgstate=MSG_COMPLETE -Darchive=false

Example 21-5 Cascade Deletes the Robot143 Trading Partner

ant -f ant-b2b-util.xml b2bpurge -Dtp=Robot143 -Dmode=DT -Dcascadedelete=true

This is useful when there is one document or CPA attached with the trading partner.

Example 21-6 Cascade Deletes the Robot131 to Robot139 Trading Partners

ant -f ant-b2b-util.xml b2bpurge -Dtp=Robot131,Robot132,Robot133,Robot134,Robot135,Robot136,Robot137,Robot138,Robot139 -Dmode=DT -Dcascadedelete=true

This is useful when there is one document or CPA attached with the trading partners.

Example 21-7 Cascade Deletes All the Artifacts of an AgreementID or CPA

ant -f ant-b2b-util.xml b2bpurge -Dtp=Robot142 -Dmode=DT -Dcascadedelete=true -Dagreementid=Openreach_Robot142_WholesaleProvider_ServiceProvider_R1800.0.5_cpa

This is useful when multiple documents or CPA are attached to a trading partner.

Note:

When using archivename the value must be a unique file name. An existing file name used with archivename throws an exception.

Note:

You can also perform document type based purge and archive of the instance data. To do this, first perform the prerequisite steps listed in Prerequisites for Running the Command-line Tools and the initial steps listed in Archiving Data.

Example:

ant -f ant-b2b-util.xml b2bpurge -Dmode=RT -Ddoctype="ORDERS_FILE" -Darchive=true -Darchivename="docType.dmp"

You can also execute this by using SQL.

Note:

When performing purging of data based on the trading partner name:

  • If the direction is specified, then direction is also considered for the purge.

  • If the direction is not specified, then purge happens in both direction (inbound and outbound).

  • If the hostname is provided as the value for -Dtp, an error message is displayed.

21.4 Importing Data

The b2bimport utility imports the B2B metadata 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.

Note:

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

The following usage imports data from tmp/export.zip to a location on the same server without overwriting.

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

Table 21-3 lists the options for this utility.

Table 21-3 Options for b2bimport Utility

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

21.5 Exporting Data

The b2bexport utility exports metadata from the Oracle B2B repository. If no options are specified then the entire repository is exported.

Note:

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

The following usage exports the entire repository (without policy details) to /tmp/export.zip if no other options are specified.

ant -f ant-b2b-util.xml b2bexport

Table 21-4 lists the options for this utility.

Table 21-4 Options for b2bexport Utility

Option Description Domain Required
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

tpname

The trading partner name to be exported

Name of the trading partner

No

exportfile

Location of the ZIP file where the exported data is stored

/tmp/export.zip (default)

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

localfile

Set to true for improved performance if the export file is on the same computer as Oracle B2B.

true

false (default)

No

Example 21-8 Export Entire Repository with Policy Details to /tmp/export.zip

ant -f ant-b2b-util.xml b2bexport -Dexportfile="/tmp/export.zip" -Dpolicies=true

Example 21-9 Export Entire Repository w/o Details to /tmp/exportinserver.zip on Same Server

ant -f ant-b2b-util.xml b2bexport -Dexportfile="/tmp/exportinserver.zip" -Dlocalfile=true

Example 21-10 Exports the Trading Partner Acme to /tmp/Acme.zip

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

Example 21-11 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 21-12 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.

21.6 Batching Operations

The command line b2bbatch utility enables you to create batches, based on various criteria. This utility is a supplement to the available batch creation/deletion feature in the Oracle B2B Console for EDI documents. This is an ANT based command, and provides the flexibility to selectively set the criteria to create batches.

To create multiple trading partners and document versions in a single step, you must use the Oracle B2B Console; to achieve it on command-line you must run the batch creation utility multiple times. For advanced functionality, such as disabling or updating a batch you must use the Oracle B2B Console.

The usage is as follows:

ant -f ant-b2b-util.xml b2bbatch -Dtp=<tpName> -Dbatchtime=<batchTriggerTime> -Dbatchname=<batchName> -Ddocument=<documentProtocolName> 
-Ddocrevision=<docRevision> -Ddoctype=<docType> -Disrepetitive=<true|false> -Dbatchcount=<batchcount> -Dbatchfilesize=<batchfilesize>

Table 21-5 lists the options for this utility.

Table 21-5 Options for b2bbatch Utility

Option Description Domain Required

tp

Trading Partner name.

Specify the trading partner name.

Yes

To create a batch, the tp, batchtime, batchname, document, docrevision, doctype options are required, to delete a batch only the mode and batchname options are required.

batchcount

Batch count.

Specify a count for the batch to create a batch with batchcount.

Yes

To create a batch successfully, at least one of batchfilesize or batchcount or batchtime must exist. The unit for the parameter batchfilesize is in kilobytes, such as 200 = 200K bytes.

batchfilesize

Batch file size.

Specify a batch file size to create a batch using batch file size with value specified for XML size.

Yes

batchname

Batch name.

Specify a name for the batch.

Yes

batchtime

Batch trigger time.

The trigger time can be a cron String or the date in dd/MM/yyyy HH:mm AM/PM format.

See also Example 21-16.

Yes

document

Document Protocol name.

Example: EDI_EDIFACT, EDI_X12

Yes

docrevision

Document revision.

Example: 4010, D98A

Yes

doctype

Document type.

Example: 850, ORDERS

Yes

isrepetitive

To enable repetitive batching when batch created using cron string.

Valid values: true or false

No

mode

Mode

Set to deletebatch to delete the batch.

No

Note:

While creating a cron job for the command line operation, you need to follow the cron syntax.

Example 21-13 Create a Batch Operation

This command creates a batch operation with GlobalChips for the X12/4010/850 document which is executed in a repetitive mode for the given cron String.

ant -f ant-b2b-util.xml b2bbatch -Dtp=GlobalChips 
-Dbatchtime="0 4850 11 7 5 ? 2010" -Dbatchname=batch1234 -Ddocument=EDI_X12 
-Ddocrevision=4010 -Ddoctype=850 -Disrepetitive=true

Example 21-14 Creating Batches for Multiple Document Types

ant -f ant-b2b-util.xml b2bbatch -Dtp=GlobalChips 
-Dbatchtime="0 58 11 7 5 ? 2010" -Dbatchname=batch1234 -Ddocument=EDI_X12 
-Ddocrevision=4010 -Ddoctype=850,997

ant -f ant-b2b-util.xml b2bbatch -Dtp=GlobalChips 
-Dbatchtime="07/05/2010 11:45 AM" -Dbatchname=batch1234 -Ddocument=X12 
-Ddocrevision=4010 -Ddoctype=850,997

Example 21-15 Delete a Batch Operation

ant -f ant-b2b-util.xml b2bbatch -Dmode=deletebatch -Dbatchname=batch1234 

Example 21-16 Using Special Characters in batchtime Option

If the value for the batchtime contains special characters such as * or # then the character must be escaped using double quotation marks.

ant -f ant-b2b-util.xml b2bbatch -Dtp=GlobalChips 
-Dbatchtime='0 5,10,15,20,25,30,35,40,45,50,55,59 "*" "*" "*" ? 2010' 
-Dbatchname=batch1234 -Ddocument=EDI_X12 -Ddocrevision=4010 -Ddoctype="850,855" -Disrepetitive=true 

21.7 Resetting Channel Passwords

This utility sets or resets a channel password.

ant -f ant-b2b-util.xml resetchannelpassword

Table 21-6 lists the options for this utility.

Table 21-6 Options for resetchannelpassword Utility

Options Description Required

channelname

Name of the existing channel

Yes

tp

Name of the trading partner

Yes

password

Password to be set for the specified channel.

This is an optional parameter. If this parameter is not provided, the existing password (if any) of the channel is removed.

No

Note:

For listening channels, the modified password takes effect only after the listening channel is restarted. For delivery channels, the modified password takes effect only after deployment.

Example 21-17 Setting the Password for a Listening Channel

ant -f ant-b2b-util.xml resetchannelpassword -Dchannelname=AcmeInboundListening -Dtp=Acme  -Dpassword=welcome1

The preceding example sets welcome1 as the password for the AcmeInboundListening listening channel.

Example 21-18 Resetting the Password for a Listening Channel

ant -f ant-b2b-util.xml resetchannelpassword -Dchannelname=AcmeInboundListening -Dtp=Acme

The preceding example resets the password for the AcmeInboundListening listening channel.

21.8 Activating or Deactivating Listening Channels

This utility activates or deactivates a listening channel.

ant -f ant-b2b-util.xml updatechannel

Table 21-7 lists the options for this utility.

Table 21-7 Options for updatechannel Utility

Options Description Value Required

channelname

Name of the existing listening channel.

You can use the wildcard character * to specify all the listening channels in the system.

-

Yes

state

State of the listening channel. If you specify state=active, then the listening channel goes into an active state and is restarted. If the channel is not already started, then state=active starts the channel. If you specify state=inactive, then the listening channel goes into an inactive state and is stopped.

active / inactive

Yes

Example 21-19 Starting a Listening Channel

ant -f ant-b2b-util.xml updatechannel -Dchannelname="AcmeInboundListening" -Dstate=active

The preceding example starts the AcmeInboundListening channel.

Example 21-20 Starting All Listening Channels

ant -f ant-b2b-util.xml updatechannel -Dchannelname="*" -Dstate=active

21.9 Deploying Agreements

The b2bdeploy utility validates and deploys all agreements in the repository. If an agreement is already deployed, then it is deployed again. The older version of the agreement is then in an inactive state. 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. Validation can be turned off by setting the property b2b.deploy.validation to false.

To deploy all agreements in the repository, execute:

ant -f ant-b2b-util.xml b2bdeploy

Table 21-8 lists the options for this utility.

Table 21-8 Options for b2bdeploy Utility

Options Description Domain Required

tpanames

One or more names of agreements to be deployed

Agreement names must be separated by a comma

No

Example 21-21 Deploys the Agreements Acme_GC_Agreement1 and GC_Acme_Agreement1

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

21.10 Validating B2B Metadata

The b2bvalidate utility validates Oracle B2B metadata, including agreements, trading partners, and documents. All agreements are validated if no options are specified.

ant -f ant-b2b-util.xml b2bvalidate [-Dmdsreference="comma_separated_argumants"]

Table 21-9 lists the options for this utility.

Table 21-9 Options for b2bvalidate Utility

Options Description Domain Required
mdsreference

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

File names must be separated by a comma

No

agreementid

Validates agreements based on the IDs provided. It also throws warning message if any agreementID does not exist and validate the others.

Agreement IDs must be separated with commas.

No

Example 21-22 Validates All Agreements

ant -f ant-b2b-util.xml b2bvalidate

Example 21-23 Validates Agreement tpa_ID1234.xml

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

Example 21-24 Validates Trading Partner tp_MyCompany.xml and Agreement tpa_ID1234.xml

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

Example 21-25 Validates Agreements Having IDs as agreementID1 and agreementID2

ant -f ant-b2b-util.xml b2bvalidate -Dagreementid="agreementID1,agreementID2"

21.11 Using the ebXML CPP/CPA Utilities

The ebXML CPP/CPA utilities convert to and from a standard ebXML CPA file in the Oracle B2B metadata.

Note that the CPP/CPA Filename should follow below naming convention while passing through the command-line:

JavaLetterOrDigit | '-' | '.' | ' '

JavaLetterOrDigit returns true from the java.lang.Character.isJavaIdentifierPart method.

21.11.1 Creating CPP/CPA Properties Templates

The b2bcreate-cpaprop utility creates a property file template that can be customized and then used to supply parameters for the b2bcpaimport and b2bcpaexport utilities.

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

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

Table 21-10 lists the options for this utility.

Table 21-10 Options for b2bcreate-cpaprop Utility

Option Description Domain Required
propfile

Property file that stores configuration details for b2bcpaimport and b2bcpaexport

-

Yes

Example 21-26 Creates a Property File Template That Is Used in the propfile Option

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

21.11.1.1 Properties of cpp_cpa.properties

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

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

oracle.tip.b2b.ebms.allDocumentParameter (Optional Property)

This property is used to improve the import performance. Set this property to false to stop generating the unwanted or unset parameters in soa.zip.

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 import from the remote trading partner profile.

After using the b2bcpaimport utility to obtain the OracleB2B zip file, when you import the zip file into the Oracle B2B console:

  • Certificate alias will be available under Administration > Types

  • Certificate alias <value from b2bcpaimport profiles> will be available under Partners > Remote Trading Partner > Profile tab > Identifiers

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

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

21.11.2 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 21-11 lists the options for this utility.

Table 21-11 Options for b2bcpaimport Utility

Option Description Domain Required
propfile

Property file that stores configuration details for b2bcpaimport and b2bcpaexport

-

Yes

Example 21-27 Converts CPA-Formatted XML to an Oracle B2B ZIP File

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

21.11.3 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 21-12 lists the options for this utility.

Table 21-12 Options for b2bcpaimport Utility

Option Description Domain Required
propfile

Property file that stores configuration details for b2bcpaimport and b2bcpaexport

-

Yes

Example 21-28 Converts an Oracle B2B ZIP File to a CPA-Formatted XML File

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

21.12 Verifying Agreement Availability

The b2bcheckcpaid utility enables you to verify the availability of an agreement for a given CPAID and trading partner. Based on the result, you can import the agreement with the option overwrite it.

Table 21-13 lists the options for this utility.

Table 21-13 Options for b2bcheckcpaid Utility

Option Description Domain Required

args

Oracle B2B metadata file

file name

Yes

Example 21-29 b2bcheckcpaid Utility

ant -f ant-b2b-util.xml b2bcheckcpaid -Dargs="soa_file.zip"

21.13 Creating Oracle B2B Metadata Based on selfservice.xsd

This utility creates the selfservice.xsd file, which is used to understand or create selfservice XML based on the XSD structure.

ant -f ant-b2b-util.xml b2bselfservicexsd

The following utility creates Oracle B2B metadata from the XML file that is created based on selfservice.xsd.

ant -f ant-b2b-util.xml b2bselfservice

See Self Service Utility Protocols_ Identifications_ Security Specifications_ and Parameters for information about selfservice protocols, identifications, and security specifications.

Table 21-14 lists the options for these utilities.

Table 21-14 Options for b2bselfservice Utility

Option Description Domain Required

input

XML file absolute location

-

Yes

output

Location for Oracle B2B metadata stored as a ZIP file

-

No

Example 21-30 Converts b2bselfservicexsd-Generated XML to an Oracle B2B Metadata ZIP file (stored in /tmp/soa.zip)

ant -f ant-b2b-util.xml b2bselfservice -Dinput="/tmp/selfservice1.xml"

Example 21-31 Converts b2bselfservicexsd-Generated XML to an Oracle B2B Metadata ZIP file (stored in /tmp/as11b2b.zip)

ant -f ant-b2b-util.xml b2bselfservice -Dinput="/tmp/selfservice1.xml" -Doutput="/tmp/as11b2b.zip"

21.13.1 Using Selfservice to Batch Create Document Protocols, Trading Partners, and Agreements

When using a multiple file approach, you must make sure that the names of the selfservice XML files are in following order, otherwise, an error claiming that the referenced object does not exist might be thrown.

  1. Document Protocols selfservice XML files.

  2. Trading Partner selfservice XML files (HOST must be first in this list).

  3. Trading Partner Agreement selfservice XML files.

For example:

  1. doc_selfservice.xml to hold Document Protocols.

  2. tp_selfservice.xml to hold Trading Partner details.

  3. tpa_selfservice.xml to hold Agreements details.

Example 21-32 Converts Several b2bselfservicexsd-Generated XML Files Within a Folder to an Oracle B2B Metadata ZIP file (stored in /tmp/as11b2b.zip)

ant -f ant-b2b-util.xml b2bselfservice -Dinput="/folder" -Doutput="/tmp/as11b2b.zip"

21.13.2 Using Self Service Samples

Self service utility (b2bselfservice) XML samples are bundled along with its schemas and ECS files, which are together with the B2B metadata of B2B Samples configuration.

Self service samples are found in $samples/selfservice folder.

Samples are not available for all of the document and exchange protocol combinations. However, by replacing the document protocol details and exchange protocol details in the existing samples, you can create new XML files.

Note:

Self service XML files can also be created using the XSD, which is useful for the advanced user who wants to start from scratch. Also, when running the command line selfservice with the input SelfService.xml that does not exist, the command line selfservice will be able to run successfully and an empty B2B Zip file created. You should ensure the existence of a valid selfservice.xml file before running the command line selfservice utility. This note is specific to your running SelfService with the folder option, -Dinput="/folder" (rather than running the utility against the xml file itself outside of the context of a folder.). That is, the valid input xml file is expected within the /folder. See Example 21-32.

X12 Samples

The X12 samples are located in:

$samples/selfservice/x12/b2b-201-X12_4010_850_File/x12_ss.xml 

The schemas are located in:

$samples/selfservice/x12/b2b-201-X12_4010_850_File/schemas

Use the following command:

ant -f ant-b2b-util.xml b2bselfservice -Dinput="$samples/selfservice/x12/b2b-201-X12_4010_850_File/x12_ss.xml"

Custom Samples

The Custom samples are located in:

$samples/selfservice/custom/b2b-101-Custom_1.0_orders_generic_file/custom_ss.xml 

The schemas are located in;

$samples/selfservice/custom/b2b-101-Custom_1.0_orders_generic_file/schemas

Use the following command:

ant -f ant-b2b-util.xml b2bselfservice -Dinput="$samples/selfservice/ custom\b2b-101-Custom_1.0_orders_generic_file/custom_ss.xml"

ebMS Samples

The ebMS samples are located in:

$samples/selfservice/custom/ b2b-106-Custom_1.0_orders_ebMS/buyer_setup_selfservice/ ebms_buyer_ss.xml

The schemas are located in:

$samples/selfservice/custom/ b2b-106-Custom_1.0_orders_ebMS/buyer_setup_selfservice/schemas

Use the following command:

ant -f ant-b2b-util.xml b2bselfservice -Dinput="$samples/selfservice/custom/ b2b-106-Custom_1.0_orders_ebMS/buyer_setup_selfservice/ ebms_buyer_ss.xml"

21.13.3 How to Create Selfservice XML Templates from selfservice.xsd

Using an IDE, Selfservice XML Templates can be created from the selfservice.xsd file.

[waiting for response to Bug 9472999 - xb2b:the document for ss utility needs to be updated]

21.14 Resubmitting a Message

This utility resubmits an application message or a wire message for a selected business message.

ant -f ant-b2b-util.xml b2bresubmit

The resubmit count gets reflected in the Oracle B2B console reports for Application message and Wire message.

Note:

The resubmit functionality for payload rectification will only work for Outbound Message for AppMessage only. This is not valid for inbound cases.

ant -f ant-b2b-util.xml b2bresubmit -Dmsgsource=APPMSG -Dmsgid=12345 -Dpayloadpath=/scratch/viramamo/fmwhome/AS11gR1SOA/bin/3a4_req.xml

Note:

It is mandatory that you provide at least one message searching or matching criteria for resubmit (excluding maxcount, exclresubmit, mode.)

Table 21-15 lists the options for this utility.

Table 21-15 Options for b2bresubmit Utility

Option Description Domain Required
direction

The direction of the message

INBOUND

OUTBOUND

-

msgsource

The message source

APPMSG

WIREMSG

-

msgid

The message ID

-

-

doctype

Document Type

-

-

msgstate

Message State

-

-

fromdate

The sendTimestamp of the message

Date format to be provided within Double Quotes

dd/MM/yyyy h:mm AM/PM 

Note: This cannot be a future date.

Yes, when todate is used.

todate

The sendTimestamp of the message

Date format to be provided within Double Quotes

dd/MM/yyyy hh:mm AM/PM 

Note: todate should be greater/later than fromdate. You can provide both the dates.

Yes, when fromdate is used

agreement

Agreement Name

-

-

payloadpath

This option is applicable for outbound application message resubmission, by providing the rectified file path.

-

-

tp

The trading partner name using which the resubmission takes place. The trading partner name cannot be the hostname.

-

-

action

-

-

-

service

-

-

-

idtype / idvalue

The sender ID_TYPE, or identifier type, which uniquely identifies a trading partner and defines how to exchange documents. The sender ID_VALUE is the value associated with the identifier type.

-

-

mode

Simulates the command without actual execution by either retrieving the affected rows or their count. It lists and shows the count of messages for the selected criteria. It does not resubmit the messages, but just lists the information.

list, count

-

exclresubmit

Excludes the already resubmitted message

Default value: false; Allowed values: true/false

-

exclmsgid

Excludes a specific messageId

One or more message ID(s) (Comma-separated messageIDs)

-

excldoctype

-

-

-

maxcount

Limits the maximum number of messages to be resubmitted for the selected criteria and enables resubmission in batch. When this maxcount criteria is provided, the acknowledgment messages in complete state are not considered for resubmission.

Positive integer

-

oldcpaid / newcpaid

Resubmission for a changed cpaID case. This is achieved by providing both the cpa IDs oldcpaID and newcpaID.

-

-

filepath

Used in the case of file-based MessageID List, Conversation ID-based resubmit.

-

-

sourceid

Works in tandem with -Dfilepath

-

-

protocolmsgid

-

-

-

protocolcollaborationid

-

Comma-separated

-

Example 21-33 Resubmits an Outbound Message with Message ID 12345

ant -f ant-b2b-util.xml b2bresubmit -Ddirection=OUTBOUND -Dmsgsource=APPMSG -Dmsgid=12345\

Example 21-34 Other Examples

ant -f ant-b2b-util.xml b2bresubmit -Dmsgsource=APPMSG -Ddoctype=850

ant -f ant-b2b-util.xml b2bresubmit -Dmsgsource=APPMSG -Dfromdate="29/11/2009 5:40 AM" -Dtodate="30/11/2009 7:39 AM"

ant -f ant-b2b-util.xml b2bresubmit -Dmsgsource=APPMSG -Dagreement="Acme_GlobalChips_X12_4010_850_File" 

ant -f ant-b2b-util.xml b2bresubmit -Dmsgsource=WIREMSG -Dmsgstate=MSG_ERROR

ant -f ant-b2b-util.xml b2bresubmit -Dmsgsource=APPMSG -Dfromdate="29/11/2009 5:40 AM" -Dtodate="30/11/2009 7:39 AM" -Ddirection=OUTBOUND

ant -f ant-b2b-util.xml b2bresubmit -Dmsgsource=APPMSG -Dfromdate="29/11/2009 5:40 AM" -Dtodate="30/11/2009 7:39 AM" -Ddirection=INBOUND

ant -f ant-b2b-util.xml b2bresubmit -Dmsgsource=APPMSG -Dmsgid=12345 -Dpayloadpath="/tmp/850.xml"

ant -f ant-b2b-util.xml b2bresubmit -Dmsgsource=APPMSG -Dmsgid=39950852 -Dexclresubmit=true

ant -f ant-b2b-util.xml b2bresubmit -Dmsgsource=WIREMSG -Dmsgid=39950852 -Dexclstate=MSG_COMPLETE

ant -f ant-b2b-util.xml b2bresubmit -Dmsgsource=APPMSG -Dagreement="Acme_GlobalChips_X12_4010_850_File" -Dexclmsgid=33774513

ant -f ant-b2b-util.xml b2bresubmit -Dmsgsource=APPMSG -Dfromdate="29/05/2010 5:40 AM" -Dtodate="30/05/2010 7:39 AM" -Dmode=list

21.14.1 Resubmitting Messages Based on the Protocol Message ID

Protocol message ID can be provided in three ways.

The following examples illustrates how to resubmit messages based on the protocol message IDs.

Example 21-35 Specifying a single protocol message ID

ant -f ant-b2b-util.xml b2bresubmit -Dprotocolmessageid="@0AE4A13C13049AF1C940000011B831E8"

Example 21-36 Specifying a comma-separated list of protocol message IDs

ant -f ant-b2b-util.xml b2bresubmit -Dprotocolmessageid="@0AE4A13C13049AF1C940000011B831E8,@0AE56A6F13049AF21500000016729990"

Example 21-37 Specifying a list of protocol message IDs (one protocol message ID in one row) in a file

ant -f ant-b2b-util.xml b2bresubmit -Dsourceid=protocolmessageid -DfilePath="inputProtMsgId.txt"

Note:

Use only one of the preceding options at a time. Using a combination of the preceding options in a single command may return unexpected results.

21.15 Scheduling Trading Partner Downtime

This utility schedules downtime for a Trading Partner.

ant -f ant-b2b-util.xml b2bschedule

Table 21-16 lists the options for this utility.

Table 21-16 Options for b2bschedule Utility

Option Description Domain Required

mode

Indicates if the script will schedule or unschedule a downtime.

schedule or unschedule

Yes

schedulename

A descriptive name for the scheduled downtime

-

Yes

tp

Trading Partner Name

-

Yes

(except in unschedule mode)

fromdate

The date and time at which to begin the downtime.

Date format to be provided within Double Quotes

dd/mm/yyyy hh:mm AM/PM 

No

todate

The date and time at which to end the downtime.

Date format to be provided within Double Quotes

dd/mm/yyyy hh:mm AM/PM 

No

channelname

Channel name

-

No

extend

Extends a previously created schedule. See Example 21-43.

true

No

The following are examples of scheduling Trading Partner downtime using the b2bschedule utility. The command does not need to be in a single line.

Example 21-38 Schedule Trading Partner downtime for a specific channel and duration

ant -f ant-b2b-util.xml b2bschedule
-mode=schedule
-Dtp="OracleServices"
-Dfromdate="28/05/2010 06:10 AM"
-Dtodate="28/05/2010 06:15 AM"
-Dchannelname="MarketInc_AS2_DC"
-Dschedulename= "Maintenance"

Example 21-39 Schedule a particular channel for downtime

ant -f ant-b2b-util.xml b2bschedule
-mode=schedule
-Dtp="MarketInc"
-Dchannelname="MarketInc_ebMS_DC"
-Dschedulename= "Maintenance"

Example 21-40 Schedule the Trading Partner for downtime

In this example, all channels of this Trading Partner will be down for an unknown duration. Executing the unschedule command separately, as shown in Example 21-42, brings the Trading Partner back to an active state.

ant -f ant-b2b-util.xml b2bschedule -mode=schedule -Dtp="MarketInc" -Dschedulename= "Maintenance"

Example 21-41 Schedule downtime for a particular duration of time

ant -f ant-b2b-util.xml b2bschedule -mode=schedule -Dtp="MarketInc" 
-Dfromdate="28/05/2010 03:05 AM" -Dtodate="28/05/2010 03:08 AM" 
-Dschedulename= "Maintenance"

Example 21-42 Un-scheduling the scheduled event

ant -f ant-b2b-util.xml b2bschedule -Dmode=unschedule -Dschedulename="Maintenance"

Example 21-43 Extend an existing schedule

Create a schedule for a particular time frame for all the channels for a remote tp by entering the following:

ant -f ant-b2b-util.xml b2bschedule -Dtp=GlobalChips 
-Dfromdate="31/08/2010 10:47 AM" -Dtodate="31/08/2010 10:57 AM" 
-Dschedulename=Load -Dchannelname=GlobalChips_File_Endpoint

Extend the schedule by creating another schedule with the same name, with the start time as the end time of the previously created schedule (31/08/2010 10:57 AM), and the end time to which you want to extend the schedule to, and then pass the parameter -Dextend=true:

ant -f ant-b2b-util.xml b2bschedule -Dtp=GlobalChips 
-Dfromdate="31/08/2010 10:57 AM" -Dtodate="31/08/2010 11:57 AM" 
-Dschedulename=Load -Dchannelname=GlobalChips_File_Endpoint -Dextend=true

21.16 Managing the Keystore

Certificate expiry must be identified and notified to the Administrator as it affects the message flow with security. Oracle B2B exposes Public API/Ant commands to check the certificate for expiry. You can use b2bmanagekeystore to define a schedule and encapsulate these APIs for proper alert mechanism.

Note:

As a pre-requisite, it is required to configure the Java key store in Oracle B2B.

ant -f ant-b2b-util.xml b2bmanagekeystore [-Dmode=list | -Dalias="cert_name" | -Ddays=num_of_days
]

Table 21-17 lists the options for this utility.

Table 21-17 Options for b2bmanagekeystore Utility

Option Description Domain Required

mode

List all the certificate alias in the keystore and its expiry dates

list

No

alias

Certificate status and its expiry date of the provided alias

-

No

days

List all the certificates which will expire within the days specified

integer

No

Example 21-44 Get a List of Certificate Aliases

ant -f ant-b2b-util.xml b2bmanagekeystore -Dmode=list

Example 21-45 Get the Status of a Certificate

ant -f ant-b2b-util.xml b2bmanagekeystore -Dalias="MarketInc_Cert"

Example 21-46 Get a List of Certificates Expiring at a Future Date

ant -f ant-b2b-util.xml b2bmanagekeystore -Ddays=15

Note:

When using Farm Keystore Service (FKS), it is recommended to use the Oracle Enterprise Manager Control console for any kind of keystore manageability.

21.17 Updating the Keystore

This utility updates the keystore location and password.

ant -f ant-b2b-util.xml b2bkeystoreupdate

Table 21-18 lists the mandatory parameters for this utility.

Table 21-18 Parameters for b2bkeystoreupdate Utility

Option Description

keystorelocation

List all the certificate alias in the keystore and its expiry dates

keystorepassword

Certificate status and its expiry date of the provided alias

The following is a sample usage of the utility:

ant -f ant-b2b-util.xml b2bkeystoreupdate -Dkeystorelocation="/tmp/acme.jks" -Dkeystorepassword="welcome"

21.18 Errors During Import

This utility resolves a broken pipe error.

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