Usecase: Here we will see a design how we can import to Cloud ERP and get a Custom callback.
Implementation Steps:
Follow the below design steps:
- First source file is there in a SFTP location. So we will list files of the location using SFTP connection
- We can have multiple files, so we will iterate over the file references and take a body scope
- Download each file to stage location
- Write header field names to a header file.
- Write LineHeader names to a Line file
- Read file reference from the download response using stage File action and CSV file sample.
- For each file record,
- Put a switch activity and check of 1st column of the field(Transaction_Identifier) = Header ,
- Then appends the header details to the header file
- If Transaction_Identifier = Line,
- You can map the line records to the Line file
- Take a debit and credit line counts, total debit and total credit line counts etc
- If your file has Trailer part , check if Transaction_Identifier = Trailer,
- Take the all the trailer record counts like total debit line count, total credit line counts, total debit amount, total credit amount , total lines etc
- We can also map the line records outside of the for each record loop using a Stage Read in Segments so that the performance can improve, In the XSLT , we have to check if the record identifer =Line, then go for the line record mapping to line file.
- Write Metadata file like Metadata version number and Application short name etc if needed
- Zip all these 3 files - header, Line and Metadata using stage file action
- We can keep a back up of the zip file by calling a sub Integration (File_Handler) to archive the file to a FTP location
- Now we can validate the Trailer information with the record level all the counts like total debit line , total credit line, total debit amt, total credit amt , total lines etc. Once this switch checks success
- We can create OIC level control file
- Now we call call sub integration (Encrypt_Import) to encrypt and import the zip file to Cloud ERP. We can do following 3 way of import.
- Old method - Multi step : https://soalicious.blogspot.com/2021/05/oic-erp-import-technique-1.html
- ImportBulkData operation of ERPIntegrationService: https://soalicious.blogspot.com/2021/05/oic-import-to-erp-technique-2-bulk-data.html
- New 1 step method - import Bulk Data : https://soalicious.blogspot.com/2022/02/oic-erp-supplier-bulk-import-and.html
- Check import process status using getESSJobStatus
- Capture Child Process id of the import process if any
- Check the child process status again using getESSJobStatus
- Call CallBack sub Integration to get the custom call back
No comments:
Post a Comment