描述文件、實體類和數據庫對應的關係mysql
序號sql |
映射文件名稱數據庫 |
含義數組 |
實體類名app |
數據庫表名spa |
1.net |
Attachment.xmlcode |
附件xml |
AttachmentEntity接口 |
ACT_HI_ATTACHMENT |
2 |
ByteArray.xml |
比特數組 |
ByteArrayEntity |
ACT_GE_BYTEARRAY |
3 |
Comment.xml |
備註 |
CommentEntity |
ACT_HI_COMMENT |
4 |
Deployment.xml |
|
DeploymentEntity |
ACT_RE_DEPLOYMENT |
5 |
Execution.xml |
|
ExecutionEntity |
ACT_RU_EXECUTION |
6 |
Group.xml |
|
GroupEntity |
ACT_ID_GROUP |
7 |
HistoricActivityInstance.xml |
|
HistoricActivityInstanceEntity |
ACT_HI_ACTINST |
8 |
HistoricDetail.xml |
|
HistoricDetailEntity |
ACT_HI_DETAIL |
9 |
HistoricProcessInstance.xml |
|
HistoricProcessInstanceEntity |
ACT_HI_PROCINST |
10 |
HistoricVariableInstance.xml |
|
HistoricVariableInstanceEntity |
ACT_HI_VARINST |
11 |
HistoricTaskInstance.xml |
|
HistoricTaskInstanceEntity |
ACT_HI_TASKINST |
12 |
HistoricIdentityLink.xml |
|
HistoricIdentityLinkEntity |
ACT_HI_IDENTITYLINK |
13 |
IdentityInfo.xml |
|
IdentityInfoEntity |
ACT_ID_INFO |
14 |
IdentityLink.xml |
|
IdentityLinkEntity |
ACT_RU_IDENTITYLINK |
15 |
Job.xml |
|
JobEntity |
ACT_RU_JOB |
16 |
Membership.xml |
|
MembershipRelation |
ACT_ID_MEMBERSHIP |
17 |
Model.xml |
|
ModelEntity |
ACT_RE_MODEL |
18 |
ProcessDefinition.xml |
|
ProcessDefinitionEntity |
ACT_RE_PROCDEF |
19 |
Property.xml |
|
PropertyEntity |
ACT_GE_PROPERTY |
20 |
Resource.xml |
|
ResourceEntity |
ACT_GE_BYTEARRAY |
21 |
TableData.xml |
|
無 |
任意表 |
22 |
Task.xml |
|
TaskEntity |
ACT_RU_TASK |
23 |
User.xml |
|
UserEntity |
ACT_ID_USER |
24 |
VariableInstance.xml |
|
VariableInstanceEntity |
ACT_RU_VARIABLE |
25 |
EventSubscription.xml |
|
EventSubscriptionEntity |
ACT_RU_EVENT_SUBSCR |
在開發的過程當中activiti提供了比較豐富的API,同時也提供執行SQL語句的API,例以下面的例子,模糊查找前面任務提交的內容,如用戶填寫的表單,表單的內容放在流程變量裏面,會遇到刷選的功能,下面簡單介紹一下
// 變量裏面模糊查找 search (有可能存在重複, 如,appliName, Catagrory 中都包含申請) String selectClause = "select * from " + managementService.getTableName(HistoricTaskInstanceEntity.class) + " T, " + managementService.getTableName(HistoricVariableInstanceEntity.class) + " V where V.EXECUTION_ID_ in " + exectionIds.toString().replace("[", "(").replace("]", ")") + " and V.TEXT_ like '%" + search + "%'"; // activiti中提供了Native相關的操做sql語句的接口 List<HistoricTaskInstance> tasks = historyService .createNativeHistoricTaskInstanceQuery().sql(selectClause).list();