泳道、任务事件、任务定时器及身份组件

2024-04-27 19:38

本文主要是介绍泳道、任务事件、任务定时器及身份组件,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

9.4. Swimlanes(咏道)
A swimlane is a process role(角色). It is a mechanism to specify that multiple tasks in the process should be done by the same actor.(多个任务被同一个用户执行) So after the first task instance is created for a given swimlane, the actor should be remembered in the process for all subsequent(后来的) tasks that are in the same swimlane. A swimlane therefore has one assignment and all tasks that reference a swimlane should not specify an assignment.

When the first task in a given swimlane is created, the AssignmentHandler of the swimlane is called. The Assignable that is passed to the AssignmentHandler will be the SwimlaneInstance. Important to know is that all assignments that are done on the task instances in a given swimlane will propagate to the swimlane instance. This behaviour is implemented as the default because the person that takes a task to fulfilling(实行) a certain process role will have the knowledge of that perticular process. So all subsequent(并发的) assignements of task instances to that swimlane are done automatically to that user.

Swimlane is a terminology(术语) borrowed from UML activity(活动) diagrams.

------------------------------------------------------------
9.5. Task events (任务事件)
Tasks can have actions associated with them. There are 4 standard event types defined for tasks: task-create, task-assign, task-start and task-end.

(1)task-create
 is fired when a task instance is created.

(2)task-assign
is fired when a task instance is being assigned. Note that in actions that are executed on this event, you can access the previous actor with executionContext.getTaskInstance().getPreviousActorId();
executionContext.getTaskInstance().getPreviousActorId();

(3)task-start
is fired when TaskInstance.start() is called. This can be used to indicate(指示) that the user is actually starting to work on this task instance. Starting a task is optional.

(4)task-end
 is fired when TaskInstance.end(...) is called. This marks the completion of the task. If the task is related to a process execution, this call might trigger the resuming(恢复) of the process execution.

Since tasks can have events and actions associated with them, also exception handlers can be specified on a task. For more information about exception handling, see Section 7.5, “Exception handling”.

---------------------------------------------------------------
9.6. Task timers(任务定时器)
As on nodes, timers can be specified(指定) on tasks. See Section 10.1, “Timers”.

The special(特别的) thing about timers for tasks is that the cancel-event for task timers can be customized(取消事件可以被定制). By default, a timer on a task will be cancelled when the task is ended (=completed). But with the cancel-event attribute on the timer, process developers can customize that to e.g. task-assign or task-start. The cancel-event supports multiple events.|取消事件支持多种事件| The cancel-event types can be combined by specifying them in a comma(逗号) separated list in the attribute.

9.7. Customizing task instances(定制任务实例)
Task instances can be customized. The easiest way to do this is to create a subclass of TaskInstance.|创建一个任务实例的子类| Then update the property jbpm.task.instance.class and specify the class name of your custom class that inherits from TaskInstance. Also create a hibernate mapping file for the subclass (using the hibernate extends="org.jbpm.taskmgmt.exe.TaskInstance"). Then add that mapping file to the list of mapping files in the hibernate.cfg.xml
(1)更新jbpm.task.instance.class 的属性
(2)指定继承TaskInstance的定制类
(3)创建一个子类的影射文件(使用 extends="org.jbpm.taskmgmt.exe.TaskInstance")
(4)将这个影射文件加到 hibernate.cfg.xml

9.8. The identity component(身份组件)
Management of users, groups and permissions is commonly known as identity management. jBPM includes an optional identity component that can be easily replaced by a company's own identity data store.

The jBPM identity management component includes knowledge of the organisational model. Task assignment is typically done with organisational knowledge. So this implies knowledge of an organisational model, describing the users, groups, systems and the relations between them. Optionally, permissions and roles can be included too in an organisational model. Various academic(理论的) research attempts failed, proving that no generic organisational model can be created that fits every organisation.

The way jBPM handles this is by defining an actor as an actual participant(参与者) in a process. An actor is identified by its ID called an actorId. jBPM has only knowledge(知道) about actorId's and they are represented as java.lang.Strings for maximum flexibility. So any knowledge about the organisational model and the structure of that data is outside the scope of the jBPM core engine.

As an extension to jBPM we will provide (in the future) a component to manage that simple user-roles model. This many to many relation between users and roles is the same model as is defined in the J2EE and the servlet specs and it could serve as a starting point in new developments. People interested in contributing should check the jboss jbpm jira issue tracker for more details. 用户和角色 (user-roles 模型)


Note that the user-roles model as it is used in the servlet, ejb and portlet specifications, is not sufficiently powerful for handling task assignments. That model is a many-to-many relation between users and roles. This doesn't include information about the teams and the organisational structure of users involved in a process.


The classes in yellow are the relevant(相关的) classes for the expression assignment handler that is discussed next.

A User represents a user or a service.|一个用户表现为一个用户或一个服务。| A Group is any kind of group of users.|一个组是任何种类用户组。| Groups can be nested to model the relation between a team, a business unit and the whole company.|组可以被内嵌到在团队、商业单元和整个公司的关系模型。 | Groups have a type to differentiate between the hierarchical groups and e.g. haircolor groups.|组可以有一个种类来区分分等级的组和haircolor组。| Memberships represent the many-to-many relation between users and groups. A membership can be used to represent a position in a company.|一个membership可以被用来表现在公司中的位置。| The name of the membership can be used to indicate(指出) the role that the user fullfills in the group.

9.8.2. Assignment expressions (分派表达式)
The identity component comes with one implementation that evaluates an expression for the calculation of actors during assignment of tasks. Here's an example of using the assignment expression in a process definition:

<process-definition>
  ...
  <task-node name='a'>
    <task name='laundry'>
      <assignment expression='previous --> group(hierarchy) --> member(boss)' />
    </task>
    <transition to='b' />
  </task-node>
  ...
Syntax of the assignment expression is like this:

first-term --> next-term --> next-term --> ... --> next-term

where

first-term ::= previous |
               swimlane(swimlane-name) |
               variable(variable-name) |
               user(user-name) |
               group(group-name)

and

next-term ::= group(group-type) |
              member(role-name)

9.8.2.1. First terms
An expression is resolved(分解) from left to right.|一个表达式被从左到右进行分解| The first-term specifies a User or Group in the identity model.|第一个项目是在身份模型中指定了一个用户或组| Subsequent terms calculate the next term from the intermediate(中间的) user or group.

previous means the task is assigned to the current authenticated actor. This means the actor that performed the previous step in the process.

swimlane(swimlane-name) means the user or group is taken from the specified swimlane instance.

variable(variable-name) means the user or group is taken from the specified variable instance. The variable instance can contain a java.lang.String, in which case that user or group is fetched from the identity component. Or the variable instance contains a User or Group object.

user(user-name) means the given user is taken from the identity component.

group(group-name) means the given group is taken from the identity component.

9.8.2.2. Next terms
group(group-type) gets the group for a user. Meaning that previous terms must have resulted in a User. It searches for the the group with the given group-type in all the memberships for the user.

member(role-name) gets the user that performs a given role for a group. The previous terms must have resulted in a Group. This term searches for the user with a membership to the group for which the name of the membership matches the given role-name.

9.8.3. Removing the identity component
When you want to use your own datasource for organisational information such as your company's user database or ldap system, you can just rip out the jBPM identity component. The only thing you need to do is make sure that you delete the line ...

<mapping resource="org/jbpm/identity/hibernate/identitymappings.hbm.xml"/>
from the hibernate.cfg.xml

The ExpressionAssignmentHandler is dependent on the identity component so you will not be able to use it as is. In case you want to reuse the ExpressionAssignmentHandler and bind it to your user data store, you can extend from the ExpressionAssignmentHandler and override the method getExpressionSession.

protected ExpressionSession getExpressionSession(AssignmentContext assignmentContext);

这篇关于泳道、任务事件、任务定时器及身份组件的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/941361

相关文章

JS常用组件收集

收集了一些平时遇到的前端比较优秀的组件,方便以后开发的时候查找!!! 函数工具: Lodash 页面固定: stickUp、jQuery.Pin 轮播: unslider、swiper 开关: switch 复选框: icheck 气泡: grumble 隐藏元素: Headroom

禁止平板,iPad长按弹出默认菜单事件

通过监控按下抬起时间差来禁止弹出事件,把以下代码写在要禁止的页面的页面加载事件里面即可     var date;document.addEventListener('touchstart', event => {date = new Date().getTime();});document.addEventListener('touchend', event => {if (new

如何在页面调用utility bar并传递参数至lwc组件

1.在app的utility item中添加lwc组件: 2.调用utility bar api的方式有两种: 方法一,通过lwc调用: import {LightningElement,api ,wire } from 'lwc';import { publish, MessageContext } from 'lightning/messageService';import Ca

vue2 组件通信

props + emits props:用于接收父组件传递给子组件的数据。可以定义期望从父组件接收的数据结构和类型。‘子组件不可更改该数据’emits:用于定义组件可以向父组件发出的事件。这允许父组件监听子组件的事件并作出响应。(比如数据更新) props检查属性 属性名类型描述默认值typeFunction指定 prop 应该是什么类型,如 String, Number, Boolean,

kubelet组件的启动流程源码分析

概述 摘要: 本文将总结kubelet的作用以及原理,在有一定基础认识的前提下,通过阅读kubelet源码,对kubelet组件的启动流程进行分析。 正文 kubelet的作用 这里对kubelet的作用做一个简单总结。 节点管理 节点的注册 节点状态更新 容器管理(pod生命周期管理) 监听apiserver的容器事件 容器的创建、删除(CRI) 容器的网络的创建与删除

FreeRTOS内部机制学习03(事件组内部机制)

文章目录 事件组使用的场景事件组的核心以及Set事件API做的事情事件组的特殊之处事件组为什么不关闭中断xEventGroupSetBitsFromISR内部是怎么做的? 事件组使用的场景 学校组织秋游,组长在等待: 张三:我到了 李四:我到了 王五:我到了 组长说:好,大家都到齐了,出发! 秋游回来第二天就要提交一篇心得报告,组长在焦急等待:张三、李四、王五谁先写好就交谁的

火语言RPA流程组件介绍--浏览网页

🚩【组件功能】:浏览器打开指定网址或本地html文件 配置预览 配置说明 网址URL 支持T或# 默认FLOW输入项 输入需要打开的网址URL 超时时间 支持T或# 打开网页超时时间 执行后后等待时间(ms) 支持T或# 当前组件执行完成后继续等待的时间 UserAgent 支持T或# User Agent中文名为用户代理,简称 UA,它是一个特殊字符串头,使得服务器

【经验交流】修复系统事件查看器启动不能时出现的4201错误

方法1,取得『%SystemRoot%\LogFiles』文件夹和『%SystemRoot%\System32\wbem』文件夹的权限(包括这两个文件夹的所有子文件夹的权限),简单点说,就是使你当前的帐户拥有这两个文件夹以及它们的子文件夹的绝对控制权限。这是最简单的方法,不少老外说,这样一弄,倒是解决了问题。不过对我的系统,没用; 方法2,以不带网络的安全模式启动,运行命令行,输入“ne

BT天堂网站挂马事件后续:“大灰狼”远控木马分析及幕后真凶调查

9月初安全团队披露bt天堂网站挂马事件,该网站被利用IE神洞CVE-2014-6332挂马,如果用户没有打补丁或开启安全软件防护,电脑会自动下载执行大灰狼远控木马程序。 鉴于bt天堂电影下载网站访问量巨大,此次挂马事件受害者甚众,安全团队专门针对该木马进行严密监控,并对其幕后真凶进行了深入调查。 一、“大灰狼”的伪装 以下是10月30日一天内大灰狼远控的木马样本截图,可以看到该木马变种数量不

FreeRTOS学习笔记(二)任务基础篇

提示:文章写完后,目录可以自动生成,如何生成可参考右边的帮助文档 文章目录 前言一、 任务的基本内容1.1 任务的基本特点1.2 任务的状态1.3 任务控制块——任务的“身份证” 二、 任务的实现2.1 定义任务函数2.2 创建任务2.3 启动任务调度器2.4 任务的运行与切换2.4.1 利用延时函数2.4.2 利用中断 2.5 任务的通信与同步2.6 任务的删除2.7 任务的通知2