X++ How to stop sending workflow work item through X++

Hello,

I have requirement that, I have Purch line workflow where it will send workflow work item for each line to approver.

My requirement is that, if PO line has same procurement category it should send only one work item for approval.

let say I have 5 Lines for PO, and 3 of them are procurement category XXX and 2 of them for category YYY.

No I need to send only two work items for approval for the approvers out of five . and once these two approved/Rejected entire PO should get approved/rejected.

Please suggest any class or method to add condition to achieve this.