Hi,
With the latest BPM API, it is now possible to programmatically cancel a process. This cancelling can either be done by a BPM SuperAdmin, or by a user who is part of the assigned Administrators of that particular process.
Since we only want certain users to cancel a process, but not giving them BPM SuperAdmin rights, I need to suspend the given process, assign that user as an administrator, and then I'm able to have them cancel that process.
I have the following code:
ProcessInstanceManager pim = BPMFactory.getProcessInstanceManager(); URI processUri = new URI(BPM_PROCESS_URI + processId); pim.suspend(processUri); // here I should assign the current user as an administrator to the process, but how?? pim.cancel(processUri);
As you can see from the code, I'm missing the part assigning the currently logged in user as an administrator to the process instance. I've searched the BPEM API back to front, but could not find a method or operation to do so.
As a workaround, a BPM administrator now goes into NWA, assign that user as an administrator to the process, and then the user can cancel their process, but this is far from ideal.
Does anyone know of a programmatically suitable solution?
Thanks in advance!
Robin