提交 9cc07a09 编写于 作者: T tombaeyens

ACT-30 finished history activity instance docs and synced DB tables for mysql and postgresql

上级 dd73a1e2
......@@ -165,19 +165,6 @@ create table ACT_HI_ACT_INST (
primary key (ID_)
);
create table ACT_HI_DETAIL (
ID_ varchar not null,
TYPE_ varchar(255) not null,
PROC_INST_ID_ varchar(255),
ACT_INST_ID_ varchar(255),
TIME_ timestamp,
TEXTVALUE1_ varchar(255),
TEXTVALUE2_ varchar(255),
LONGVALUE1_ bigint,
LONGVALUE2_ bigint,
primary key (ID_),
);
alter table ACT_GE_BYTEARRAY
add constraint FK_BYTEARR_DEPL
foreign key (DEPLOYMENT_ID_)
......
......@@ -145,7 +145,6 @@ create table ACT_HI_PROC_INST (
START_TIME_ datetime not null,
END_TIME_ datetime,
DURATION_ bigint,
-- TODO: check endStateName length
END_ACT_ID_ varchar(255),
primary key (ID_),
unique (PROC_INST_ID_)
......@@ -153,11 +152,13 @@ create table ACT_HI_PROC_INST (
create table ACT_HI_ACT_INST (
ID_ varchar(255) not null,
PROC_DEF_ID_ varchar(255) not null,
PROC_INST_ID_ varchar(255) not null,
EXECUTION_ID_ varchar(255) not null,
ACT_ID_ varchar(255) not null,
ACT_NAME_ varchar(255),
ACT_TYPE_ varchar(255) not null,
PROC_INST_ID_ varchar(255) not null,
PROC_DEF_ID_ varchar(255) not null,
ASSIGNEE_ varchar(255),
START_TIME_ datetime not null,
END_TIME_ datetime,
DURATION_ bigint,
......
......@@ -153,11 +153,13 @@ create table ACT_HI_PROC_INST (
create table ACT_HI_ACT_INST (
ID_ varchar(300) not null,
PROC_DEF_ID_ varchar(255) not null,
PROC_INST_ID_ varchar(255) not null,
EXECUTION_ID_ varchar(255) not null,
ACT_ID_ varchar(255) not null,
ACT_NAME_ varchar(255),
ACT_TYPE_ varchar(255) not null,
PROC_INST_ID_ varchar(255) not null,
PROC_DEF_ID_ varchar(255) not null,
ASSIGNEE_ varchar(255),
START_TIME_ timestamp not null,
END_TIME_ timestamp,
DURATION_ bigint,
......
......@@ -13,9 +13,12 @@
package org.activiti.engine.test.history;
import java.util.List;
import org.activiti.engine.history.HistoricActivityInstance;
import org.activiti.engine.impl.test.ActivitiInternalTestCase;
import org.activiti.engine.runtime.ProcessInstance;
import org.activiti.engine.task.Task;
import org.activiti.engine.test.Deployment;
......@@ -99,4 +102,17 @@ public class HistoricActivityInstanceTest extends ActivitiInternalTestCase {
assertEquals(0, historyService.createHistoricActivityInstanceQuery().processDefinitionId("nonExistingProcessDefinitionId").list().size());
assertEquals(1, historyService.createHistoricActivityInstanceQuery().processDefinitionId(processInstance.getProcessDefinitionId()).list().size());
}
@Deployment
public void testHistoricActivityInstanceAssignee() {
// Start process instance
runtimeService.startProcessInstanceByKey("taskAssigneeProcess");
// Get task list
HistoricActivityInstance historicActivityInstance = historyService
.createHistoricActivityInstanceQuery()
.singleResult();
assertEquals("kermit", historicActivityInstance.getAssignee());
}
}
<?xml version="1.0" encoding="UTF-8"?>
<definitions id="taskAssigneeExample"
xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
typeLanguage="http://www.w3.org/2001/XMLSchema"
expressionLanguage="http://www.w3.org/1999/XPath"
targetNamespace="http://www.activiti.org/bpmn2.0">
<process id='taskAssigneeProcess' name="Task Assignee example">
<startEvent id='theStart' />
<sequenceFlow id='flow1' sourceRef='theStart' targetRef='theTask' />
<userTask id='theTask' name='Schedule meeting' >
<documentation>
Schedule an engineering meeting for next week with the new hire.
</documentation>
<humanPerformer>
<resourceAssignmentExpression>
<formalExpression>kermit</formalExpression>
</resourceAssignmentExpression>
</humanPerformer>
</userTask>
<sequenceFlow id='flow2' sourceRef='theTask' targetRef='theEnd' />
<endEvent id='theEnd' />
</process>
</definitions>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "../../../target/docbook-tool-1.0/docbook-xml/docbookx.dtd">
<chapter>
<title>History</title>
<warning><title>(Experimental)</title><para></para></warning>
<para>History is the component that captures what happened
during process execution and stores it permanently. In contrast to the runtime data,
the history data will remain present in the DB also after process instances have completed.
</para>
<para>Currently, there are 2 history tables: <literal>ACT_HI_PROC_INST</literal> containing
a record for every process instance and <literal>ACT_HI_ACT_INST</literal> containing a record
for every execution of an activity.
</para>
<para>In the API, the HistoryService exposes this information by offering methods
<literal>createHistoricProcessInstanceQuery</literal> and <literal>createHistoricActivityInstanceQuery</literal>.
You might want to consider these querying these tables in order to minimize access to the runtime process instance data
and that way keeping the runtime execution performant.
</para>
<para>Later on, this information will be exposed in Activiti Explorer and Activiti Probe.
Also, it will be the information from which the reports will be generated.
</para>
</chapter>
\ No newline at end of file
......@@ -8,9 +8,10 @@
<!ENTITY ch06 SYSTEM "chapters/ch06-Deployment.xml">
<!ENTITY ch07 SYSTEM "chapters/ch07-BPMN.xml">
<!ENTITY ch08 SYSTEM "chapters/ch08-TaskForms.xml">
<!ENTITY ch09 SYSTEM "chapters/ch09-Cycle.xml">
<!ENTITY ch10 SYSTEM "chapters/ch10-REST.xml">
<!ENTITY ch11 SYSTEM "chapters/ch11-Modeler.xml">
<!ENTITY ch09 SYSTEM "chapters/ch09-History.xml">
<!ENTITY ch10 SYSTEM "chapters/ch10-Cycle.xml">
<!ENTITY ch11 SYSTEM "chapters/ch11-REST.xml">
<!ENTITY ch12 SYSTEM "chapters/ch12-Modeler.xml">
]>
<book>
......@@ -30,5 +31,6 @@
&ch09;
&ch10;
&ch11;
&ch12;
</book>
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册