Activiti专用网关-在Java中使用 [英] Activiti exclusive gateway - using in Java

查看:350
本文介绍了Activiti专用网关-在Java中使用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Activiti中有一个专用网关,如何在Java代码中为专用网关设置条件变量?

I have an exclusive gateway in Activiti, how I can set the condition variable in Java code for exclusive gateway?

variableData.put("condition", conditionVar);
taskService.complete(task.getId(), variableData);

如何在网关流上提取任务变量?

How I can extract task variable on gateway flow? Is it possible or I have to use process variable?

推荐答案

使用条件互斥网关设计工作流时,它将生成XML如下所示,

When you design your workflow with conditional exclusive gateway then it will generate XML like below,

<exclusiveGateway id="exclusiveGw" name="Exclusive Gateway" />

<sequenceFlow id="flow2" sourceRef="exclusiveGw" targetRef="theTask1">
  <conditionExpression xsi:type="tFormalExpression">${input == 1}</conditionExpression>
</sequenceFlow>

所以您需要提供'input'变量为

variableData.put( input,1);

如果您的任务是 ServiceTask ,则可以按以下方式操作

If your task is ServiceTask then you can do like below

delegateExecution.setVariable("input",1);

要获取更多帮助,请 http://www.activiti.org/userguide/#bpmnExclusiveGateway

这篇关于Activiti专用网关-在Java中使用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆