【发布时间】:2015-05-21 05:13:38
【问题描述】:
我想把所有正在运行的流程实例的信息存储在H2数据库的act_proc_in_表下。(比如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");
} }
【问题讨论】:
-
请正确格式化您的问题
-
我希望这更具可读性?对此感到抱歉。