### Billing Business Process

The Billing business process defines the sequence of tasks required to bill for the ordered item.

The business process is started by the Order New business process if the item needs to be produced by the Manufacturing department. The business process checks the origin of the order. If the order was generated inside the company, the business process charges the appropriate department. If the order was generated outside of the company, the business process generates a bill and sends it to the recipient.

To view the business process in WebLogic Workshop, double-click the workflow/WorkflowBilling.jpd file in the Application window.

As you step through each node description:

1. Double-click the node in the business process to invoke the node builder and display details about the node.
2. Select View Code in the node builder (or by right-clicking the node), when applicable, to display the related code in the Source View window.

The following table describes each node in the Billing business process.

Stepping Through the Billing Business Process

Business Process Node | Description
--- | ---
| Defines the asynchronous event that starts the business process: a billing-related message is received. The Client Request node uses mPublish, an instance of the Publish.jcx Message Broker control, to call the subscription() method to subscribe to the Message Broker, specifying end2end/billingshipping as the Channel name. The node uses a filter, comparing the destination1 field in the NetMessageDocument argument received to the filter value, billing.
| Transforms the message from the Message Broker intermediary format, NetMessageDocument. The Control Send with Return node uses m_netTransforms, an instance of the TransformsNetworkMessage.dtf data transformation control, to call the transformFromBasicNet() method to transform the message received from the NetMessageDocument type, used by the Message Broker, to the InputDocument type.
| Transforms the message to the appropriate format. The Control Send with Return node uses m_transformsInput, an instance of the TransformsInputMessage.dtf data transformation control, to call the getInput() method to transform the message received from the InputDocument type to the Input type.
| Retrieves the order tracking ID for the current order. The Control Send with Return node uses m_OrderTrack, an instance of the e2eOrderTrackingEJB.jcx EJB control, to call the findByPrimaryKey() method to locate the order tracking ID for the current order.
| Updates the status of the order. The Control Send node uses m_OrderTrack, an instance of the e2eOrderTrackingEJB.jcx EJB control, to call the setDescRemote() method to indicate that the order has been received by the Billing department.
| Branches the business process flow, based on whether or not the order was generated inside the company. If the order is internal, the business process proceeds to the Charge Dept node. If the order is external to the company, then the business process proceeds to the Not Intra Company node. The Decision node calls the isIntra() method to branch the business process flow accordingly.
| Charges the appropriate department to process an order that is internal to the company. The Perform node calls the chargeDept() Java method to charge the appropriate department.
| Updates the status of the order. The Control Send node uses m_OrderTrack, an instance of the e2eOrderTrackingEJB.jcx EJB control, to call the setDescRemote() method to indicate that the department has been charged.
| Branches the business process flow, based on whether or not the order was generated external to the company. If the order is external, the business process proceeds to the GenerateBill node. If some other condition is raised, the order process ends. The Decision node calls the isNotIntra() method to branch the business process flow accordingly.
| Generates a bill for the order. The Control Send node uses billCtrl, an instance of the GenerateBillControl.jcx web service control, to call the generateBill() method to generate a bill for the order.
| Updates the status of the order. The Control Send node uses m_OrderTrack, an instance of the e2eOrderTrackingEJB.jcx EJB control, to call the setDescRemote() method to indicate that the bill has been generated.