AnsweredAssumed Answered

How to create HashMap with pair value as list of items in Boomi

Question asked by anup.narayanan153669 on Aug 22, 2017
Latest reply on Aug 23, 2017 by daniel.santana

Hi,

 

I have a requirement where I need to send the data as a FTP from Salesforce to DW. But I need to do some kind of hashmap before I send the data. The object and fields are as follows:

  • ExampleObject__c - Object
  • Fields:
    • Case__c - Lookup(Master) - Case is the Parent of EO(ExampleObject).
    • Rent__c - Text
    • Type__c - Picklist
    • Service__c - Picklist

Data:

  1. EO1 (Case1, '1000', 'Towing', '')
  2. EO2 (Case2, '1200', 'Towing', '')
  3. EO3 (Case1, '500', 'Additional', 'Hotel')
  4. EO4 (Case2, '250', 'Additional', 'Taxi')
  5. EO5 (Case1, '1500', 'Towing', '')
  6. EO6 (Case1, '100', ''Additional', 'Taxi')

 

What I would like to do is that when the EO records are queried from Salesforce, I want to create something like a hashmap with key as the Case and pair value as list of the EO records whose type is Additional(Map<String,List<ExampleObject__c>>) for the Records returned by SF. Then process the EO records individually and get the Case and find respective EOs whose type is Additional and map it to the first matched record.

 

Map should be like follows:

Case1 : [EO3, EO6]

Case2 : [EO4]

 

So from the above example, the request profile should be something like this:

<EO1>

   <Case>Case1</Case>

   <Rent>1000</Rent>

   <Type>Towing</Type>

   <ServiceRate1>500</ServiceRate1>        -----------------------------> From EO3

   <ServiceType1>Hotel</ServiceType1>   -----------------------------> From EO3

   <ServiceRate2>100</ServiceRate2>

   <ServiceType2>Taxi</ServiceType2>

<EO1>

 

<EO2>

   <Case>Case2</Case>

   <Rent>1200</Rent>

   <Type>Towing</Type>

   <ServiceRate1>250</ServiceRate1>        -----------------------------> From EO4

   <ServiceType1>Taxi</ServiceType1>       -----------------------------> From EO4

   <ServiceRate2></ServiceRate2>

   <ServiceType2></ServiceType2>

<EO2>

 

<EO5>

   <Case>Case1</Case>

   <Rent>1500</Rent>

   <Type>Towing</Type>

  <ServiceRate1></ServiceRate1> 

   <ServiceType1></ServiceType1> -----------------------------> Nothing should be copied from EO3 as its already added to EO1 even though they have the same Case. Same for the ServiceRate field too.

   <ServiceRate2></ServiceRate2>

   <ServiceType2></ServiceType2>

<EO5>

 

Please let me know if there are any possible approaches for this or else I would consider to process the mapping and create the request in Salesforce and then send it through Boomi to the DWH.

 

Any help is appreciated. Thanks in advance!!

 

Best Regards,

Anup

Outcomes