将变量从服务任务传递到另一个URL

时间:2020-03-30 08:35:59

标签: camunda camunda-modeler

我正在尝试将变量从服务任务传递到另一个任务,因此可以在该服务任务的URL中传递它。 有人有建议吗?

1 个答案:

答案 0 :(得分:0)

当您需要将数据从一个任务传输到另一任务时,最安全,最灵活的方法是将数据存储在过程变量中。

因此在ServiceTask-A中:

 ...
 public void execute(DelegateExecution ex) {
      ex.setVariable("myUrl",  "https://stackoverflow.com");
 }

和在ServiceTask-B中:

 ...
 public void execute(DelegateExecution ex) {
      String myUrl = (String)ex.getVariable("myUrl");
      // myUrl now contains "https://stackoverflow.com"
 }
相关问题