Последняя задача процесса Camunda должна записать файлы, загруженные пользователем, в определенную папку. Итак, я создал следующую «служебную задачу» как последнюю из процесса:
Затем из проекта Java я добавил класс FinishArchiveDelegate
со следующим кодом:
package com.ower.abpar.agreements;
import org.camunda.bpm.engine.delegate.DelegateExecution;
import org.camunda.bpm.engine.delegate.JavaDelegate;
public class FinishArchiveDelegate implements JavaDelegate {
@Override
public void execute(DelegateExecution execution) throws Exception {
System.out.println("Process finished: "+execution.getVariables());
}
}
Когда я проверяю журналы, я вижу, что вижу имена документов, например:
document_1 => FileValueImpl [mimeType=image/jpeg, filename=Test_agreement1.jpg, type=file, isTransient=false]
Проблема в том, что он показывает только имя файла, и мне нужно было бы запросить его из базы данных Камунды, чтобы скопировать его в другую папку. Любое предложение или идея?
Спасибо!