Situation:
We have a pre-process flow that will get data based on a field being equal to another field. It will moved the data from the iSeries DB to an XML format to a shared drive on a server. If there is no data, it still creates a file. I have tried to add a decision block and check for a field from the file to be not equal 0 but it still creates them. Suggestions? Because if we have a blank file, the next item is looking for the file to exist; therefore, this will cause issues.
Solution:
-
Use a Gateway activity after the Database Source Activity.
-
Connect the output sequence flow from the gateway to the next activity.
-
Connect the output default sequence flow from the gateway to the end event.
-
Click on the output sequence flow and then click on Edit Condition in the properties.
-
Now select the Condition Type as Java Condition.
-
Provide the below Java Condition:
String Count = (String) context.get("Service.DataBaseSourceName.OperationCount");
if(Count.equals("0"))
return false;
else
return true;
The above steps will check the number of records and if there are zero records then it will not create a file at the target location. Otherwise if records is not equal to zero it will create the file at the target location.
Comments
0 comments
Article is closed for comments.