Hi All

I have to delete all the records from the DB if there is a file at a given path before processing the record of new file else don't delete the record from DB.

if(fileExist){
delete the existing records from a table ABC Then process new file
}
else {
Don't delete the existing records from ABC table.
}

Can any one suggest me some solution how to make my job in different steps.

Below is the piece of code. I am executing my batch through command prompt.

Code:
<job id="paymentRecordLoadJob" xmlns="http://www.springframework.org/schema/batch">
	
		
		<step id="paymentRecordLoad" >
			<tasklet>
				<chunk reader="paymentRecordReader" writer="paymentRecordWriter" 
	                   commit-interval="2" skip-limit="10000">
	                    <skippable-exception-classes>
			         		<include class="org.springframework.dao.DuplicateKeyException"/>
			         		<include class="com.abc.pq.batch.exception.PaymentRecordProcessingException"/>
			      		</skippable-exception-classes>
			    </chunk> 
			</tasklet>
		</step>
		
</job>
Within this job i have to manage that if else condition.