Use a Product Rule to Invoke a Global Function
From Kyle Topham
Learn to create global functions and invoke them from product rules. In this case, you'll see how to create a function that checks affected items on change orders to determine if each affected item has an attachment. If all affected items have attachments then the change order can move forward to the next status, otherwise it displays an error message and stops the progress of the workflow.