How can I get the process instance errors and save it into any process variable?

Dear community,

I have a start process web api, the process is updating the metadata table.

My facing issue is that API response success even when write to data store entity error.

The expected result should be when process executing error, we can expose the process instance error in web api response body.

Therefore, how can I get the process instance error? then I can save it into process variable, and in the api, we can get it through ProcessInfo.

Thanks in advance for your answers.

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Lead Developer

    Write to datastore also has an onError output that can be configured.

  • yes, you are right. but I use the write to data store entity node in the process, and webapi start this process, not use a!writeToDataStoreEntity() in the interface directly, and my problem is how can I capture the process instance error message and configure back in onError()/onSuccess() outputs?

  • 0
    Certified Associate Developer
    in reply to fantacy

    Hello ,

    I am new to Appian and facing same problem, I am trying to find a way to capture the Process Instance error to a process variable.

    Are you able to achieve this task?

  • 0
    Certified Lead Developer
    in reply to gauravp0007

    Same problem in terms of "Web API starting a process and want to return meaningful error message"?

    Catching errors in processes is automatically done. The process stops and a notification goes to alert receivers. They can resolve the error and restart the nodes. In my experience this is good enough most of the time.

  • 0
    Certified Associate Developer
    in reply to Stefan Helzle

    Thank you for your guidance.

    Please can you take some time and read the below business scenario and guide me if possible :

    Consider we have a Vehicle Maintenance Process A which get initiated based on number of request received by End User.

    Suppose today system received 1000 requests so 1000 instances will get initiated for Vehicle Maintenance Process A.

    In this process we have a database operation steps and due to some reason for all 1000 request this step throw an exception.

    As you mentioned " Catching errors in processes is automatically done. The process steps and a notification goes to alert receivers." -- this is working fine , i just tested it.

    But if we want to catch this exception and create an Exception task for Production support team and display the error message and give them an ability to reprocess this step , then how can we achieve this ?

    In a nutshell -- i want to capture step.error data and save it to process variable and then show it to User.

    Additionally in one of the similar discussion i found one user mentioned something "AppianException class from Appian Java APIs " , is there a way to use this ? if so can you please provide me a reference page.

    I am from IBM BPM background and there we have a JS API tw.system.step.error and Catch Exception control which we use to handle these kind of scenarios.

    Thank You Sir in advance!

  • 0
    Certified Lead Developer
    in reply to gauravp0007

    There is multiple answers on different levels.

    If these system failures happens more often than "almost never", then you might want to think about a different integration pattern. Like a message bus which queues writes and retries.

    Now, about Appian. This is not Java and there is no "Exception Throwing" in Appian. That node paused and will not move until restarted.

    This could be solved by adding a "Receive Message" event which starts that node. With a high number of processes, I would not recommend it.

    Why no make sure that status is tracked in DB and this process can be restarted at any time. Then you would just cancel all paused instances and restart them. This can be done on a nice Ops dashboard using a process report and some utility processes.

    This is just my thoughts, maybe others have better ideas.

  • 0
    Certified Associate Developer
    in reply to Stefan Helzle

    thank you Sir for your response.

Reply Children
No Data