Acitivi API

Acitivi API:

    ProcessEngine processEngine = ProcessEngines.getDefaultProcessEngine();

RuntimeService runtimeService = processEngine.getRuntimeService();

RepositoryService repositoryService = processEngine.getRepositoryService();

TaskService taskService = processEngine.getTaskService();

ManagementService managementService = processEngine.getManagementService();

IdentityService identityService = processEngine.getIdentityService();

HistoryService historyService = processEngine.getHistoryService();

FormService formService = processEngine.getFormService();

 

所有的service是stateless,因此acitivi是支持集群的(使用同一数据库)。

 

RepositoryService :This service offers operations for managing and manipulating deployments and process definitions,

  Wile the RepositoryService is rather about static information。

  

RuntimeService :It deals with starting new process instances of process definitions. As said above, a process definition defines the structure and behaviour of the different steps in a process. A process instance is one execution of such a process definition. For each process definition there typically are many instances running at the same time. The RuntimeService also is the service which is used to retrieve and store process variables.

 

TaskService:Tasks that need to be performed by actual human users of the system are core to a BPM engine such as Activiti.

  Everything around tasks is grouped in the TaskService, such as :

       1、Querying tasks assigned to users or groups

 

            2、Creating new standalone tasks. These are tasks that are not related to a process instances.

 

            3、Manipulating to which user a task is assigned or which users are in some way involved with the task.

 

            4、Claiming and completing a task. Claiming means that someone decided to be the assigee for the task, meaning that this user will complete the task. Completing means 'doing the work of the tasks'. Typically this is filling in a form of sorts. 

 

IdentityService:It allows the management (creation, update, deletion, querying, ...) of groups and users

 

    FormService :This service introduces the concept of a start form and a task form. A start form is a form that is shown to the user before the process instance is started, while a task form is the form that is displayed when a user wants to complete a form.

 

HistoryService :When executing processes, a lot of data can be kept by the engine (this is configurable) such as process instance start times, who did which tasks, how long it took to complete the tasks, which path was followed in each process instance, etc. This service exposes mainly query capabilities to access this data.

 

ManagementService : It allows to retrieve information about the database tables and table metadata. Furthermore, it exposes query capabilities and management operations for jobs. Jobs are used in Activiti for various things such as timers, asynchronous continuations, delayed suspension/activation, etc. Later on, these topics will be discussed in more detail.

 

 

 

repositoryService.createDeployment()

          .addClasspathResource("diagrams/VacationRequest.bpmn20.xml")

          .deploy();

    每次执行以上语句都会新增一条记录到表ACT_RE_PROCDEF 

SELECT * FROM ACT_RE_PROCDEF 

 

ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("vacationRequest", variables);

每次执行以上语句都会新增一条记录到表ACT_RU_EXECUTION  

SELECT * FROM ACT_RU_EXECUTION 

 

为了保证高效,运行库(包含RU的表),都是用完即删的。

所以你可以通过判断ACT_RU_EXECUTION里是否还能查到这条数据,来判断流程是否已经结束了。

如果想知道某个流程什么时候结束的,可以查询act_hi_procinst

select * from act_hi_procinst t where t.proc_inst_id_='39027' 

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值