wMDeveloper 6.1: Select/Filter out records of a IS Document through Branch&Map Steps

Hello.

I discovered this forum a couple of weeks ago and it already helped me with two issues that I had, just by browsing and searching the threads. Now however I am stumped so here is my issue:

We are using wMDeveloper 6.1 and IS 6.1 on a Windows 2000 server in conjunction with EnterpriseOne E8.12 and Web Services Gateway WSG from JDEdwards (Peoplesoft/Oracle) on an IBM i-series As400.

My current project involves taking all records of a table from E8.12 and importing the data using Developer so that soem of the records of the table can be sent to each of ten different locations whereby each location gets a different set of records. The value of the CustSearchType variable within the records dteremines whether the record gets sent to a location or not.

I have been testing this with six records right now.

I created an adapter service to bring the records from the E812 tbale into WSG into an IS document based on a flatfile schema I created. The IS document has a datawithnorecordID label. After initial problems I was able to succesfully convert the records to a string and then ftp the data out to the receiving test server.

What I am struggling with right now are the flow steps to select/filter the necessary records based on the CustSearchType value for each of the locations.

I created a LOOP step over /Data/recordwithnoid so that the flow goes through the records of the IS document one by one. I then created a BRACN step on /Data/recordwithnoid/custsearchtype and then a MAP step with the Label C35 so that only records with CustSearchType C35 get mapped. I mapped the records from /Data into /DataGFS which was created in the pipeline as a document reference to /Data. I mapped the /Data/recordwithnoid to /DataGFS/recordwithnoid and if there is only one record it works fine but if there are more that fit the criteria then the second records overwrites the first one and so one leaving me in the end just with the last record. It looks like /DataGFS only accepts one record that way. Any idea how I can get the multilpe records into /DataGFS?

A Secondary question would be if I have a location that only needs either C17 or C35 records can I do that in one MAP step. What would be the proper synthax on the label: C17|C35 or C17||C35. I can’t test this of course until I get my other problem resolved.

Thank you for your time.

Mike

Mike,

“A Secondary question would be if I have a location that only needs either C17 or C35 records can I do that in one MAP step. What would be the proper synthax on the label: C17|C35 or C17||C35”

–For this You need to use a Branch step (set Evaluate Label=true) and put a map step under this with Label: %location% = ‘C17’ || %location% = ‘C35’

Branch [Evaluate Label = True]
—Map label(%location% = ‘C17’ || %location% = ‘C35’)
—Map label $default

Also make sure location present in the pipeline.

HTH,
RM

RM,

Thanks for the quick reply. I will try that once I have resolved my other issue.

Thanks

Mike
:slight_smile:

Sorry i am lit confused of your first question.so can you give more details or some sort of screen shots of your flow step that causing problem.

HTH,
RMG

Oh I am attaching a word document with some screen shots that hopefully make the issue a bit clearer of what I am trying to do.

Tried to send a bigger file but I guess I can only upload up to 100KB so I am bit limited at what I can send.

Thanks

Mike

Mike,

I looked your document,here is the following that you need to do for building the expected DataGFS recordset…

You need to use appendToDocumentList service inorder to do this its little tricky thing though.If you are still confused on using this service there are lot of threads discussed in this forum on how to use pub.list:appendToDocumentList service and tricks.

In the loop(/Data/recordWithNoID) and under the Branch step where the C35 condition invoke this append service in the flow located in the WmPublic

appendToDocumentList( map serviceIn fromItem (Data/recordWithNoID) and map toList from the DataGFS/recordWithNoID) in the serviceOut map toList again to DataGFS/recordWithNoID) and in the pipelineout drop the fromItem,Data record immediately and continue to looping until the filter condition satisfies and when the looping of Data is done come out of the loop and check the pipeline results you should see the DataGFS recordlist (with all the expected filter records of C35) and if you want incorporate the above said Branch condition for filtering.

Note:This appendToDocumentList service eats some memory during runtime in case your Data documentlist is huge recordset…

HTH,
RMG

“… is huge recordset”

“Huge” in this case may only be a few hundred records. Be careful with the appendToDocumentList approach. In dev and testing everything might look great. Then on day 1 of production, when real data volumes hit, it might fail.

You might consider another approach.

For each of your targets, use a separate process. The process might share some services, but make each independent.

For each, create SQL that will retrieve only the records for that target, using the appropriate where clause. Then you don’t need to filter the records in your FLOW services. Just format and send.

Mike,

I agree with Rob and think about it…But appendToDocumentList can do the work that you are looking for as an alternative step.There are quite some threads that weighs pros & cons on using appendToDocumentList, pls search the forum in your free time.

HTH,
RMG

RMG and Rob,

thanks both for your suggestions and help. Rob, I think I will go with your solution. That is slick. Just do the select in my adapterservice that I use to get the data into the flow service.

I will have to create multiple adapter services but that’s no biggie. This should work.

Awesome!!

Thank you both for your valuable input.

Mike

RMG,

I will check the appendtodocumentlist out also if not just for future reference. Thanks for such speedy responses and communications. I appreciate both your help.

Mike

You should be able to use just one adapter service. Define one that will accept inputs for the where clause. That way you won’t have 10 adapter services. Just one that is called 10 different ways.

Rob,

great idea - however the selection is not always the same amount of where statements. For example for one location it is where ati = ‘C35’ for another one it could be: where ati <> ‘C17’ and ati <> ‘C35’ and for a third one it could be where ati = ‘C’ or ati =‘C90’ or ati = ‘C35’. I can combine a couple of them that have the same amount of and/or statements in the where clause but not all of them in one adapter service, especially since the JDBC adapter that I am using does not allow “in” so I can not create statements like: where ati in(‘C’,‘C90’,‘C35’).

But thanks - I see there are many options available and that is great.

Mike

Hi all,
I’d like to take up this old thread as I have a similar requirement. In my case I get a huge XML document where I’m not able to filter out the required LineItems like described in this thread (using different SQL statements). This means I’ll have to work with this big document (~13000 Items) and I’ll have to filter the relevant ones based on filter conditions. As a result I assume about having ~11000 Items in the target XML structure.

So in my case I cannot simply loop with input / output array and I’ve read several times that I should avoid appendToDocumentList for huge arrays (like in my case). So what’s best approach for this? If it is a Java Service, does anybody have a code sample for a efficient (from performance point of view) Java Service which copies a document based on a filter condition (= a field in the source structure which matches a criteria)? Basically I want to achieve the same the appendToDocumentList service does with a branch condition :wink:

Regards
Boris

Hi all,
I’d like to take up this old thread as I have a similar requirement. In my case I get a huge XML document where I’m not able to filter out the required LineItems like described in this thread (using different SQL statements). This means I’ll have to work with this big document (~13000 Items) and I’ll have to filter the relevant ones based on filter conditions. As a result I assume about having ~11000 Items in the target XML structure.

So in my case I cannot simply loop with input / output array and I’ve read several times that I should avoid appendToDocumentList for huge arrays (like in my case). So what’s best approach for this? If it is a Java Service, does anybody have a code sample for a efficient (from performance point of view) Java Service which copies a document based on a filter condition (= a field in the source structure which matches a criteria)? Basically I want to achieve the same the appendToDocumentList service does with a branch condition :wink:

Regards
Boris

In a recent test of appendTo**List on an IBM JVM using IS 7.1.2, the performance issue I’ve previously observed did not surface. I may be worthwhile testing this on your environment to see if performance will be acceptable. Of course you’ll still need to consider the amount of memory used, regardless of how fast the append performs.

Another approach is to write a couple of simple Java services to create a LinkedList of items. Then when finish appending, do a toArray on the LinkedList to get your string/document list.

HTH.

Hi,
I am trying to execute MAP flow step under the BRANCH flow step. But MAP1 is not executing and going to the MAP2 and executing. I want MAP1 flow step to be executed. Did I do any mistakes while giving the properties of MAP1.
Can Any one suggest me where I am doing wrong in this situation.

Thanks
KRK
map1.docx (67.3 KB)

Hi Vamsi,

Can you tell us when do you want the first MAP step to be executed? Syntactically, your first MAP step is not correct.
If you can tell us the requirement, we can guide you.

Regards,
Ashok

Hi Vamsi,

what Ashok is referring to is that you have an extra %-sign at the end of your label for Step 1.

Hopefully you have that the “Evaluate Labels”-Property of the Branch to true.

If it is a simple expression, you can put the field name in the “Switch on” property of the Branch and set “Evaluate labels” to false.
Give the possible outcomes as labels to the steps:
Step1: $null
Step2: $default

Please note that $null just captures the absence of the whole field in the structure, but not its existence with length being zero.

Regards,
Holger