viernes, 15 de junio de 2012

Creacion variables attachment

import org.ow2.bonita.facade.RuntimeAPI;
import org.apache.commons.io.FileUtils;

RuntimeAPI runtimeAPI = apiAccessor.getRuntimeAPI();

File file = new File("archivo.pdf");

long length = file.length();

byte[] bytes = new byte[(int) length];

bytes = FileUtils.readFileToByteArray(file);

runtimeAPI.createDocument("PoderRatificacion", processInstance.getProcessInstanceUUID(), "Poder Ratificacion.pdf", "application/pdf", bytes);