This discussion is archived
5 Replies Latest reply: Jan 9, 2013 3:39 PM by Suneel Jakka RSS

How to use Business rules for lines in the payload in BPEL

Suneel Jakka Newbie
Currently Being Moderated
I have a invoice and sending to B2B in order to send to trading partner but before sending to trading partner, we have to perform some validations before to be sent to trading partner. We have various validations based on the customer, so creating dictionary with "if then" rule sets for each customer.

But each invoice has various lines, how can I do the validation on the lines. I have to loop through all the lines in the invoice and verify few segments whether they exist or not. So planning to create function and with function args as list but how can I perform the loop for all the invoice lines.

Here is the sample payload of the invoice


<Receive_894_Dequeue_InputVariable>
<part name="XXDPI_EDI894_INVLIST_TYPE">
<XXDPI_EDI894_INVLIST_TYPE>
<INVLIST>
<INVLIST_ITEM>
<INV_NUMBER>13073309</INV_NUMBER>
<STORE_NUMBER>701608</STORE_NUMBER>
<VENDOR_NUM NULL="TRUE"/>
<DELIVERY_DATE>20121119</DELIVERY_DATE>
<TOTAL_QTY>6</TOTAL_QTY>
<TOTAL_AMT>14802</TOTAL_AMT>
<SIGNATURE>SIGN</SIGNATURE>
<CHECK_VALUE>ABC</CHECK_VALUE>
<TP_NAME>DEF</TP_NAME>
<LINES>
<LINES_ITEM>
<SEQUENCE_NUM>1</SEQUENCE_NUM>
<QUANTITY>1</QUANTITY>
<UOM>EA</UOM>
<ITEM_NUMBER>0001</ITEM_NUMBER>
<PRICE>10.47</PRICE>
<PACK>1</PACK>
<ITEM_DESC>SAMPLE1</ITEM_DESC>
<ALL_CODE NULL="TRUE"/>
<ALL_METHOD NULL="TRUE"/>
<ALL_RATE NULL="TRUE"/>
<ALL_QTY NULL="TRUE"/>
<ALL_UOM NULL="TRUE"/>
<ATTRIBUTE1 NULL="TRUE"/>
<ATTRIBUTE2 NULL="TRUE"/>
<ATTRIBUTE3 NULL="TRUE"/>
<ATTRIBUTE4 NULL="TRUE"/>
<ATTRIBUTE5 NULL="TRUE"/>
<ATTRIBUTE6 NULL="TRUE"/>
<ATTRIBUTE7 NULL="TRUE"/>
<ATTRIBUTE8 NULL="TRUE"/>
<ATTRIBUTE9 NULL="TRUE"/>
<ATTRIBUTE10 NULL="TRUE"/>
</LINES_ITEM>
<LINES_ITEM>
<SEQUENCE_NUM>2</SEQUENCE_NUM>
<QUANTITY>1</QUANTITY>
<UOM>EA</UOM>
<ITEM_NUMBER>0002</ITEM_NUMBER>
<PRICE>8.55</PRICE>
<PACK>1</PACK>
<ITEM_DESC>SAMPLE2</ITEM_DESC>
<ALL_CODE NULL="TRUE"/>
<ALL_METHOD NULL="TRUE"/>
<ALL_RATE NULL="TRUE"/>
<ALL_QTY NULL="TRUE"/>
<ALL_UOM NULL="TRUE"/>
<ATTRIBUTE1 NULL="TRUE"/>
<ATTRIBUTE2 NULL="TRUE"/>
<ATTRIBUTE3 NULL="TRUE"/>
<ATTRIBUTE4 NULL="TRUE"/>
<ATTRIBUTE5 NULL="TRUE"/>
<ATTRIBUTE6 NULL="TRUE"/>
<ATTRIBUTE7 NULL="TRUE"/>
<ATTRIBUTE8 NULL="TRUE"/>
<ATTRIBUTE9 NULL="TRUE"/>
<ATTRIBUTE10 NULL="TRUE"/>
</LINES_ITEM>
<LINES_ITEM>
<SEQUENCE_NUM>3</SEQUENCE_NUM>
<QUANTITY>1</QUANTITY>
<UOM>CS</UOM>
<ITEM_NUMBER>0003</ITEM_NUMBER>
<PRICE>18.9</PRICE>
<PACK>6</PACK>
<ITEM_DESC>SAMPLE3</ITEM_DESC>
<ALL_CODE>47</ALL_CODE>
<ALL_METHOD>02</ALL_METHOD>
<ALL_RATE>2.88</ALL_RATE>
<ALL_QTY>1</ALL_QTY>
<ALL_UOM>CS</ALL_UOM>
<ATTRIBUTE1 NULL="TRUE"/>
<ATTRIBUTE2 NULL="TRUE"/>
<ATTRIBUTE3 NULL="TRUE"/>
<ATTRIBUTE4 NULL="TRUE"/>
<ATTRIBUTE5 NULL="TRUE"/>
<ATTRIBUTE6 NULL="TRUE"/>
<ATTRIBUTE7 NULL="TRUE"/>
<ATTRIBUTE8 NULL="TRUE"/>
<ATTRIBUTE9 NULL="TRUE"/>
<ATTRIBUTE10 NULL="TRUE"/>
</LINES_ITEM>
<LINES_ITEM>
<SEQUENCE_NUM>4</SEQUENCE_NUM>
<QUANTITY>1</QUANTITY>
<UOM>CS</UOM>
<ITEM_NUMBER>0004</ITEM_NUMBER>
<PRICE>45.19</PRICE>
<PACK>1</PACK>
<ITEM_DESC>SAMPLE4 </ITEM_DESC>
<ALL_CODE NULL="TRUE"/>
<ALL_METHOD NULL="TRUE"/>
<ALL_RATE NULL="TRUE"/>
<ALL_QTY NULL="TRUE"/>
<ALL_UOM NULL="TRUE"/>
<ATTRIBUTE1 NULL="TRUE"/>
<ATTRIBUTE2 NULL="TRUE"/>
<ATTRIBUTE3 NULL="TRUE"/>
<ATTRIBUTE4 NULL="TRUE"/>
<ATTRIBUTE5 NULL="TRUE"/>
<ATTRIBUTE6 NULL="TRUE"/>
<ATTRIBUTE7 NULL="TRUE"/>
<ATTRIBUTE8 NULL="TRUE"/>
<ATTRIBUTE9 NULL="TRUE"/>
<ATTRIBUTE10 NULL="TRUE"/>
</LINES_ITEM>
<LINES_ITEM>
<SEQUENCE_NUM>5</SEQUENCE_NUM>
<QUANTITY>1</QUANTITY>
<UOM>CS</UOM>
<ITEM_NUMBER>0005</ITEM_NUMBER>
<PRICE>50.93</PRICE>
<PACK>1</PACK>
<ITEM_DESC>SAMPLE5</ITEM_DESC>
<ALL_CODE NULL="TRUE"/>
<ALL_METHOD NULL="TRUE"/>
<ALL_RATE NULL="TRUE"/>
<ALL_QTY NULL="TRUE"/>
<ALL_UOM NULL="TRUE"/>
<ATTRIBUTE1 NULL="TRUE"/>
<ATTRIBUTE2 NULL="TRUE"/>
<ATTRIBUTE3 NULL="TRUE"/>
<ATTRIBUTE4 NULL="TRUE"/>
<ATTRIBUTE5 NULL="TRUE"/>
<ATTRIBUTE6 NULL="TRUE"/>
<ATTRIBUTE7 NULL="TRUE"/>
<ATTRIBUTE8 NULL="TRUE"/>
<ATTRIBUTE9 NULL="TRUE"/>
<ATTRIBUTE10 NULL="TRUE"/>
</LINES_ITEM>
</LINES>
<ATTRIBUTE1>007908809</ATTRIBUTE1>
<ATTRIBUTE2>081191017</ATTRIBUTE2>
<ATTRIBUTE3>000000</ATTRIBUTE3>
<ATTRIBUTE4 NULL="TRUE"/>
<ATTRIBUTE5 NULL="TRUE"/>
<ATTRIBUTE6 NULL="TRUE"/>
<ATTRIBUTE7 NULL="TRUE"/>
<ATTRIBUTE8 NULL="TRUE"/>
<ATTRIBUTE9 NULL="TRUE"/>
<ATTRIBUTE10 NULL="TRUE"/>
</INVLIST_ITEM>
</INVLIST>
</XXDPI_EDI894_INVLIST_TYPE>
</part>
</Receive_894_Dequeue_InputVariable>

Regards,
Suneel Jakka

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points