Error: Can't find an instance with uuid...

1
0
-1

Hello,

I'm using Bonita 5.10.1

I'm using the API Rest Bonita to execute a process from a external Java application. At development environment, it work fine, the web app connect with API and run the process.

Now, I have deployed at a production environment (using JBOSS), and all work fine too, except for one case. The process on Bonita is also launched through the API, but in some cases, I pick up some files from a share resource, and save it at process var doing the next:

                String domain;
                NtlmPasswordAuthentication auth = new NtlmPasswordAuthentication("",configuracion.getFileUser(), configuracion.getFilePass());
                SmbFile smbFile;
                SmbFileInputStream smbfin;
                byte[] fileContent;
                domain = "smb:" + configuracion.getFileDomain() + notificacion.getCodigoNotificacion() + "/Registro/" + notificacion.getAdjuntosRegistro()[0];
               
                smbFile = new SmbFile(domain,auth);
                smbfin = new SmbFileInputStream(smbFile);
               
                fileContent = new byte[(int)smbFile.length()];
                smbfin.read(fileContent);
               
                AccessorUtil.getRuntimeAPI().createDocumentOrAddDocumentVersion(processInstance.getProcessInstanceUUID(), "adjuntoRegistro1",  notificacion.getAdjuntosRegistro()[0], "",fileContent);

If I run the process on Bonita in isolation, the file gets collected successfully, but if I execute the process through the API from the Java web app, I caught the next exception:

Can't find an instance with uuid SMS_Gestion_de_notificacion_de_peligro_potencial--1.0--30

The error is located exactly when I use the UUID of the process instance in this line:

AccessorUtil.getRuntimeAPI().createDocumentOrAddDocumentVersion(processInstance.getProcessInstanceUUID(), "adjuntoRegistro1",  notificacion.getAdjuntosRegistro()[0], "",fileContent);

Researching for this topic, I have detected something strange that I think is related. If I reinstall the process at Bonita User Experience, and run the process in isolation, the instances get a UUID starting at 1 (ProcessName--Version--1). However, If I run the process through the API, the UUID instance process start at the last number that was executed (ProcessName--Version--31). I think this may be the reason for not find the process instance with the UUID, but really this instance exists and is the instance fail.

¿Some help please?

Thanks!

Regards

No answers yet.
Notifications