How can I get the last version of the process?

Hi,

I’m starting a new process in a Groovy Script. The problem is that one of the parameters of the getProcessDefinitionId method is the process version, so, in the future when I change the version of the second process I will need to redeploy the first process.

Is there any way to instantiate the last version of a process? This is my code

 Long processId = apiAccessor.processAPI.getProcessDefinitionId("Process2", "1.0");
 apiAccessor.processAPI.startProcessWithInputs(usuario_proveedor, processId, proveedorInput);

Thank you very much.

1 Like

Hi lem981,

You should use this method (of processAPI) instead :

long getLatestProcessDefinitionId(String processName)  throws ProcessDefinitionNotFoundException

Returns the identifier of the most recently deployed process definition with the given name. This method does not take into consideration the process version, but only its deployment date.

Cheers,

Mehdi Kettani

That is exactly what I needed. Thank you very much.