如何在activiti

时间:2015-12-02 12:16:09

标签: activiti owner

我正在创建一个非常简单的工作流程:

<process id="test" name="test" isExecutable="true">
    <startEvent id="start" name="start" activiti:initiator="initiator"></startEvent>
    <userTask id="user" name="ownertask" activiti:candidateGroups="management"></userTask>
    <endEvent id="end" name="end"></endEvent>
    <sequenceFlow id="flow1" name="flow1" sourceRef="start" targetRef="user"></sequenceFlow>
    <sequenceFlow id="flow2" name="flow2" sourceRef="user" targetRef="end"></sequenceFlow>
  </process>

我想为此流程实例定义“所有者”。我怎么能做到这一点。任何帮助表示赞赏。

1 个答案:

答案 0 :(得分:0)

所有者设置为流程实例变量:

Map<String, Object> parameters = new HashMap<>();
parameters.put("Owner", "John");    
runtimeService.startProcessInstanceByKey("test", parameters);