I have a issue is like, a process is triggered with two identical requests, both instance are in progress hence there is no process-instance id, how can i identify that there is already a request is in progress and cancel any one of instance
Is there any other way, assume my workflow has a start event , service task and end event.
In this scenario how can I avoid duplicate calls , with the same request.
We have a service which will invoke workflow with rest API… due to some error scenario that service is invoking workflow multiple times within a fraction of second, and due to this request is getting processed twice as from workflow point of view it is two independent calls, two process instance will be there.
Is there any other way… even though there is duplicate only once it should process with the same request
Process instance will get created in start event itself. There’s no use of checking process duplication in service task. Handling in service task won’t prevent process duplication. Handle it in createvent in the Start event activity. You can reuse the delegates as listeners in start event execution listener. Start the process instance asynchronously by marking async:before=“true” for the StartEvent in your bpmn.
@aravindhrs ya right., in my case still process is not active , it is still in execution phase right, i see above query returns null .
i have seen query returns true, i process is active and pending at manual test or time event like that.
In this scenario, a query beforehand will always return null, as I assume that the first process instance is not committed in the database when the second process instance is started. Both transactions will overlap and commit sucessfully.
To avoid duplication here, you have to make the business key a unique index the database. Then the second (and all other subsequence processs instances) can not get commited in the database and will throw an exception.