我想要将所有正在运行的流程实例的信息存储在 act_proc_in_ 表下的 H2 数据库中。(如 starttime、endtime、author..)
我在 ExecutionListener 方法(在实现 JavaDelegate 接口的类中)中,我需要进一步转发信息。
我知道带有 createExecutionQuery() 方法的 RuntimeService 接口,但在我看到的所有示例中,它似乎都映射到某种实体类。我不明白。抱歉,我是 Camunda BPM 引擎的新手。
public class ProcessRequestDelegate implements JavaDelegate {
private final static Logger LOGGER = Logger.getLogger("LOAN-REQUESTS");
public void execute(DelegateExecution execution) throws Exception { LOGGER.info("Processing request by '"+execution.getVariable("customerId")+"'...");
System.out.println(execution.getVariable("amount"));
int Amount= ((Double) execution.getVariable("amount")).intValue(); System.out.println("Amountis"+Amount);
ProcessEngine processEngine = BpmPlatform.getDefaultProcessEngine();
RuntimeService runtimeService = processEngine.getRuntimeService();
ResulstSet rs= runtimeService.createExecutionQuery("What to write here?");
while (rs.next()) {
String author=rs.getString("AUTHOR");
Date start = rs.getDate("START_TIME");
int sales = rs.getInt("SALES");
} }