Hi,
I can see that you are trying to filter out work header by filtering on work line and key part is work has multiple lines always so simply using work line table will not filter out work headers while cluster are getting added.
I use below way to filter out the locations which we do not want to be part of system directed cluster picking.
1 - We have a dedicated work template which is used to query all locations which we do not want to pick using cluster. We use work Pool ID "NA for cluster picking" on the work template. As a result, when work is generated from this work template, they get updated with work Pool id "NA for cluster picking"
We keep on adding and removing the locations to this work template on need basis in case some now locations need to be excluded or old blocked locations for cluster picking now need to be taken out of this block and picked via cluster.
2 - I filter out the work headers using the work pool ID in the query for the system directed cluster picking work sequencing.
3 -Now when I use mobile device to perform system directed cluster picking, we can see that the system has not added the above work ID in the cluster as it was filtered in the query.
You are also right in your thought to use work class as a differentiator. In our case due to key dependencies on work classes for other purposes in D365 we could not afford to differentiate sales order using different work classes.