Is there any advantage of using a Data Flow instead of File Listener for processing a file from the Repository location.
And how will we make sure that the data flow listens to the location for the receiving of the file and how to move that File out of that location once the file is processed.
@ShwetaB96 in the data set you will be providing specific file path location, so data flow will listen only to that set of files fetched by data set.
Advantage is data flow can process multiple files at a time using partitions and threads, and Leader node takes care of distributing tasks to various partitions. So it’s very much efficient than file listener.
To move the file out of that repository and place it new location, you would need to use repository apis. You can get the stream and with that you can use create file api to create file in the new repository and to delete from the current repository you can use delete file api.
Thanks Anoop for your response , I explored regarding Repository apis but this has the functionality of delete and not of move . If something goes incorrect then we will not have the original data and it will be lost so we wanted to move the file to a different path rather than deleting it altogether.
You can use a combination of D_pxGetFile which will return the content of the file you want to move from one location to the other followed by calling D_pxNewFile which will create the file in a different location (destination) followed by D_pxDelete which will finally delete the file from source location.
@ShwetaB96 please check what is happening in the background with this functionality. You can make some tweaks and implement the same to move the file. This moves file from pega to repo, instead of fetching file from pega, you can replace the code with fetching file from existing folder.
@ShwetaB96 : We have PEGA OOTB activity (i.e. pxCopyFromRepository) which uses PEGA repository API’s to copy the File from one Location to another, It is possible to combine this OOTB activity with D_pxDeleteFile API to get the desired result.