Activiti_what it is

介绍

Activiti5是由Alfresco软件在2010年5月17日发布的业务流程管理(BPM)框架,它是覆盖了业务流程管理、工作流、服务协作等领域的一个开源的、灵活的、易扩展的可执行流程语言框架。从基础开始构建,旨在提供支持新的BPMN 2.0标准,包括支持对象管理组(OMG),可以定义流程、执行流程并以不同方式对其实现运行。
Activiti基于Apache许可的开源BPM平台,创始人Tom Baeyens是JBoss jBPM的项目架构师,他特色是提供了eclipse插,开发人员可以通过插件直接绘画业务流程图。

工作流引擎

ProcessEngine对象,是Activiti工作的核心。负责生成流程运行时的各种实例及数据、监控和管理流程的运行。
通俗的讲,就是一辆汽车的发动机。一辆汽车,外表做的再漂亮,如果发动机有问题就只是一个摆设。应用系统的弹性就好比引擎转速方面的性能,加速到100公里需要1小时(业务流程发生变动需要进行半年的修改)还叫好车吗?引擎动不动就熄火(程序因为逻辑问题陷入死循环)的车还敢开吗?

BPMN

在Activiti工作流中用到了一个BPMN的文件,主要是用来描述业务流程的基本的符号,利用各个组件能够组成一个业务流程图,整个业务也是根据这个图来走的,其实用xml格式打开,就是一个XML文件
BPMN组件示意图:
在这里插入图片描述

数据库

在我们进行业务流程开发的时候,是会产生很多的数据的,这些数据就是存放在数据库的。
在Activiti工作流的后台是有数据库的支持的,所有的表都以ACT_开头,利用这些数据库的表,就能够把整个业务流程的数据保存下来,然后利用这些数据进行不同的业务的开发。
数据库表示意图
在这里插入图片描述
表介绍

  • 资源库流程规则表
    1)act_re_deployment 部署信息表
    2)act_re_model 流程设计模型部署表
    3)act_re_procdef 流程定义数据表

  • 运行时数据库表
    1)act_ru_execution 运行时流程执行实例表
    2)act_ru_identitylink 运行时流程人员表,主要存储任务节点与参与者的相关信息
    3)act_ru_task 运行时任务节点表
    4)act_ru_variable 运行时流程变量数据表

  • 历史数据库表
    1)act_hi_actinst 历史节点表
    2)act_hi_attachment 历史附件表
    3)act_hi_comment 历史意见表
    4)act_hi_identitylink 历史流程人员表
    5)act_hi_detail 历史详情表,提供历史变量的查询
    6)act_hi_procinst 历史流程实例表
    7)act_hi_taskinst 历史任务实例表
    8)act_hi_varinst 历史变量表

  • 组织机构表
    1)act_id_group 用户组信息表
    2)act_id_info 用户扩展信息表
    3)act_id_membership 用户与用户组对应信息表
    4)act_id_user 用户信息表

  • 通用数据表
    1)act_ge_bytearray 二进制数据表
    2)act_ge_property 属性数据表存储整个流程引擎级别的数据,初始化表结构时,会默认插入三条记录。

总结

未完待续,接下来有对Activiti核心引擎、各个BPMN各个组件的详细介绍等等等等…

### JPA Save Null Error Solution When encountering issues related to saving `null` values using Java Persistence API (JPA), it's important to understand how entity relationships and configurations can affect data integrity. In cases where entities are configured with `<one-to-one>` mappings, ensuring that all corresponding records exist in both tables becomes critical[^1]. If one side of this relationship contains a `null`, or if there’s an attempt to persist an object graph containing uninitialized associations, exceptions may occur. To address such problems effectively: #### Validate Entity Relationships Ensure that any bidirectional one-to-many or many-to-one relations between your entities do not contain null references unless explicitly allowed by the database schema design. For example, when defining these constraints within Hibernate annotations or XML configuration files, specify whether cascading operations should apply during persistence actions like saveOrUpdate() calls on parent objects. For handling specific scenarios involving potential NULL entries while working with relational databases through JPA/Hibernate frameworks, consider implementing custom logic before attempting saves/updates. This might involve checking for missing associated entities and either creating them programmatically or throwing meaningful errors back up the call stack so developers know exactly what went wrong without having cryptic SQL exception messages obscuring root causes. #### Example Code Implementation Here is a sample implementation demonstrating best practices around managing optional fields and preventing attempts at inserting invalid foreign key links into child tables due to improperly initialized parents: ```java @Entity public class Parent { @Id private Long id; @OneToOne(cascade = CascadeType.ALL) @JoinColumn(name="child_id", nullable=false) private Child child; public void setChild(Child c){ if(c != null && !c.equals(this.child)){ this.child=c; }else{ throw new IllegalArgumentException("Cannot assign null value."); } } } ``` In addition, ensure proper transaction management policies are enforced throughout application codebases interacting with persistent storage layers via ORM tools like Spring Data JPA repositories. Transactions provide guarantees about atomicity which help prevent partial updates leading to inconsistent states across linked resources. #### Handling Nullable Fields Explicitly If certain attributes must sometimes remain unset but still need representation inside managed POJOs mapped against RDBMS schemas, mark those properties accordingly using appropriate column definitions alongside getter/setter methods capable of gracefully dealing with absence of concrete instances. #### Related Issues With Variable Storage in Activiti It has been noted elsewhere that changes made recently to JDK versions have impacted serialization capabilities concerning JavaScript execution contexts used internally by BPMN engines based upon Activiti framework designs[^2]. While directly unrelated to solving JPA-related issues surrounding null pointer dereferencing events, awareness remains beneficial especially given increasing integration points found amongst modern enterprise software stacks leveraging multiple technologies simultaneously.
评论 4
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

new_repo

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值