Invoke the BS of BPA Script and tries to display the result

Today I worked on some scripts of BPA in combination with commercial Services. The idea is simple. I call a Business Service that returns a list of Bill Segment details for a given ID of Bill I want hollow loop list in my script BPA to count the number of Segments of Bill and calculate an amount. The result that I want to display. To be clear, this isn't a requirement of real business, but just something I'm trying to get to work to learn more about this cool script :) stuff

This is the configuration I used for my experience.

BUSINESS SERVICE:
BusinessService: ZZ-billSegmentBill
Service name: CILBBLLP

< schema pageAction = 'read' >
< billId mapField = "BILL_ID" / >
< billSegments type = mapList "list" = "BILL_SEG" >
< bsegID mapField = "BSEG_ID" / >
< said mapField = "SA_ID" / >
< curAmount mapField = "CUR_AMT" / >
< / billSegments >
< / schema >

BPA SCRIPT:
Invocation option: user invoked
Data area: Business Service / ZZ-billSegmentBill / ZZ-billSegmentBill
Schema:
<>schema
< billSegmentCount / >
< sumBillSegmentAmount / >
< / schema >
Admission requirements: always eligible

STEPS TO FOLLOW:
Step 10: Label - start of Script

Step 20: Travel data
Type of field source: predefined value
Value of the source field: '148184849261' (<-a bill with 3 Segments of Bill)
Destination Type field: data area
Destination domain name: ZZ-billSegmentBill/billId

Step 30: Call BS
Group name: ZZ-billSegmentBill
Business service: ZZ-billSegmentBill
If successful, go to: 50
If error, go to: 40

Step 40: Label - ERROR call for Service to business

Step 50: Label - call Business Service SUCCESS

60 step: Edit data
change data
Move '0' to $BillSegmentCount;
Move '0' to $SumBillSegmentAmount;
for ($billSegments in "ZZ-billSegmentBill/billSegments")
pass '1 + $BillSegmentCount' to $BillSegmentCount.
move '$SumBillSegmentAmount + ZZ-billSegmentBill/billSegments/curAmount' to $SumBillSegmentAmount.
-end;
move '$BillSegmentCount' to 'parm/billSegmentCount ";
move '$SumBillSegmentAmount' to 'parm/sumBillSegmentAmount ";
end edit;

Step 70: Label - SUCCESS hollow closure Bill Segments

Not 80: Text displayed
Number of Segments of Bill: %=parm/billSegmentCount=% < br >
Add amounts in Segments of Bill: %=parm/sumBillSegmentAmount=%

OUTPUT WHEN EXECUTING THIS SCRIPT OF BPA:
Start of Script
SUCCESS citing BS
SUCCESS one hollow loop Bill Segments
Number of Segments of Bill: [null]
Add amounts in Bill's Segments: [null]

Apparently, the number of Segments of Bill and the amount I want to view is not available in text stage show since * [null] * is shown where I would expect 3 Segments of Bill and a $ 63.05. (Incidentally, this experience is made on CC & B 2.3 containing the demo data)

If I turn on Global Debug I see the XML code that is passed to the business function:

< ZZ-billSegmentBill >
< billId > 148184849261 < / billId >
< / ZZ-billSegmentBill >

which is filled as expected after the call like this:

< ZZ-billSegmentBill >
< billId > 148184849261 < / billId >
< billSegments >
< bsegID > 148184856248 < / bsegID >
< a > 1481848274 < / said >
< curAmount > 21,50 < / curAmount >
< / billSegments >
< billSegments >
< bsegID > 148184842336 < / bsegID >
< a > 1481848525 < / said >
< curAmount > 22.79 < / curAmount >
< / billSegments >
< billSegments >
< bsegID > 148184891745 < / bsegID >
< a > 1481848734 < / said >
< curAmount > 18.76 < / curAmount >
< / billSegments >
< / ZZ-billSegmentBill >

Unfortunately, the rest of the paper is not very clear to me. I expect to see than something related to 60 my script step BPA in which the number of Segments of Bill is counted and corresponds to the sum of the Bill Segments. I expect the record to populate the items in the schema of the BPA script itself. As an alternative, I tried to work with a separate data area to store the result of the County and the sum, but this results in the same number. Don't know what I'm missing here. Please enlighten me here where I'm going wrong.

It's because you reference the incorrect item in your stage of 50, it should be:

1 move '0' to $BillSegmentCount;
2 move '0.00' to $SumBillSegmentAmount;
3 for ($billSegments in "ZZ-billSegmentBill/billSegments")
4     move "1 + $BillSegmentCount" to $BillSegmentCount;
5     move "$SumBillSegmentAmount + $billSegments/curAmount" to $SumBillSegmentAmount;
6 end-for;
7 move "$BillSegmentCount" to "ZZ-billSegmentBillDataArea/billSegmentCount";
8 move "$SumBillSegmentAmount" to "ZZ-billSegmentBillDataArea/sumBillSegmentAmount";

Line 5, where you had referenced ZZ-billSegmentBill/billSegments/curAmount; will not change the value of this node-set element, since it is not part of the iteration, so you get 21.50 (1st BS) x 3 (lines) = 64.50.

Tags: Oracle

Similar Questions

Maybe you are looking for

  • Satellite Pro L300 - PCMCIA adapter

    Hello. I use a Toshiba laptop L300 downgraded from Vista to XP Pro. It is equipped with a card reader Express. I need to be able to use a PCMCIA drive to burn software on flash cards. I had 2 X Express Card to PCMCIA online converters, but they don't

  • Problems starting my MacBook Air (mid-2012) OSX 10.11.2

    When you start the MacBook system, I get the Apple with the bar Logo screen, after a few seconds, the screen goes black with the bar in the left corner of the screen a few seconds and the screen goes black and stay like that. I am able to boot in saf

  • Bluetooth using RFCOMM Sockets

    Hello I'm working on a project that requires LabVIEW communicate with a raspberry Bluetooth Pi. The Pi is running Python and using PyBluez to the side of Bluetooth. Preference LabVIEW will connect to IP using a Socket Bluetooth on RFCOMM, however I c

  • When I plug the headphone in front back, it shows me all the time "line in"

    .. and manually I put on headphones and then I hear of helmet, after computer to start again I have to do the same thing and here again I can hear the voice of helmet, I have separate headset, mic is good and shows jack rear panel but helmet appears

  • Stuck in drained batery problem blackBerry smartphones

    Oh boy - I don't know what happened. My blkberry ran too low - got the last warning. Just as I inserted the adapter charger battery empty message stop Pocket came. The problem is its stuck on the screen. The blberry never * beep * face-down. I'm not