Block a PDM state change if a child has a given state

Hello

I'm looking for a way to prevent a user from changing the state of a file if one of these children is in a given state.

Concretely: I cannot "Submit for approval" an assembly if one (or more) of these children is in a "DEPRECATED" or "FORBIDDEN" state. Is there an easy way to set this up? 

I've already thought of a stream where the child's state is copied into a parent's variable (for example write "0" if the child is in the FORBIDDEN state, write 1 otherwise", but it seems very complex to me, especially if there are a large number of children...

I'm answering myself since I found the solution during the day: just switch to Solidworks 2020 whose new version of the PDM add-in allows this flow condition!