Rule: An item is deleted

When you create a rule with even An item is Deleted, which triggers a BPM with true conditions, does the BPM run after or before item is deleted?

Answers

  • Hi Lori,

    An interesting question that triggered a try-out from my side.
    Spoiler: It's running before!

    This is what I did:

    • Create a test entity with one property "name"
    • Add webservices with the UPDATE operation (and add a service container to support it)
    • Add the deletion Rule with no condition starting a BPM
    • The BPM does the UPDATE operation via the rootEntityInstanceId setting the name with "Set before delete!"
    • Add the History BB to prove the outcome (with retaining the data after deletion!)
    • Publish it all, create an instance, and delete it.
    • Now have a look in the database (Postgres in my case) for the result: SELECT s_audit_id, convert_from(s_history_data, 'UTF8') from o2aw_tipsprj_generichistoryloglist;

    You might find this "AppWorks Tips" post also interesting!

    //Antal

  • nssmani
    nssmani E Community Moderator

    @Lori Dingman , The BPM will get triggered before deletion of item but the entire process will be in a single transaction. You can make the BPM as long lived if you want it to be out of transaction.