Can I update Task Status in Workflow on the basis of Business rules?

As of my knowledge, in Workflow module we can set the status of a Task on the basis of some events.

Can we apply some rules before updating the Task Status. If yes, please explain what type of rules are possible.

Please read out below for more specification around the question.

We want to update the status of a task on the basis of one event but before updating the status, we want to check some rules. For example:

  1. E-commerce Order Fulfillment:

    • Scenario: In an e-commerce system, you want to automatically mark an order as “Ready for Shipment” only if the payment has been successfully processed.
    • Example: We want to update the order status to ‘Ready for Shipment’ only when the payment status is ‘Paid.’
  2. Loan Approval System:

    • Scenario: In a financial institution’s loan approval process, you want to move an application to the “Under Review” status only if all the required documents have been uploaded.
    • Example: "We need to put the loan application ‘Under Review’ status only when all mandatory documents have been successfully uploaded.