Permalink
Browse files

Changes for bulk insert queries.

Changes for multiple VariableInstance insertions in one query

Remove an extra statement

Added bulk insert for UserEntity

Changes in all entities for bulk insert

Added Oracle specific bulk insert queries

Resolve Test Issues

ACT-4014 Changes for maintaining dependency ordering for entities while inserting
  • Loading branch information...
Abhishek Mittal
Abhishek Mittal committed Apr 22, 2015
1 parent d063efc commit ad0c9e10d35dd26e9cbf7788ec7b278c4f061d90
Showing with 1,581 additions and 46 deletions.
  1. +46 −14 modules/activiti-engine/src/main/java/org/activiti/engine/impl/db/DbSqlSession.java
  2. +57 −1 modules/activiti-engine/src/main/java/org/activiti/engine/impl/db/DbSqlSessionFactory.java
  3. +47 −0 modules/activiti-engine/src/main/java/org/activiti/engine/impl/db/EntityDependencyOrder.java
  4. +3 −0 ...s/activiti-engine/src/main/java/org/activiti/engine/impl/persistence/entity/AttachmentEntity.java
  5. +3 −3 .../src/main/java/org/activiti/engine/impl/persistence/entity/CompensateEventSubscriptionEntity.java
  6. +3 −3 ...es/activiti-engine/src/main/java/org/activiti/engine/impl/persistence/entity/ExecutionEntity.java
  7. +8 −0 ...tiviti-engine/src/main/java/org/activiti/engine/impl/persistence/entity/HistoricDetailEntity.java
  8. +1 −0 .../java/org/activiti/engine/impl/persistence/entity/HistoricDetailVariableInstanceUpdateEntity.java
  9. +2 −0 ...-engine/src/main/java/org/activiti/engine/impl/persistence/entity/HistoricFormPropertyEntity.java
  10. +7 −0 modules/activiti-engine/src/main/java/org/activiti/engine/impl/persistence/entity/JobEntity.java
  11. +5 −0 modules/activiti-engine/src/main/java/org/activiti/engine/impl/persistence/entity/MessageEntity.java
  12. +1 −1 ...gine/src/main/java/org/activiti/engine/impl/persistence/entity/SignalEventSubscriptionEntity.java
  13. +4 −0 modules/activiti-engine/src/main/java/org/activiti/engine/impl/persistence/entity/TimerEntity.java
  14. +10 −0 ...viti-engine/src/main/java/org/activiti/engine/impl/persistence/entity/VariableInstanceEntity.java
  15. +1 −1 modules/activiti-engine/src/main/java/org/activiti/engine/impl/variable/VariableType.java
  16. +37 −0 modules/activiti-engine/src/main/resources/org/activiti/db/mapping/entity/Attachment.xml
  17. +37 −0 modules/activiti-engine/src/main/resources/org/activiti/db/mapping/entity/ByteArray.xml
  18. +56 −11 modules/activiti-engine/src/main/resources/org/activiti/db/mapping/entity/Comment.xml
  19. +26 −1 modules/activiti-engine/src/main/resources/org/activiti/db/mapping/entity/Deployment.xml
  20. +57 −0 modules/activiti-engine/src/main/resources/org/activiti/db/mapping/entity/EventLogEntry.xml
  21. +187 −2 modules/activiti-engine/src/main/resources/org/activiti/db/mapping/entity/EventSubscription.xml
  22. +48 −0 modules/activiti-engine/src/main/resources/org/activiti/db/mapping/entity/Execution.xml
  23. +23 −0 modules/activiti-engine/src/main/resources/org/activiti/db/mapping/entity/Group.xml
  24. +72 −0 ...es/activiti-engine/src/main/resources/org/activiti/db/mapping/entity/HistoricActivityInstance.xml
  25. +79 −0 modules/activiti-engine/src/main/resources/org/activiti/db/mapping/entity/HistoricDetail.xml
  26. +27 −0 modules/activiti-engine/src/main/resources/org/activiti/db/mapping/entity/HistoricIdentityLink.xml
  27. +72 −0 ...les/activiti-engine/src/main/resources/org/activiti/db/mapping/entity/HistoricProcessInstance.xml
  28. +96 −0 modules/activiti-engine/src/main/resources/org/activiti/db/mapping/entity/HistoricTaskInstance.xml
  29. +44 −0 ...es/activiti-engine/src/main/resources/org/activiti/db/mapping/entity/HistoricVariableInstance.xml
  30. +47 −1 modules/activiti-engine/src/main/resources/org/activiti/db/mapping/entity/IdentityInfo.xml
  31. +31 −0 modules/activiti-engine/src/main/resources/org/activiti/db/mapping/entity/IdentityLink.xml
  32. +160 −0 modules/activiti-engine/src/main/resources/org/activiti/db/mapping/entity/Job.xml
  33. +20 −1 modules/activiti-engine/src/main/resources/org/activiti/db/mapping/entity/Membership.xml
  34. +43 −1 modules/activiti-engine/src/main/resources/org/activiti/db/mapping/entity/Model.xml
  35. +44 −0 modules/activiti-engine/src/main/resources/org/activiti/db/mapping/entity/ProcessDefinition.xml
  36. +20 −0 modules/activiti-engine/src/main/resources/org/activiti/db/mapping/entity/Property.xml
  37. +27 −1 modules/activiti-engine/src/main/resources/org/activiti/db/mapping/entity/Resource.xml
  38. +56 −0 modules/activiti-engine/src/main/resources/org/activiti/db/mapping/entity/Task.xml
  39. +26 −0 modules/activiti-engine/src/main/resources/org/activiti/db/mapping/entity/User.xml
  40. +43 −0 modules/activiti-engine/src/main/resources/org/activiti/db/mapping/entity/VariableInstance.xml
  41. +5 −5 modules/activiti-engine/src/test/resources/activiti.cfg.xml
@@ -28,6 +28,7 @@
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.LinkedHashMap;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
@@ -56,10 +57,14 @@
import org.activiti.engine.impl.UserQueryImpl;
import org.activiti.engine.impl.cfg.ProcessEngineConfigurationImpl;
import org.activiti.engine.impl.context.Context;
import org.activiti.engine.impl.db.PersistentObject;
import org.activiti.engine.impl.db.upgrade.DbUpgradeStep;
import org.activiti.engine.impl.history.HistoryLevel;
import org.activiti.engine.impl.interceptor.Session;
import org.activiti.engine.impl.persistence.entity.IdentityLinkEntity;
import org.activiti.engine.impl.persistence.entity.PropertyEntity;
import org.activiti.engine.impl.persistence.entity.ResourceEntity;
import org.activiti.engine.impl.persistence.entity.UserEntity;
import org.activiti.engine.impl.persistence.entity.VariableInstanceEntity;
import org.activiti.engine.impl.util.IoUtil;
import org.activiti.engine.impl.util.ReflectUtil;
@@ -68,7 +73,6 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/** responsibilities:
* - delayed flushing of inserts updates and deletes
* - optional dirty checking
@@ -273,6 +277,7 @@ public void clearCache() {
cacheRemove(persistentObject.getClass(), persistentObject.getId());
}
@Override
public void execute() {
String deleteStatement = dbSqlSessionFactory.getDeleteStatement(persistentObject.getClass());
deleteStatement = dbSqlSessionFactory.mapStatement(deleteStatement);
@@ -335,6 +340,7 @@ public void clearCache() {
}
}
@Override
public void execute() {
if (persistentObjects.isEmpty()) {
@@ -571,6 +577,7 @@ public void addDeserializedObject(DeserializedObject deserializedObject) {
// flush ////////////////////////////////////////////////////////////////////
@Override
public void flush() {
List<DeleteOperation> removedOperations = removeUnnecessaryOperations();
@@ -735,7 +742,7 @@ protected boolean isPersistentObjectDeleted(PersistentObject persistentObject) {
return false;
}
public <T extends PersistentObject> List<T> pruneDeletedEntities(List<T> listToPrune) {
public <T extends PersistentObject> List<T> pruneDeletedEntities(List<T> listToPrune) {
List<T> prunedList = new ArrayList<T>(listToPrune);
for (T potentiallyDeleted : listToPrune) {
for (DeleteOperation deleteOperation: deleteOperations) {
@@ -750,25 +757,49 @@ protected boolean isPersistentObjectDeleted(PersistentObject persistentObject) {
}
protected void flushInserts() {
LinkedHashMap<Class<? extends PersistentObject>, List<PersistentObject>> bulkInsertHandledMap =
new LinkedHashMap<Class<? extends PersistentObject>, List<PersistentObject>>();
for (PersistentObject insertedObject: insertedObjects) {
String insertStatement = dbSqlSessionFactory.getInsertStatement(insertedObject);
insertStatement = dbSqlSessionFactory.mapStatement(insertStatement);
if (insertStatement==null) {
throw new ActivitiException("no insert statement for "+insertedObject.getClass()+" in the ibatis mapping files");
if (!bulkInsertHandledMap.containsKey(insertedObject.getClass())) {
bulkInsertHandledMap.put(insertedObject.getClass(), new ArrayList<PersistentObject>());
}
log.debug("inserting: {}", insertedObject);
sqlSession.insert(insertStatement, insertedObject);
// See http://jira.codehaus.org/browse/ACT-1290
if (insertedObject instanceof HasRevision) {
((HasRevision) insertedObject).setRevision(((HasRevision) insertedObject).getRevisionNext());
bulkInsertHandledMap.get(insertedObject.getClass()).add(insertedObject);
}
log.info("Insert queries collection formed: " + bulkInsertHandledMap);
// First process for entities in order of dependency requirement
for (EntityDependencyOrder entityName : EntityDependencyOrder.values()) {
if (!bulkInsertHandledMap.containsKey(entityName.getClazz())) {
continue;
}
flushBulkInserts(bulkInsertHandledMap.get(entityName.getClazz()), entityName.getClazz());
bulkInsertHandledMap.remove(entityName.getClazz());
}
// Next, process for all remaining entities
for (Class<? extends PersistentObject> clazz : bulkInsertHandledMap.keySet()) {
flushBulkInserts(bulkInsertHandledMap.get(clazz), clazz);
}
insertedObjects.clear();
}
private void flushBulkInserts(List<PersistentObject> variableList, Class<? extends PersistentObject> clazz) {
String insertStatement = dbSqlSessionFactory.getBulkInsertStatement(clazz);
insertStatement = dbSqlSessionFactory.mapStatement(insertStatement);
log.info("Insert statement to be executed:" + insertStatement);
if (insertStatement==null) {
throw new ActivitiException("no insert statement for "+variableList.get(0).getClass()+" in the ibatis mapping files");
}
log.info("inserting: {}", variableList);
sqlSession.insert(insertStatement, variableList);
if (variableList.get(0) instanceof HasRevision) {
for (PersistentObject insertedObject: variableList) {
((HasRevision) insertedObject).setRevision(((HasRevision) insertedObject).getRevisionNext());
}
}
}
protected void flushUpdates(List<PersistentObject> updatedObjects) {
for (PersistentObject updatedObject: updatedObjects) {
String updateStatement = dbSqlSessionFactory.getUpdateStatement(updatedObject);
@@ -861,6 +892,7 @@ protected void flushRegularDeletes(boolean dispatchEvent) {
}
}
@Override
public void close() {
sqlSession.close();
}
@@ -40,7 +40,7 @@
static {
String defaultOrderBy = " order by ${orderBy} ";
// h2
databaseSpecificLimitBeforeStatements.put("h2", "");
databaseSpecificLimitAfterStatements.put("h2", "LIMIT #{maxResults} OFFSET #{firstResult}");
@@ -55,6 +55,7 @@
databaseOuterJoinLimitBetweenStatements.put("hsql", "");
databaseSpecificOrderByStatements.put("hsql", defaultOrderBy);
//mysql specific
databaseSpecificLimitBeforeStatements.put("mysql", "");
databaseSpecificLimitAfterStatements.put("mysql", "LIMIT #{maxResults} OFFSET #{firstResult}");
@@ -77,17 +78,20 @@
databaseOuterJoinLimitBetweenStatements.put("postgres", "");
databaseSpecificOrderByStatements.put("postgres", defaultOrderBy);
addDatabaseSpecificStatement("postgres", "insertByteArray", "insertByteArray_postgres");
addDatabaseSpecificStatement("postgres", "bulkInsertByteArray", "bulkInsertByteArray_postgres");
addDatabaseSpecificStatement("postgres", "updateByteArray", "updateByteArray_postgres");
addDatabaseSpecificStatement("postgres", "selectByteArray", "selectByteArray_postgres");
addDatabaseSpecificStatement("postgres", "selectResourceByDeploymentIdAndResourceName", "selectResourceByDeploymentIdAndResourceName_postgres");
addDatabaseSpecificStatement("postgres", "selectResourcesByDeploymentId", "selectResourcesByDeploymentId_postgres");
addDatabaseSpecificStatement("postgres", "insertIdentityInfo", "insertIdentityInfo_postgres");
addDatabaseSpecificStatement("postgres", "bulkInsertIdentityInfo", "bulkInsertIdentityInfo_postgres");
addDatabaseSpecificStatement("postgres", "updateIdentityInfo", "updateIdentityInfo_postgres");
addDatabaseSpecificStatement("postgres", "selectIdentityInfoById", "selectIdentityInfoById_postgres");
addDatabaseSpecificStatement("postgres", "selectIdentityInfoByUserIdAndKey", "selectIdentityInfoByUserIdAndKey_postgres");
addDatabaseSpecificStatement("postgres", "selectIdentityInfoByUserId", "selectIdentityInfoByUserId_postgres");
addDatabaseSpecificStatement("postgres", "selectIdentityInfoDetails", "selectIdentityInfoDetails_postgres");
addDatabaseSpecificStatement("postgres", "insertComment", "insertComment_postgres");
addDatabaseSpecificStatement("postgres", "bulkInsertComment", "bulkInsertComment_postgres");
addDatabaseSpecificStatement("postgres", "selectComment", "selectComment_postgres");
addDatabaseSpecificStatement("postgres", "selectCommentsByTaskId", "selectCommentsByTaskId_postgres");
addDatabaseSpecificStatement("postgres", "selectCommentsByProcessInstanceId", "selectCommentsByProcessInstanceId_postgres");
@@ -96,6 +100,7 @@
addDatabaseSpecificStatement("postgres", "selectCommentsByTaskIdAndType", "selectCommentsByTaskIdAndType_postgres");
addDatabaseSpecificStatement("postgres", "selectEventsByTaskId", "selectEventsByTaskId_postgres");
addDatabaseSpecificStatement("postgres", "insertEventLogEntry", "insertEventLogEntry_postgres");
addDatabaseSpecificStatement("postgres", "bulkInsertEventLogEntry", "bulkInsertEventLogEntry_postgres");
addDatabaseSpecificStatement("postgres", "selectAllEventLogEntries", "selectAllEventLogEntries_postgres");
addDatabaseSpecificStatement("postgres", "selectEventLogEntries", "selectEventLogEntries_postgres");
addDatabaseSpecificStatement("postgres", "selectEventLogEntriesByProcessInstanceId", "selectEventLogEntriesByProcessInstanceId_postgres");
@@ -109,6 +114,42 @@
addDatabaseSpecificStatement("oracle", "selectExclusiveJobsToExecute", "selectExclusiveJobsToExecute_integerBoolean");
addDatabaseSpecificStatement("oracle", "selectUnlockedTimersByDuedate", "selectUnlockedTimersByDuedate_oracle");
addDatabaseSpecificStatement("oracle", "insertEventLogEntry", "insertEventLogEntry_oracle");
addDatabaseSpecificStatement("oracle", "bulkInsertVariableInstance", "bulkInsertVariableInstance_oracle");
addDatabaseSpecificStatement("oracle", "bulkInsertUser", "bulkInsertUser_oracle");
addDatabaseSpecificStatement("oracle", "bulkInsertTask", "bulkInsertTask_oracle");
addDatabaseSpecificStatement("oracle", "bulkInsertResource", "bulkInsertResource_oracle");
addDatabaseSpecificStatement("oracle", "bulkInsertProperty", "bulkInsertProperty_oracle");
addDatabaseSpecificStatement("oracle", "bulkInsertProcessDefinition", "bulkInsertProcessDefinition_oracle");
addDatabaseSpecificStatement("oracle", "bulkInsertModel", "bulkInsertModel_oracle");
addDatabaseSpecificStatement("oracle", "bulkInsertMembership", "bulkInsertMembership_oracle");
addDatabaseSpecificStatement("oracle", "bulkInsertTimer", "bulkInsertTimer_oracle");
addDatabaseSpecificStatement("oracle", "bulkInsertMessage", "bulkInsertMessage_oracle");
addDatabaseSpecificStatement("oracle", "bulkInsertIdentityInfo", "bulkInsertIdentityInfo_oracle");
addDatabaseSpecificStatement("oracle", "bulkInsertIdentityLink", "bulkInsertIdentityLink_oracle");
addDatabaseSpecificStatement("oracle", "bulkInsertMembership", "bulkInsertMembership_oracle");
addDatabaseSpecificStatement("oracle", "bulkInsertTimer", "bulkInsertTimer_oracle");
addDatabaseSpecificStatement("oracle", "bulkInsertMessage", "bulkInsertMessage_oracle");
addDatabaseSpecificStatement("oracle", "bulkInsertHistoricVariableInstance", "bulkInsertHistoricVariableInstance_oracle");
addDatabaseSpecificStatement("oracle", "bulkInsertHistoricTaskInstance", "bulkInsertHistoricTaskInstance_oracle");
addDatabaseSpecificStatement("oracle", "bulkInsertHistoricProcessInstance", "bulkInsertHistoricProcessInstance_oracle");
addDatabaseSpecificStatement("oracle", "bulkInsertHistoricIdentityLink", "bulkInsertHistoricIdentityLink_oracle");
addDatabaseSpecificStatement("oracle", "bulkInsertHistoricDetailVariableInstanceUpdate", "bulkInsertHistoricDetailVariableInstanceUpdate_oracle");
addDatabaseSpecificStatement("oracle", "bulkInsertHistoricFormProperty", "bulkInsertHistoricFormProperty_oracle");
addDatabaseSpecificStatement("oracle", "bulkInsertHistoricActivityInstance", "bulkInsertHistoricActivityInstance_oracle");
addDatabaseSpecificStatement("oracle", "bulkInsertGroup", "bulkInsertGroup_oracle");
addDatabaseSpecificStatement("oracle", "bulkInsertExecution", "bulkInsertExecution_oracle");
addDatabaseSpecificStatement("oracle", "bulkInsertMessageEventSubscription", "bulkInsertMessageEventSubscription_oracle");
addDatabaseSpecificStatement("oracle", "bulkInsertSignalEventSubscription", "bulkInsertSignalEventSubscription_oracle");
addDatabaseSpecificStatement("oracle", "bulkInsertCompensateEventSubscription", "bulkInsertCompensateEventSubscription_oracle");
addDatabaseSpecificStatement("oracle", "bulkInsertEventLogEntry", "bulkInsertEventLogEntry_oracle");
addDatabaseSpecificStatement("oracle", "bulkInsertDeployment", "bulkInsertDeployment_oracle");
addDatabaseSpecificStatement("oracle", "bulkInsertComment", "bulkInsertComment_oracle");
addDatabaseSpecificStatement("oracle", "bulkInsertByteArray", "bulkInsertByteArray_oracle");
addDatabaseSpecificStatement("oracle", "bulkInsertEventLogEntry", "bulkInsertEventLogEntry_oracle");
addDatabaseSpecificStatement("oracle", "bulkInsertDeployment", "bulkInsertDeployment_oracle");
addDatabaseSpecificStatement("oracle", "bulkInsertComment", "bulkInsertComment_oracle");
addDatabaseSpecificStatement("oracle", "bulkInsertByteArray", "bulkInsertByteArray_oracle");
addDatabaseSpecificStatement("oracle", "bulkInsertAttachment", "bulkInsertAttachment_oracle");
// db2
databaseSpecificLimitBeforeStatements.put("db2", "SELECT SUB.* FROM (");
@@ -177,6 +218,7 @@
protected IdGenerator idGenerator;
protected Map<String, String> statementMappings;
protected Map<Class<?>,String> insertStatements = new ConcurrentHashMap<Class<?>, String>();
protected Map<Class<?>,String> bulkInsertStatements = new ConcurrentHashMap<Class<?>, String>();
protected Map<Class<?>,String> updateStatements = new ConcurrentHashMap<Class<?>, String>();
protected Map<Class<?>,String> deleteStatements = new ConcurrentHashMap<Class<?>, String>();
protected Map<Class<?>,String> bulkDeleteStatements = new ConcurrentHashMap<Class<?>, String>();
@@ -199,6 +241,10 @@ public Session openSession() {
public String getInsertStatement(PersistentObject object) {
return getStatement(object.getClass(), insertStatements, "insert");
}
public String getBulkInsertStatement(Class clazz) {
return getStatement(clazz, bulkInsertStatements, "bulkInsert");
}
public String getUpdateStatement(PersistentObject object) {
return getStatement(object.getClass(), updateStatements, "update");
@@ -297,6 +343,16 @@ public void setInsertStatements(Map<Class< ? >, String> insertStatements) {
}
public Map<Class< ? >, String> getBulkInsertStatements() {
return bulkInsertStatements;
}
public void setBulkInsertStatements(Map<Class< ? >, String> bulkInsertStatements) {
this.bulkInsertStatements = bulkInsertStatements;
}
public Map<Class< ? >, String> getUpdateStatements() {
return updateStatements;
}
@@ -0,0 +1,47 @@
package org.activiti.engine.impl.db;
import org.activiti.engine.impl.persistence.entity.ByteArrayEntity;
import org.activiti.engine.impl.persistence.entity.DeploymentEntity;
import org.activiti.engine.impl.persistence.entity.EventSubscriptionEntity;
import org.activiti.engine.impl.persistence.entity.ExecutionEntity;
import org.activiti.engine.impl.persistence.entity.GroupEntity;
import org.activiti.engine.impl.persistence.entity.IdentityLinkEntity;
import org.activiti.engine.impl.persistence.entity.JobEntity;
import org.activiti.engine.impl.persistence.entity.MembershipEntity;
import org.activiti.engine.impl.persistence.entity.ModelEntity;
import org.activiti.engine.impl.persistence.entity.ProcessDefinitionEntity;
import org.activiti.engine.impl.persistence.entity.TaskEntity;
import org.activiti.engine.impl.persistence.entity.UserEntity;
import org.activiti.engine.impl.persistence.entity.VariableInstanceEntity;
/**
* Maintains a list of all the entities in order of dependency.
* For eg. If ByteArray.java will appear before VariableInstance.java,
* since VariableInstance has ByteArray.id as FK
*/
public enum EntityDependencyOrder {
DeploymentEntity(DeploymentEntity.class),
ByteArrayEntity(ByteArrayEntity.class),
ModelEntity(ModelEntity.class),
UserEntity(UserEntity.class),
GroupEntity(GroupEntity.class),
MembershipEntity(MembershipEntity.class),
ProcessDefinitionEntity(ProcessDefinitionEntity.class),
ExecutionEntity(ExecutionEntity.class),
EventSubscriptionEntity(EventSubscriptionEntity.class),
TaskEntity(TaskEntity.class),
IdentityLinkEntity(IdentityLinkEntity.class),
JobEntity(JobEntity.class),
VariableInstanceEntity(VariableInstanceEntity.class);
private Class<? extends PersistentObject> clazz;
private EntityDependencyOrder(Class<? extends PersistentObject> clazz) {
this.clazz = clazz;
}
public Class<? extends PersistentObject> getClazz() {
return clazz;
}
}
@@ -43,6 +43,9 @@
protected String userId;
protected Date time;
public AttachmentEntity() {
}
public Object getPersistentState() {
Map<String, Object> persistentState = new HashMap<String, Object>();
persistentState.put("name", name);
@@ -24,17 +24,17 @@
public class CompensateEventSubscriptionEntity extends EventSubscriptionEntity {
private static final long serialVersionUID = 1L;
private CompensateEventSubscriptionEntity() {
}
private CompensateEventSubscriptionEntity(ExecutionEntity executionEntity) {
super(executionEntity);
eventType=CompensationEventHandler.EVENT_HANDLER_TYPE;
eventType=CompensationEventHandler.EVENT_HANDLER_TYPE;
}
public static CompensateEventSubscriptionEntity createAndInsert(ExecutionEntity executionEntity) {
CompensateEventSubscriptionEntity eventSubscription = new CompensateEventSubscriptionEntity(executionEntity);
CompensateEventSubscriptionEntity eventSubscription = new CompensateEventSubscriptionEntity(executionEntity);
if (executionEntity.getTenantId() != null) {
eventSubscription.setTenantId(executionEntity.getTenantId());
}
@@ -251,14 +251,14 @@
protected boolean forcedUpdate;
protected List<VariableInstanceEntity> queryVariables;
public ExecutionEntity() {
}
public ExecutionEntity(ActivityImpl activityImpl) {
this.startingExecution = new StartingExecution(activityImpl);
}
public ExecutionEntity() {
}
/** creates a new execution. properties processDefinition, processInstance and activity will be initialized. */
public ExecutionEntity createExecution() {
// create the new child execution
@@ -35,6 +35,7 @@
protected String taskId;
protected String executionId;
protected Date time;
protected String detailType;
public Object getPersistentState() {
// details are not updatable so we always provide the same object as the state
@@ -92,4 +93,11 @@ public Date getTime() {
public void setTime(Date time) {
this.time = time;
}
public String getDetailType() {
return detailType;
}
public void setDetailType(String detailType) {
this.detailType = detailType;
}
}
@@ -42,6 +42,7 @@
protected Object cachedValue;
protected HistoricDetailVariableInstanceUpdateEntity() {
this.detailType = "VariableUpdate";
}
public static HistoricDetailVariableInstanceUpdateEntity copyAndInsert(VariableInstanceEntity variableInstance) {
@@ -27,6 +27,7 @@
protected String propertyValue;
public HistoricFormPropertyEntity() {
this.detailType = "FormProperty";
}
public HistoricFormPropertyEntity(ExecutionEntity execution, String propertyId, String propertyValue) {
@@ -40,6 +41,7 @@ public HistoricFormPropertyEntity(ExecutionEntity execution, String propertyId,
this.propertyId = propertyId;
this.propertyValue = propertyValue;
this.time = Context.getProcessEngineConfiguration().getClock().getCurrentTime();
this.detailType = "FormProperty";
HistoricActivityInstanceEntity historicActivityInstance = Context.getCommandContext().getHistoryManager().findActivityInstance(execution);
if (historicActivityInstance!=null) {
Oops, something went wrong.

0 comments on commit ad0c9e1

Please sign in to comment.