To fulfill this please follow the below steps :
1) Make a Source activity and connect it to Source Schema. Source file may have both values, it may be correct(which meets the condition) or erroneous(which doesn't meet the condition).
2) Connect the Source Schema to the Mapping activity.
3) Load only one schema at Source end whereas two schemas at Target end in the mapper ( i.e. one for correct record and other for wrong record).
4) Use "IF" condition in the mapping. If condition meets then it will filter the value to one of the Target Schema(in which we have mapped true condition) else it will filter the value to another target schema(in which we have mapped false condition).
Now, mapping activity will generate two streams as we have loaded and mapped two Schemas at target end in Mapper. Attach these generated streams to the respective Target Schemas in the Process Flow through the Multiple Stream feature.
5) Connect the Target file along with the respective Target Schema.
6) Use the PutContextVar Activity with that Target file which has incorrect records(false condition records) in it. And assign the Variable name and Variable Value.
Variable Name : Give it as per your requirements(e.g. varError).
Variable Value : $$Service.<<ErrorTargetFileActivityName>>.OperationCount$$
7) Use Gateway activity and connect it with the End Event through Default Sequence Flow. On the other hand use the Mail Notification in between Gateway activity and End Event connected through Sequencial Flow.
8) Double click over the Sequence Flow coming from the Gateway activity to Mail Notification and follow the below steps:
A) Click over Edit Condition of Properties
B) Process Flow Variable Condition
C) Other Condition
D) Enter the arbitrary name-value as below :
-> Name (VariableName which you have given in PutContextVar activity e.g. varError)
-> Operands Type
Following these steps will send a mail notification when error records are generated during the execution of Process Flow. You may refer to the attached screenshot of Process Flow.