I have files to be transferred using Nifi flow as ListFile->FetchFile->PutFile processor.
But I want the PutFile processor to execute/trigger only if a given condition is true (let's say if the attribute value of the flow file is equal to given value). Please tell me how to achieve this and what processor must be placed between FetchFile and PutFile processor in the above-given flow.
The PutFile is going to execute base on its configured run schedule (Timer Driven Execution) or cron schedule (Cron Driven Execution). If you are adding an attribute to the FlowFile that you are using to evaluate a boolean true or false, the best approach is to add a RouteOnAttribute processor between your FetchFile and PutFile processors to redirect those FlowFiles where your condition does not resolve to "true". In this way you selectively decide which FlowFiles to pass to the putFile to be executed upon.
As far as the RouteOnAttribute, it will have an unmatched relationship and you add dynamic properties which become new relationships that can be associated with different connections.
You can use NiFi Expression Language (NEL)  to construct a boolean statement to evaluate your routing condition.