activiti入门系列文章6 - Process流程配置

Process标签配置

通过源码查看该类有哪些属性:

public class Process extends BaseElement implements FlowElementsContainer, HasExecutionListeners {
  protected String name;
  //可执行
  protected boolean executable = true;
  protected String documentation;
  protected IOSpecification ioSpecification;
  //执行监听器
  protected List<ActivitiListener> executionListeners = new ArrayList<ActivitiListener>();
  protected List<Lane> lanes = new ArrayList<Lane>();
  protected List<FlowElement> flowElementList = new ArrayList<FlowElement>();
  //数据实体
  protected List<ValuedDataObject> dataObjects = new ArrayList<ValuedDataObject>();
  protected List<Artifact> artifactList = new ArrayList<Artifact>();
  //候选启动人
  protected List<String> candidateStarterUsers = new ArrayList<String>();
  //候选启动组
  protected List<String> candidateStarterGroups = new ArrayList<String>();
  protected List<EventListener> eventListeners = new ArrayList<EventListener>();
  protected Map<String, FlowElement> flowElementMap = new LinkedHashMap<String, FlowElement>();
   
  // Added during process definition parsing
  protected FlowElement initialFlowElement;
  ...

namespace主要用于做分类

id主要用于发布流程的key

candidate Strarter Users 候选人 。多个用逗号分隔 。 该流程所属于的人

candidate Strarter Groups 候选组 。多个用逗号分隔 。该流程所属于的组

<process id="potentialStarter" activiti:candidateStarterUsers="user1, user2"  
                                            activiti:candidateStarterGroups="group1">

代码:

identityService.setAuthenticatedUserId(authenticatedUserId);
<startEvent id="startEvent1" activiti:initiator="shareniuInitiator"></startEvent>

initiator跟启动人配合使用才有意义,否则没有意义。

定义流程初始化授权后,开发者可以使用如下方法获得授权定义。 这些代码可以获得给定的用户可以启动哪些流程定义:

processDefinitions = repositoryService.createProcessDefinitionQuery().startableByUser("userxxx").list();

Data Objects

一条可以公用的数据

BPMN 提供了一种功能,可以在流程定义或子流程中定义数据对象。根据BPMN 规范,流程定义可以包含复杂 XML 结构, 可以导入 XSD 定义。

监听器Listeners

 Java class ,Expression,Delegate expression都有域,其中的值可以传给监听器

(1) Java class

注意:class需要实现接口

org.activiti.engine.delegate.ExecutionListener

(2) Expression

   定义一个表达式类似EL语法。这里的pojo是一个Bean的名称(可以用spring代理),还可以子expression中通过计算一个表达式配置监听器的名称。

Activiti中国社区交流群:839915498

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值