We are close to completing a proof of concept (PoC) on Camunda wherein we are not using the Camunda out of box applications (Task list, Cockpit etc.) instead we have built a custom application in JSP. We are making REST API calls from our custom application to the Camunda process engine to initiate the workflow, maintain and update process variables, claim tasks, get pending tasks, complete tasks, get history related data, etc.
During the course of doing the PoC, the following queries have come up
Distributed Commit - We wanted to ascertain if there are any best practices that can be followed while making a Distributed Commit to manage distributed atomic transactions at places where we need to update our Custom Application database as well as use REST API calls to update the Camunda Application database. Are there any best practices that can be followed for the same?
Exception Management - Consider a scenario in which some exception occurs at Runtime during the execution of the Process definition. Will the Camunda process engine handle such a situation by rolling back the transaction to the previous User task with all the updated process variables rolled back to the older revision OR Should such scenarios be managed at the Custom Application level where we catch such an exception and rollback the transaction to an older revision using REST API calls? We certainly can roll back the process variables to an older revision but can we rollback the process instance execution to a previous task using REST API calls?
User Information Management - In our POC, there are two databases, one is the Custom Application database and the other is the Camunda database. As per our understanding, both these databases need to have the same list of users which leads to a situation of duplication wherein whenever we create users in our Custom Application, the same user should also get created in the Camunda database. Is this the right way to carry out things and, if so, should we use REST API calls to synchronize the users in the application with the users in Camunda or is there any other approach that needs to be followed?
Business Rules - Currently, for implementing a business rule, we are using DMN with a single input process variable (region) to re-route a document to a region-specific group. Currently, we update a process variable in the Camunda application by making a REST API call from the Custom Application and, based on that process variable, business rule decisions are made by DMN. We wanted to check if, instead of using process variable sent by the Custom Application, is it possible to pull the updated value of the process variable from the Application database when required? Additionally, we also wanted to understand about the complexity of the business rules that can be handled via DMN?
Process Definition Versioning - There may be situations in which we would need to update the Process definition as per some new use cases and we may require the running process instances to continue their execution in the latest version instead the version they were initially started in. Basis the documentation, we understand that Camunda does possess such a capability but to a limited extent. We wanted to understand about the level of changes that may be required to migrate the running process instances to the latest version as well as what are the associated limitations?
Reporting - In our project, we have the need the support of reporting especially from the perspective of obtaining the history on the process instances. For this, should the Custom Application directly access and query the Camunda database OR should REST API calls be made to fetch the historical data? In these reports, we may also require duration details for the entire process instance execution excluding some tasks that might be irrelevant from an execution standpoint. How can this be achieved?
SLA’s & Prioritization - We may also require the capability of determining due dates for completion of a process instances wherein if any process instance is close to expiration then in our Custom Application, we need to bump up the Priority of the document corresponding to that process instance to Urgent. We understand that Priority and Due date can be mentioned for User tasks but can they also be leveraged for Process instances as well?
Kindly share your suggestions for the above mentioned queries.
Thanks in advance.