I’ve the next situation:
- incoming configuration > Merged Storage
This gives a array of objects eg (Without the first! so, directly a array:
[
{ “id”: 1, “status”: “new”},
{ “id”: 2, “status”: “processed”},
etc…
]
- A route which starts with ‘Chain multiply entity transormers’
- Node, transform nodes (Key accessor)
- Data Transformer > Execute entity transformers
In step 4 I have 3 transformers:
a: checks ‘status’ and adds a KEY in the node (confirm = true or false)
b: Data Transformer > filters > value condition (confirm == true)
c: delete entity from storage
as last (step 5) I generate one array with only the ID’s from al the entities, eg:
{
2, 3
}
the problem is the B (Filter)
the error:
The number of entities returned by the entity transformer should be exactly one, received 0 entities
"class": "Magement\\Entity\\Transformer\\UnexpectedAmountException",
"message": "The number of entities returned by the entity transformer should be exactly one, received 0 entities",
"code": 0,
"file": "/resources/fileshare/deployer/releases/2023-08-10-10-40-43-83f81c7/vendor/magement/entity/src/Transformer/ListTransformerWrapper.php:53"
Right now,. i’m a little bit out of options…
The main goal:
- fetch all the entiies
- add the extra key (confirm)
- filter them base the ‘confirm’ key
- delete and create one array with the IDs only to send it to a ‘outgoing’