How to move original document to Processed folder without without creating any batches to Processed folder after imported

Question:

After importing the document from hot-folder, the original document will move to the Processed folder where FlexiCapture will create the sub-folder with batch name according to the imported batch.

How to move the original image out of the batch name and place all imported images in the Processed folder without its batch name folder?

Solution:

In Document Definition, create 4 fields:
ImageSourceImportPathSF, BatchnameSF, ProcesedBatchPath, and ImageFileNameOnly

where:

ImageSourceImportPathSF is the ImageSource from the Data Source tab

mceclip3.png

 

BatchNameSF is the batch name from the Data Source tab

mceclip4.png

 

Under ProcessedBatchPath, create a Rule script where we are going to retrieve the image file name and the path of the Processed path and put these value in the fields ImageFileNameOnly and ProcessedBatchPath such as:

mceclip5.png

 

Then under advance workflow, at any stage after importing the image, you can create a custom workflow script to move the images from the Processed\sub-batch-folder-name to the Processed folder such as:

mceclip1.png

Give your workflow name such as: Move ProcessedBatchImageScript

mceclip0.png

and paste this script in the Document processing

mceclip2.png

 

string filename = Document.Field("Invoice\\ImageFileNameOnly").Text;
string originalpath = Document.Field("Invoice\\ProcessedBatchPath").Text + "\\" + Document.Field("Invoice\\BatchNameSF").Text + "\\" + filename;
string desiredpath = Document.Field("Invoice\\ProcessedBatchPath").Text + "\\" + filename;

Processing.ReportMessage("originalpath: " + originalpath);
Processing.ReportMessage("desiredpath: " + desiredpath);

System.IO.File.Copy(originalpath, desiredpath, true);

 

Have more questions? Submit a request

Comments

0 comments

Please sign in to leave a comment.