Handle node exception and continue process execution

Hi,

Is there any way to handle exception and continue process execution? In other words if error occurs i need to go to  different route (route 2 on print screen). It is not possible to query db to check if error will occur or not.

Simplifies process model. In real case there are much more nodes after writing to db.

  Discussion posts and replies are publicly visible

Parents Reply Children
  • I don't need any email. I need to do other steps when write to data store failed. I need to make sure within one process whether it was completed or not.

  • 0
    Certified Senior Developer
    in reply to Furman

    Unfortunately we do not have any good solution for this.
    Kindly configure some rule or logic after start node  to capture details.

    Thanks,
    Sandeep

  • 0
    Appian Employee
    in reply to Furman

    Can we talk about why the heightened concern regarding write to data store (w2ds) failures?
    This is a long established product feature that's essentially reliable.

    Are you experiencing a high frequency of failures in this node?

  • let me provide more background related to what I want to achieve.

    Problem:

    Imagine CDT with 2 fields (id, name1, name2).  We faced situation that if two users started editing entry of this CDT and user1 change value for field name1, user2 change value for name2 field and then both click on submit button at the same time then write to data store entity updated entry in table and override values provided by one users with values provided by another user.

    Initially I've tried to solve this problem by adding, just before write to data store entity,  another node that was responsible to get latest version of CDT entry from db. This has not resolved the problem.

    In real case scenario CDT has round 15 fields and updating them take 3-5 minutes.

    New solution:

    Based on other Appian Community topics I thought about setting up locks. Steps that I want to fallow:

    1. Create  CDT with column on which unique constraint (text column) is added.

    2. When user1 click on submit button then lock should be added by write to data store entity.

    3. When second user click on submit button then write to data store entity will throw an error.  

    4. If error occurs i want to handle it and force process model to wait 1 minute and then get latest values for main CDT from db.

    5. When write to data store is finished for user1 then lock is removed from db.

    6. Before second write to data store for user2 locked is added by user2

    I also though about using this solution on interfaces. When user click on item (for edit) user is informed that another user started editing this and and changes might be lost.

    I'm open for any comments and suggesting who to address the problem in other way or how setup process model to avoid problem at all.

  • 0
    Appian Employee
    in reply to Furman

    So from what you described, it sounds like you're trying to set up Optimistic Locking. Basically optimistic locking assumes that collisions are rare, so it just fails to write whenever two users attempt to update the same dataset. However, if you expect that simultaneous editing is common, I think you should consider using Pessimistic Locking.

    Pessimistic locking pairs what you already have with functionality on your form to check if the data is already being edited. Then, you could use logic on the form to display a message or prevent users from completing the form at all. This should make the error case much less likely and probably make this design paradigm unnecessary.

    There's lots of other posts about Optimistic / Pessimistic locking, but here's one that I think explains it pretty well. 

  • Yes you are right  I tried to use Pessimistic locking and I tried to use separate table for storing locks but it did not worked as expected.

    Solution that finally worked for me was to setup Process Display Name to variable so I can then use Process Report to get list of active process models. Based on Process Display Name queryProcessAnalytics function returns me this name in c0 which I can use to identify how many people are trying to run same process for same record. Based on that I can wait 2-3 seconds and recheck and write to db if there is only me who run this process.