Process Instance errors

Certified Senior Developer

Hello everyone,

I am building an Appian process that needs to have only one instance running at a time, since every instance would be inserting to/ truncating the same database table. In order to achieve this, at the beginning of the process I check if the current instance is the oldest among the active instances of the process, through a query to a process report. 

This works just fine, the problem is that I want to also check if the oldest instance has, for whatever reason, a node with error and therefore it's flow has been blocked. This way I could kill that instance or skip it in order not to block the other instances in the queue. What I noticed is that even though a process may have a node with errors, the status in the process report remains "Active", so I couldn't find a way to verify through the Report. Even the functions num_problem_tasks() and num_active_tasks() are not helping. 

Do you guys know of any efficient way to make this control happen?

Thanks in advance 

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Lead Developer

    As a side note, I'd advise a bit of caution when using a process report to manage the number of instances running for a given process model. Process reports can be slow depending on application performance and it is not immune from 'race condition'.

    I would advise using a 'pessimistic locking' strategy to ensure only one process instance if race condition is likely. You can use the Appian objects provided in this app solution here: https://community.appian.com/b/appmarket/posts/pessimistic-locking to achieve this.

    We had a similar use case as you in our application and implemented pessimistic locking as the process reports weren't reliable/quick enough for us.

Reply
  • 0
    Certified Lead Developer

    As a side note, I'd advise a bit of caution when using a process report to manage the number of instances running for a given process model. Process reports can be slow depending on application performance and it is not immune from 'race condition'.

    I would advise using a 'pessimistic locking' strategy to ensure only one process instance if race condition is likely. You can use the Appian objects provided in this app solution here: https://community.appian.com/b/appmarket/posts/pessimistic-locking to achieve this.

    We had a similar use case as you in our application and implemented pessimistic locking as the process reports weren't reliable/quick enough for us.

Children
No Data