looping in writeTodataStoreEntity

Hi,

I am getting huge amount of data and needs to write it in database. Its taking so much time 

Have used 

a!writeTodataStoreEntity(dataStoreEntity:cons!APM_DSE_VALUES, valueToStore: local!data)

In local!data  am calling rule

Can someone help me how to convert it in forEach loop or in batches.

Please help with code

  Discussion posts and replies are publicly visible