Hi,
I’m using version 7.0.1 Community Edition. I’m searching for a way to prevent a second occurrence of a process from being started if one is currently executing. Does anyone know of a way to do this ?
Brad Pridgeon
1 Like
Hi,
I create a basic example (sorry on 7.0.2) that demonstrate how that can be achieved.
Here is how I did it:
- On process instantiation form I use a form variable to get the process definition id from the page URL
- With a second variable I call the REST API to get the list of currently existing case for the specific process definition (first results page, one result per page for optimization)
- I set a third variable with the result of a JavaScript expression that test if list of case is not empty
- I use this last variable to disable the submit button that allow user to start a case.
Few known limitations:
- Constraints is only enforce at UI level. Process can still be start if user forge a request. You might be able to use custom security rules to prevent that.
- We allow one instance per process-version couple. If you have multiple versions of the same process deployed, user will be able to start one instance of each (usually you only have one definition enable at a time).