Checking file size
I would like to add a check in my process flow on whether or not a LAN file source has size > 0. If the size is 0, I do not want to process the file. If the size is >0 I would like to process the file.
Is there a way to test on the file size within a process flow? (I don’t want to have to map the file since several different types of files are processed by this flow, so I don’t want to do a count() within a map.)
-
This can be achieved in the process flow by using the gateway and applying a java condition at the output of the gateway which will check the File Size and if the File Size is > 0 it will execute the process flow and in case if File Size <= 0 will follow the default path and can be directed to other target like mail notification etc...
You can implement this by creating context variable using PutContextVar under action in Repository View and providing Variable Value as $$Service.ActivityName.OperationCount$$ and VariableName.Then in gateway use the java condition where you can get the size using the code " Integer.parseInt(context.get("VariableName"));" and then provide the IF condition which will check the File Size and perform the required operation.
0
Post is closed for comments.
Comments
1 comment