Fount the issue when using both a pre filter, then running converters and mapping, then running a post filter.
Can be reproduced with:
$reader = new ArrayReader([['id'=>1],['id'=>2]]);
$workflow = new StepAggregator($reader);
$workflow->setSkipItemOnFailure(true);
$validator = $this->getContainer()->get('validator');
$preFilter = new ValidatorFilter($validator);
$preFilter->throwExceptions(false);
$preFilter->add('id', new Assert\EqualTo(['value'=>2]));
$postFilter = new ValidatorFilter($validator);
$postFilter->throwExceptions(false);
$postFilter->add('id', new Assert\EqualTo(['value'=>1]));
$workflow->addStep((new FilterStep())->add($preFilter),2);
$workflow->addStep((new FilterStep())->add($postFilter),1);
$workflow->process();
var_dump(array_keys($postFilter->getViolations()), array_keys($postFilter->getViolations()));
Returns:
array(1) {
[0]=>
int(1)
}
array(1) {
[0]=>
int(1)
}
Expected:
array(1) {
[0]=>
int(1)
}
array(1) {
[0]=>
int(2)
}