How can I get the last version of the process?

1
+1
-1

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 answer

1
+3
-1
This one is the BEST answer!

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

Comments

Submitted by lem981 on Thu, 02/22/2018 - 17:15

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

Notifications