RosettaNet is a consortium of major companies working to create and implement industry-wide, open e-business process standards. These standards form a common e-business language, aligning processes between supply chain partners on a global basis. RosettaNet is a subsidiary of the Uniform Code Council, Inc. (UCC). To learn about RosettaNet, see
http://www.rosettanet.org
.
The RosettaNet control enables Oracle Workshop for WebLogic business processes to exchange business messages and data with trading partners via RosettaNet. You use RosettaNet controls only in initiator business processes to manage the exchange of RosettaNet business messages with participants. For an introduction to RosettaNet solutions, see Introducing Trading Partner Integration.
Introducing Trading Partner Integration
Building RosettaNet Participant Business Processes
You use RosettaNet controls in initiator business processes to exchange RosettaNet business messages with participants. The RosettaNet control provides methods for sending and receiving business messages, as described in the Interface RosettaNetControl Javadoc. Callbacks handle RosettaNet messages, acknowledgements, rejections, and errors received from the participant.
You should not use RosettaNet controls in participant business processes to respond to incoming messages. Instead, you use client request nodes to handle incoming business messages from the initiator and client response nodes to handle outgoing business messages to the initiator. To learn about building participant business processes that use RosettaNet, see Building RosettaNet Participant Business Processes. To learn about designing business processes that use RosettaNet, see Introducing Trading Partner Integration.
At run-time, the RosettaNet control relies on trading partner and service information stored in the TPM repository. To learn about the TPM repository, see Introducing Trading Partner Integration. To learn about adding or updating information in the TPM repository, see Trading Partner Management in Using The Oracle WebLogic Integration Administration Console.
This topic describes how to create a new RosettaNet control. You add one RosettaNet control per public initiator business process. To learn more about public vs. private processes see, “Types of Business Processes” in “Trading Partner Business Process Concepts” in Introducing Trading Partner Integration. To learn about RosettaNet controls, see RosettaNet Control.
Note: | If the Data Palette view is not visible in Oracle Workshop for WebLogic, click Window > Show View > Data Palette from the menu bar. |
The Insert control: Rosettanet dialog-box appears (see Figure 13-1).
Note: | Where applicable, the values entered here must match their corresponding settings in the TPM repository. |
To learn more about data types, see
Working with Data Types.
|
A RosettaNet control instance is displayed in the Controls tab.
All Oracle Workshop for WebLogic controls follow a consistent model. Many aspects of using RosettaNet controls are identical or similar to using other Oracle Workshop for WebLogic controls.
After you have added a RosettaNet control to an initiator business process, you can use methods on the control to exchange RosettaNet messages with participant trading partners. In the Design View, you expand the node for the RosettaNet control in the Data Palette to expose its methods, and then drag and drop the methods you want onto the business process. Common tasks include:
To learn more about these methods, see Interface RosettaNetControl.
The RosettaNet control provides methods for sending the initial request message to a participant and also for responding to the participant’s reply. To add the method to a business process, you drag it from the Data Palette onto the business process, which creates a Control Send node.
You use the sendMessage
method to send a RosettaNet request message to participants. After creating the Control Send node in the business process, you need to specify the payload parts and their Java data types. Valid data types include:
Data in both untyped XML and non-XML format. To learn about working with
MessageAttachment objects, see Using Message Attachments.
|
Note: | Attachments can also be typed XML or typed MFL data as long as you specify the corresponding XML Bean or MFL class name in the parameter. |
After sending a RosettaNet message, the initiator business process awaits a response from the participant. After receiving the participant’s response to the request, a business process can either acknowledge and accept the response, reject the response, or notify the participant that an error has occurred. The RosettaNet control provides the following methods for responding to participant replies:
Participants can respond to initiator requests in the following ways:
To handle responses from participants, initiator business processes use the following callback methods:
To receive a RosettaNet message from a participant, you use the appropriate method. To add the method to a business process, you drag it from the Data Palette onto the business process, which creates a Control Receive node.
For the onMessage
method, after creating the Control Receive node, you need to specify the payload parts and their Java data types for the incoming message. To learn about valid data types, see
Sending Messages to Participants.
The onError
and onAck
methods are system-level methods. Both use the XmlObject
argument, which will contain a RosettaNet payload. These arguments are not seen in the default control but you can drag them onto the business process from the Data Palette. If your application contains a schema project that includes the Exception schema file (for RNIF2.0), and if the schema is already built, you can extract the values you want by creating a query (in the XQuery language) using the mapper functionality of Oracle Workshop for WebLogic. To learn about creating queries with the mapper functionality, see
Transforming Data Using XQuery.
You can retrieve specific message elements from your RosettaNet messages by using the RosettaNetContext
XMLBean. The following message elements can be retrieved and are returned as java.lang.string
:
When you use the RosettaNetContext
XMLBean, be sure to import the following classes:
com.bea.wli.control.rosettanetContext.RosettaNetContextDocument;
com.bea.wli.control.rosettanetContext.RosettaNetContextDocument.RosettaNetContext;
The following are code examples of how to use RosettaNetContext
:
Note: | If you use the code samples provided in this section, remember to also modify the return type of your corresponding methods in your RosettaNet control definition file (control file). In other words, public void sendMessage() needs to be changed to public RosettaNetContextDocument sendMessage(). |
public void rn_onMessage(RosettaNetContextDocument doc,
XmlObject msg)
{
System.out.println(">>>>> ContextInitiator.rn_onMessage()");
RosettaNetContextDocument.RosettaNetContext context =
doc.getRosettaNetContext();
System.out.println(" from=" + context.getFrom());
System.out.println(" to=" + context.getTo());
System.out.println(" pip=" + context.getPip());
System.out.println(" failure-report-admin=" +
context.getFailureReportAdministrator());
}
public void rnSendMessage() throws Exception
{String rnInfo = "Service Content";
XmlObject xObj = XmlObject.Factory.parse(rnInfo);
RosettaNetContextDocument doc = rn.sendMessage(xObj);
System.out.println(doc.toString());
}
Where Service Content
is the service content of your RosettaNet message.
public void onMessage(RosettaNetContextDocument doc, XmlObject msg)
{System.out.println
(">>>>> ContextParticipant.onMessage()");RosettaNetContext context = doc.getRosettaNetContext();
System.out.println
(" from=" + context.getFrom());System.out.println
(" to=" + context.getTo());System.out.println
(" pip=" + context.getPip());System.out.println
(" failure-report-admin=" +context.getFailureReportAdministrator());
}
@CallbackInterface()
public interface Callback extends ServiceBrokerControl
{
/**
* com.bea.control.annotations.MessageBuffer enable="false"
*/
@com.bea.wli.common.MessageBuffer(enable = false)
public RosettaNetContextDocument sendReply(XmlObject msg);
/**
* com.bea.control.annotations.MessageBuffer enable="false"
*/
@com.bea.wli.common.MessageBuffer(enable = false)
public void sendReceiptAcknowledgement();
/**
* com.bea.control.annotations.MessageBuffer enable="false"
*/
@com.bea.wli.common.MessageBuffer(enable = false)
public void sendError(String msg);
}
@com.bea.wli.jpd.Callback()
public Callback callback;
public void reply()
{XmlObject xObj = null;
try {
xObj = XmlObject.Factory.parse("Service Content");
} catch (Exception e) {
e.printStackTrace();
}
RosettaNetContextDocument doc= callback.sendReply(xObj);
System.out.println(doc.toString());
}
Where Service Content
is the service content of your RosettaNet message.
The RosettaNet control adds the capability of dynamically binding business IDs for the initiator (from
property) and the participant (to
property) of the control. Dynamic binding of properties can be achieved the following ways:
The hierarchy of property settings is as follows, starting with the approach having the highest precedence:
DynamicProperties.xml
filesetProperties()
method Dynamic selectors have a higher precedence than static selectors.
Using a dynamic selector, RosettaNet controls allow you to decide at run time which one of multiple trading partners to send a business message to. When you specify a dynamic selector, you build and test an XQuery that retrieves the business ID you need.
The setProperties
method accepts a RosettaNetPropertiesDocument
parameter. The RosettaNetPropertiesDocument
type is an XML Beans class that is generated out of the corresponding schema element defined in DynamicProperties.xsd
. The DynamicProperties.xsd
file is located in the system folder of New Process Applications or in the system folder of the Schemas project.
If your application contains a schema project that includes the DynamicProperties.xsd
file, and if the schema is already built, you can extract the values you want by creating a query (in the XQuery language) using the mapper functionality of Oracle Workshop for WebLogic. To learn about creating queries with the mapper functionality, see
Transforming Data Using XQuery.
DynamicProperties.xsd
file, and that the schema is already built.setProperties
method and drop it onto the Control Send node.to
and from
values, and then create a transformation to map them to the corresponding elements in RosettaNetPropertiesDocument
.
To display the current property settings, use the getProperties()
method.
For examples of how to use the RosettaNet control, see Tutorials: Building RosettaNet Solutions.