As we transition to the new Hyland Community, some post links may be temporarily disrupted as we finalize redirects. We apologize for the inconvenience and are working to resolve this as quickly as possible. Details.
file.getFilePath()
import org.ow2.bonita.facade.*; import org.ow2.bonita.facade.impl.StandardAPIAccessorImpl; import org.ow2.bonita.facade.runtime.AttachmentInstance; import org.ow2.bonita.util.AccessorUtil; QueryRuntimeAPI queryRuntimeAPI = new StandardAPIAccessorImpl().getQueryRuntimeAPI(); AttachmentInstance attachment = queryRuntimeAPI.getLastAttachment(processInstance.getProcessInstanceUUID(),file.getName()); byte[] contents = queryRuntimeAPI.getAttachmentValue(attachment); File file = new File(attachment.getFileName()); file.createNewFile(); if (contents != null) { OutputStream os = new FileOutputStream(file); os.write(contents); os.close(); } return file.getAbsolutePath()
y