Use the ApprovalFormHandler form handler (class atg.b2bcommerce.approval.ApprovalFormHandler) to process an approver’s approval or rejection of an order. The ApprovalFormHandler class contains two handle methods, handleApproveOrder and handleRejectOrder. You can associate these handle methods with Submit properties in the following manner:

<dsp:input bean="ApprovalFormHandler.approveOrder" value=" Approve Order"
<dsp:input bean="ApprovalFormHandler.rejectOrder" value=" Reject Order"

If the handleApproveOrder method is called for ApprovalFormHandler.approveOrder, the handleApproveOrder method processes the approver’s approval of the order. In contrast, if the handleRejectOrder method is called for ApprovalFormHandler.rejectOrder, the handleRejectOrder method processes the approver’s rejection of the order.

The following JSP example illustrates how to use ApprovalFormHandler with a single order. In this example, the approver enters an order id and a comment (or message) to be associated with his approval or rejection of the order. He then approves or rejects the order by clicking the Approve Order submit button or the Reject Order submit button, respectively.

<dsp:importbean bean="/atg/commerce/approval/ApprovalFormHandler"/>
<dsp:form action="pendingapprovalOrders.jsp">
   <dsp:input bean="ApprovalFormHandler.ApproveOrderSuccessURL"
         value="pendingapprovalOrders.jsp" type="hidden"/>
   <dsp:input bean="ApprovalFormHandler.ApproveOrderErrorURL"
         value="pendingapprovalOrders.jsp" type="hidden"/>
   <dsp:input bean="ApprovalFormHandler.RejectOrderSuccessURL"
         value="pendingapprovalOrders.jsp" type="hidden"/>
   <dsp:input bean="ApprovalFormHandler.RejectOrderErrorURL"
         value="pendingapprovalOrders.jsp" type="hidden"/>
   Order Id <dsp:input bean="ApprovalFormHandler.orderId" size="10" value=""
   Approver Message <dsp:input bean="ApprovalFormHandler.approverMessage"
         size="500" value="" type="text"/>
   <dsp:input bean="ApprovalFormHandler.approveOrder" value="  Approve Order  "
   <dsp:input bean="ApprovalFormHandler.rejectOrder" value="  Reject Order  "

Note: In actual implementations, JSP files will be in web applications and not relative to doc roots.

loading table of contents...