Activity 工作流引擎

Activiti工作流引擎使用详解 http://blog.csdn.net/m0_37327416/article/details/71743368

Activity用户手册 http://www.mossle.com/docs/activiti/index.html#demo.setup.one.minute.version

学习视频 https://item.taobao.com/item.htm?id=545220457066

简单了解Activity流程图 https://www.cnblogs.com/hellowood23/p/5437909.html

Activity各表详解 http://blog.csdn.net/hj7jay/article/details/51302829

Activity-api https://www.activiti.org/userguide/#_rest_api

Activity与web项目结合 https://www.cnblogs.com/xiaochangwei/p/5443173.html

Activity集成diagram-viewer页面展示流程跟踪图 http://blog.csdn.net/hj7jay/article/details/50781083

咖啡兔主站 http://www.kafeitu.me/

自己的小例子

结合业务开启流程:

    @Transactional(readOnly = false)
    public void save(OaInstallTask oaInstallTask) {
        //生成(保存)安装单
        super.save(oaInstallTask);
        //#################这里开始写activity开启流程####################
        //设置流程变量
        Map variables = Maps.newHashMap();
        variables.put("pass", "0");//控制流程线的走向(流程方向线中的属性:流条件->${pass==0})
        variables.put("oaInstallTaskId", oaInstallTask.getId());
        variables.put("oaInstallTask.CreateBy", oaInstallTask.getCreateBy().getName());
        variables.put("oaInstallTask.CreateDate", oaInstallTask.getCreateDate());
        //记录流程发起人
        identityService.setAuthenticatedUserId(UserUtils.getUser().getLoginName());
        //开启流程
        String processDefinitionKey = ActUtils.PD_INSTALL_TASK[0];
        String businessKey = ActUtils.PD_INSTALL_TASK[1]+":"+oaInstallTask.getId();
        ProcessInstance procIns = runtimeService.startProcessInstanceByKey(processDefinitionKey, businessKey, variables);
        //#################这里写完写activity开启流程####################
        //保存到安装单里
        oaInstallTask.setProcInsId(procIns.getProcessInstanceId());
        //更新(保存)安装单
        super.save(oaInstallTask);
    }

用户任务中的执行监听器

package com.thinkgem.jeesite.modules.oainstalltask.service;

import org.activiti.engine.delegate.DelegateExecution;
import org.activiti.engine.delegate.ExecutionListener;

public class AssingeeGroup implements ExecutionListener {

    private static final long serialVersionUID = 1L;

    @Override
    public void notify(DelegateExecution execution) throws Exception {
        System.out.println("getCurrentActivityId:"+execution.getCurrentActivityId());
        execution.setVariable("userGroup", "repair");//角色英文名,分配用户里的候选用户组(${userGroup})
    }

}

流程图
Activity 工作流引擎_第1张图片
箭头方向位置是一个执行监听器,在这里配置用户任务中的执行监听器

你可能感兴趣的:(activity)