com.bea.b2b.rosettanet
Class RNHelper

java.lang.Object
  |
  +--com.bea.b2b.rosettanet.RNHelper

public class RNHelper
extends java.lang.Object
implements java.io.Serializable

This class is a used to define all the business operations needed for Rosettanet.

Author:
Copyright © 2000 BEA Systems, Inc. All Rights Reserved.
See Also:
Serialized Form

Constructor Summary
RNHelper()
           
 
Method Summary
static java.lang.String addDocType(java.lang.String xmldoc, java.lang.String docType)
          Add the DOCTYPE to the given Service Header XML document string.
static boolean generalExceptionMessage(java.lang.String doc)
          Returns whether or not the provided Service Header is for a General Exception message.
static java.lang.String getServiceContentString(java.lang.String name)
          This method loads an XML document from the file with the filename that is passed in and returns the document as a String.
static void log(java.lang.String s)
          Log workflow messages to the /rosettanet/enabler/wlc.log file.
static boolean prepareReceiptAcknowledgement(java.lang.String instanceId)
          This method completes building the Service Header by adding the document type to the header and builds the Service Content for the Receipt Acknowledgement message.
static boolean prepareReceiptException(java.lang.String instanceId)
          This method completes building the Service Header by adding the document type to the header and builds the Service Content for the Receipt Acknowledgement Exception message.
static boolean processReceiptAcknowledgement(java.lang.String instanceId)
          This method checks whether the message received is a General Exception message, a Receipt Acknowledgement Exception message, or a Receipt Acknowledgement message.
static boolean validateContent(java.lang.String doc, java.lang.String validationSchema)
          Validate the PIP Service Content according to the XML schema file provided.
static boolean validateHeader(java.lang.String doc, java.lang.String validationSchema)
          Validate the Service Header according to the XML schema file provided.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RNHelper

public RNHelper()
Method Detail

validateHeader

public static boolean validateHeader(java.lang.String doc,
                                     java.lang.String validationSchema)
Validate the Service Header according to the XML schema file provided. The XML Schema has been created, using the Service Header message guideline, to validate the Service Header XML document. This method is invoked from the example PIP workflows as a business operation.

Parameters:
doc - a Service Header XML document in a String format to validate against the XML schema
validationSchema - the XML schema file to validate against.
Returns:
an indication of whether or not the validation passed

validateContent

public static boolean validateContent(java.lang.String doc,
                                      java.lang.String validationSchema)
Validate the PIP Service Content according to the XML schema file provided. The XML Schema has been created, using the PIP Service Content message guideline, to validate the PIP Service Content XML document. This method is invoked from the example PIP workflows as a business operation.

Parameters:
doc - a PIP Service Content XML document in a String format to validate against the XML schema
validationSchema - the XML schema file to validate against.
Returns:
an indication of whether or not the validation passed

generalExceptionMessage

public static boolean generalExceptionMessage(java.lang.String doc)
Returns whether or not the provided Service Header is for a General Exception message. This method is invoked from the example PIP workflows as a business operation.

Parameters:
doc - a Service Header XML document in String format
Returns:
an indication of whether the message was a GeneralExceptionMessage

log

public static void log(java.lang.String s)
Log workflow messages to the /rosettanet/enabler/wlc.log file. This method is invoked from the example PIP workflows as a business operation.

Parameters:
s - message to be logged

addDocType

public static final java.lang.String addDocType(java.lang.String xmldoc,
                                                java.lang.String docType)
Add the DOCTYPE to the given Service Header XML document string. The document type should be specified in the following form: <!DOCTYPE ServiceHeader SYSTEM "ServiceHeaderPartMessageGuideline.dtd">. This method is invoked from the example PIP workflows as a business operation.

Parameters:
xmldoc - the Service Header XML String document
docType - the Document Type string
Returns:
the String with the document type added

prepareReceiptException

public static final boolean prepareReceiptException(java.lang.String instanceId)
This method completes building the Service Header by adding the document type to the header and builds the Service Content for the Receipt Acknowledgement Exception message. The service header should be built before this method is called. No validation of the built message is done because it is built correctly in the workflow. The workflow instance id is passed in so workflow variables can be used to build the message. The workflow variables signalHeader and serviceContent are also set. These variables are used when the workflow sends the message. This method is invoked from the example PIP workflows as a business operation.

Parameters:
instanceId - the workflow instance id
Returns:
an indication that the message preparation was done

processReceiptAcknowledgement

public static final boolean processReceiptAcknowledgement(java.lang.String instanceId)
This method checks whether the message received is a General Exception message, a Receipt Acknowledgement Exception message, or a Receipt Acknowledgement message. It validates the Service Header and Servce Content of the message and returns an indication of whether the message is invalid. It also sets the workflow variable isException, which is used in a Decision node in the workflow. This method is invoked from the example PIP workflows as a business operation.

Parameters:
instanceId - the workflow instance id
Returns:
an indication that the acknowledgement was processed.

prepareReceiptAcknowledgement

public static final boolean prepareReceiptAcknowledgement(java.lang.String instanceId)
This method completes building the Service Header by adding the document type to the header and builds the Service Content for the Receipt Acknowledgement message. The Service Header should be built before this business operation is called. No validation of the built message is done because this signal message is built correctly in the workflow. The workflow instance id is passed in so workflow variables can be used to build the message. Workflow variables are also set. These variables are used when the workflow sends the message. This method is invoked from the example PIP workflows as a business operation.

Parameters:
instanceId - the workflow instance id
Returns:
an indication that the preparation was done

getServiceContentString

public static java.lang.String getServiceContentString(java.lang.String name)
This method loads an XML document from the file with the filename that is passed in and returns the document as a String. In the example workflows this method is used to load XML files such as the following: 3A2PriceAndAvailabilityQueryMessage.xml and 3A2PriceAndAvailabilityResponseMessage.xml. This method is invoked from the example PIP workflows as a business operation.

Parameters:
name - name of the Service Content XML document
Returns:
the Service Content document as a String