on 03-14-2014 5:49 AM
Hi
has anybody done a BPM that receives in a list of records and then for each one calls a WebService and then checks each response ?.
I've got mine calling the web service for each record (that bit works) but don't know how to marry up the resulting response.
I thought this might be done just with two activites; the first one a parallel-for-each to call the webservice and then a second one to process the responses.
Hi Jonny
Are you trying to use sync-async bridge in NWBPM. I mean your source message will have multiple record and for each record you will make a sync call and then finally send the response back to receiver.
You can do this using the following pattern
The BPM will receive the message containing multiple record. Use two integer and one long variable to count record
use condition in the exclusive choice as when loop count = record count the process will end.
in the sync send step use the generic function 'GET' to send one record at a time
Let me know if you have any doubt on any steps.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Indrajit
FYI : I've created 2 additional data types.
recordcount that is set on Start by a count of rows
counter that is incremented in the output mapping of Call Service activity
But the BPM fails I think due to the setting of the row based on the index.
DO_index is defined as a long as I thought that is what get() requires and it's initial value is 0.
get(DO_dt_DBRigStatusEntry/row/ExternalPositionX,DO_index)
Hi Jonny
As I have told you , we need three variables, two integer and one long.
at the start step we need to set the variable as
loopcount (type int ) to 0
totalcount (type int ) to total count of the rows
dindex ( type long ) to 0.
then at the sync send step we need to use the function 'get' which comes under generic section
then in the increment counter step , we need to map the following
dindex = dindex+1
loopcount = loopcount+1
This should work. If possible please provide the error message you are getting.
It's even easier that that. Just activate the parallel for each loop over the collection. The input mapping will be done with mapping currentCollectionItem to the Service. In the Output mapping, map the output of the Service Calls to another collection. But make sure to select Assignement append (right click on the arrow, assignement->append).
After the calls the data object DO_Output in my example contains the result of all service calls.
The process looks like that, notice the little arrow on the output mapping:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.