0
次のように
マイBPMNファイルがされています Addition.bpmnCamunda-bpmでプロセスインスタンスを終了する方法は?
を私はRuntimeServiceを使用できるようにタスクを受け取る使用しています以下のように、私はのsayHelloクラスで私のプロセスを始めています:
public void sayHello(ProcessEngine processEngine) {
try {
System.out.println("inside postdeploy ");
variables.put("a", 2);
variables.put("b", 5);
variables.put("c", 0);
ProcessInstance instance= processEngine.getRuntimeService().startProcessInstanceByKey("Process_2", variables);
variables.put("c",processEngine.getRuntimeService().getVariable(instance.getId(), "c"));
Execution execution = processEngine.getRuntimeService().createExecutionQuery()
.processInstanceId(instance.getId())
.activityId("ReceiveTask_16nulbx")
.singleResult();
processEngine.getRuntimeService().signal(execution.getId());
私は私のC変数を設定
public class Calculator implements JavaDelegate {
public void execute(DelegateExecution exe) throws Exception {
System.out.println("Inside calculator again");
Integer x = (Integer) exe.getVariable("a");
Integer y = (Integer) exe.getVariable("b");
int add = x+y;
System.out.println("Addition is"+add);
exe.setVariable("c", add);
}
問題は私のプロセスインスタンスがこれ以降に終了しないことです。 私の質問は、C変数を取得した後でProcessインスタンスを終了する方法です。