提交 93d4b932 编写于 作者: M Miguel Ruiz 提交者: mergify[bot]

[AAE-785] Add application version field to processes and tasks in Activiti Core (#3001)

* AAE-785: Added appVersion, refactor, tests

* AAE-785: Fixed schema version number

* AAE-785: Increased value column size

* AAE-785: Addressed CRs
上级 d51a9c64
......@@ -16,6 +16,8 @@
package org.activiti.runtime.api.model.impl;
import java.util.Objects;
import org.activiti.api.process.model.ProcessDefinition;
import org.activiti.api.runtime.model.impl.ProcessDefinitionImpl;
import org.activiti.bpmn.model.BpmnModel;
......@@ -37,6 +39,7 @@ public class APIProcessDefinitionConverter extends ListConverter<org.activiti.en
processDefinition.setDescription(internalProcessDefinition.getDescription());
processDefinition.setVersion(internalProcessDefinition.getVersion());
processDefinition.setKey(internalProcessDefinition.getKey());
processDefinition.setAppVersion(Objects.toString(internalProcessDefinition.getAppVersion(), null));
BpmnModel model = repositoryService.getBpmnModel(internalProcessDefinition.getId());
processDefinition.setFormKey(model.getStartFormKey(internalProcessDefinition.getKey()));
return processDefinition;
......
/*
/*
* Copyright 2018 Alfresco, Inc. and/or its affiliates.
*
* Licensed under the Apache License, Version 2.0 (the "License");
......@@ -16,6 +16,8 @@
package org.activiti.runtime.api.model.impl;
import java.util.Objects;
import org.activiti.api.process.model.ProcessInstance;
import org.activiti.api.runtime.model.impl.ProcessInstanceImpl;
......@@ -37,6 +39,7 @@ public class APIProcessInstanceConverter extends ListConverter<org.activiti.engi
processInstance.setBusinessKey(internalProcessInstance.getBusinessKey());
processInstance.setStatus(calculateStatus(internalProcessInstance));
processInstance.setProcessDefinitionVersion(internalProcessInstance.getProcessDefinitionVersion());
processInstance.setAppVersion(Objects.toString(internalProcessInstance.getAppVersion(), null));
return processInstance;
}
......
......@@ -28,7 +28,8 @@ import org.mockito.Mock;
import static org.activiti.runtime.api.model.impl.MockProcessDefinitionBuilder.processDefinitionBuilderBuilder;
import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.Mockito.when;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.BDDMockito.given;
import static org.mockito.MockitoAnnotations.initMocks;
public class APIProcessDefinitionConverterTest {
......@@ -53,11 +54,11 @@ public class APIProcessDefinitionConverterTest {
BpmnModel model = new BpmnModel();
model.addProcess(process);
when(repositoryService.getBpmnModel("anId")).thenReturn(model);
given(repositoryService.getBpmnModel(any())).willReturn(model);
}
@Test
public void convertFromProcessDefinitionShouldSetAllFieldsInTheConvertedProcessDefinition() {
public void should_convertFromProcessDefinition_when_allFieldsAreSet() {
ProcessDefinition convertedProcessDefinition = processDefinitionConverter.from(
processDefinitionBuilderBuilder()
.withId("anId")
......@@ -65,10 +66,10 @@ public class APIProcessDefinitionConverterTest {
.withName("Process Name")
.withDescription("process description")
.withVersion(3)
.withAppVersion(1)
.build()
);
//THEN
assertThat(convertedProcessDefinition)
.isNotNull()
.extracting(ProcessDefinition::getId,
......@@ -76,6 +77,7 @@ public class APIProcessDefinitionConverterTest {
ProcessDefinition::getName,
ProcessDefinition::getDescription,
ProcessDefinition::getVersion,
ProcessDefinition::getAppVersion,
ProcessDefinition::getFormKey)
.containsExactly(
"anId",
......@@ -83,6 +85,21 @@ public class APIProcessDefinitionConverterTest {
"Process Name",
"process description",
3,
"1",
"AFormKey");
}
@Test
public void should_convertProcessDefinition_when_appVersionNull() {
ProcessDefinition convertedProcessDefinition = processDefinitionConverter.from(
processDefinitionBuilderBuilder()
.withKey("processKey")
.withAppVersion(null)
.build());
assertThat(convertedProcessDefinition)
.isNotNull()
.extracting(ProcessDefinition::getAppVersion)
.isNull();
}
}
......@@ -38,56 +38,60 @@ public class APIProcessInstanceConverterTest {
private static final String PROCESS_DEFINITION_KEY = "processDefinitionKey";
private static final String PROCESS_DEFINITION_ID = "processDefinitionId";
private static final String PROCESS_INSTANCE_ID = "processInstanceId";
public static final int APP_VERSION = 1;
private static final String APP_VERSION_STRING = "1";
private static final Date START_TIME = new Date();
private APIProcessInstanceConverter subject = new APIProcessInstanceConverter();
private Date startTime = new Date();
@Test
public void shouldConvertFromInternalProcessInstanceWithRunningStatus() {
//given
ExecutionEntity internalProcessInstance = anInternalProcessInstance(startTime);
public void should_convertFromInternalProcessInstance_when_withRunningStatus() {
ExecutionEntity internalProcessInstance = anInternalProcessInstance(APP_VERSION);
internalProcessInstance.setActive(true);
//when
ProcessInstance result = subject.from(internalProcessInstance);
//then
assertValidProcessInstanceResult(result);
assertThat(result.getStatus()).isEqualTo(ProcessInstanceStatus.RUNNING);
}
@Test
public void shouldConvertFromInternalProcessInstanceWithSuspendedStatus() {
//given
ExecutionEntity internalProcessInstance = anInternalProcessInstance(startTime);
public void should_convertFromInternalProcessInstance_when_withSuspendedStatus() {
ExecutionEntity internalProcessInstance = anInternalProcessInstance(APP_VERSION);
internalProcessInstance.setSuspensionState(SuspensionState.SUSPENDED.getStateCode());
//when
ProcessInstance result = subject.from(internalProcessInstance);
//then
assertValidProcessInstanceResult(result);
assertThat(result.getStatus()).isEqualTo(ProcessInstanceStatus.SUSPENDED);
}
@Test
public void shouldConvertFromInternalProcessInstanceWithCompletedStatus() {
//given
ExecutionEntity internalProcessInstance = anInternalProcessInstance(startTime);
public void should_convertFromInternalProcessInstance_when_withCompletedStatus() {
ExecutionEntity internalProcessInstance = anInternalProcessInstance(APP_VERSION);
internalProcessInstance.setEnded(true);
//when
ProcessInstance result = subject.from(internalProcessInstance);
//then
assertValidProcessInstanceResult(result);
assertThat(result.getStatus()).isEqualTo(ProcessInstanceStatus.COMPLETED);
}
private void assertValidProcessInstanceResult(ProcessInstance result) {
@Test
public void should_convertFromInternalProcessInstance_when_appVersionIsNotSet() {
ExecutionEntity internalProcessInstance = anInternalProcessInstance(null);
ProcessInstance result = subject.from(internalProcessInstance);
assertValidProcessInstanceResult(result, null);
}
private static void assertValidProcessInstanceResult(ProcessInstance result) {
assertValidProcessInstanceResult(result, APP_VERSION_STRING);
}
private static void assertValidProcessInstanceResult(ProcessInstance result, String appVersionString) {
assertThat(result).isNotNull();
assertThat(result.getId()).isEqualTo(PROCESS_INSTANCE_ID);
assertThat(result.getBusinessKey()).isEqualTo(BUSINESS_KEY);
......@@ -98,10 +102,11 @@ public class APIProcessInstanceConverterTest {
assertThat(result.getName()).isEqualTo(NAME);
assertThat(result.getParentId()).isEqualTo(PARENT_PROCESS_INSTANCE_ID);
assertThat(result.getInitiator()).isEqualTo(START_USER_ID);
assertThat(result.getStartDate()).isEqualTo(startTime);
assertThat(result.getStartDate()).isEqualTo(START_TIME);
assertThat(result.getAppVersion()).isEqualTo(appVersionString);
}
private ExecutionEntity anInternalProcessInstance(Date startTime) {
private ExecutionEntity anInternalProcessInstance(Integer appVersion) {
ExecutionEntity internalProcessInstance = new ExecutionEntityImpl();
internalProcessInstance.setId(PROCESS_INSTANCE_ID);
......@@ -113,8 +118,9 @@ public class APIProcessInstanceConverterTest {
internalProcessInstance.setName(NAME);
internalProcessInstance.setDescription(DESCRIPTION);
internalProcessInstance.setStartUserId(START_USER_ID);
internalProcessInstance.setStartTime(startTime);
internalProcessInstance.setStartTime(START_TIME);
internalProcessInstance.setActive(true);
internalProcessInstance.setAppVersion(appVersion);
return internalProcessInstance;
}
......
......@@ -61,6 +61,11 @@ public class MockProcessDefinitionBuilder {
return this;
}
public MockProcessDefinitionBuilder withAppVersion(Integer appVersion) {
when(processDefinition.getAppVersion()).thenReturn(appVersion);
return this;
}
public ProcessDefinition build() {
return processDefinition;
}
......
......@@ -16,6 +16,8 @@
package org.activiti.runtime.api.model.impl;
import java.util.Objects;
import org.activiti.api.task.model.Task;
import org.activiti.api.task.model.impl.TaskImpl;
import org.activiti.engine.impl.persistence.entity.TaskEntity;
......@@ -45,6 +47,7 @@ public class APITaskConverter extends ListConverter<org.activiti.engine.task.Tas
task.setPriority(internalTask.getPriority());
task.setFormKey(internalTask.getFormKey());
task.setTaskDefinitionKey(internalTask.getTaskDefinitionKey());
task.setAppVersion(Objects.toString(internalTask.getAppVersion(), null));
return task;
}
......
......@@ -43,8 +43,7 @@ public class APITaskConverterTest {
}
@Test
public void convertFromTaskShouldSetAllFieldsInTheConvertedTask() {
//WHEN
public void should_convertTask_when_allFieldsAreSet() {
Date now = new Date();
Task convertedTask = taskConverter.from(
taskBuilder()
......@@ -61,10 +60,10 @@ public class APITaskConverterTest {
.withParentTaskId("testParentTaskId")
.withFormKey("testFormKey")
.withTaskDefinitionKey("taskDefinitionKey")
.withAppVersion(1)
.build()
);
//THEN
assertThat(convertedTask)
.isNotNull()
.extracting(Task::getId,
......@@ -80,7 +79,8 @@ public class APITaskConverterTest {
Task::getParentTaskId,
Task::getFormKey,
Task::getStatus,
Task::getTaskDefinitionKey)
Task::getTaskDefinitionKey,
Task::getAppVersion)
.containsExactly("testTaskId",
"testUser",
"testTaskName",
......@@ -94,7 +94,17 @@ public class APITaskConverterTest {
"testParentTaskId",
"testFormKey",
ASSIGNED,
"taskDefinitionKey");
"taskDefinitionKey",
"1");
}
@Test
public void should_convertTask_when_appVersionNull() {
Task convertedTask = taskConverter.from(taskBuilder().withAppVersion(null).build());
assertThat(convertedTask)
.isNotNull()
.extracting(Task::getAppVersion)
.isNull();
}
@Test
......
......@@ -132,6 +132,11 @@ public class MockTaskBuilder {
return this;
}
public MockTaskBuilder withAppVersion(Integer appVersion) {
when(task.getAppVersion()).thenReturn(appVersion);
return this;
}
public Task build() {
return task;
}
......
/* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
......@@ -17,7 +17,7 @@ import org.activiti.engine.api.internal.Internal;
/**
* Provides access to all the services that expose the BPM and workflow operations.
*
*
* <ul>
* <li>
* <b>{@link org.activiti.engine.RuntimeService}: </b> Allows the creation of {@link org.activiti.engine.repository.Deployment}s and the starting of and searching on
......@@ -29,17 +29,17 @@ import org.activiti.engine.api.internal.Internal;
* <li>
* <b>{@link org.activiti.engine.HistoryService}: </b> Service exposing information about ongoing and past process instances.</li>
* </ul>
*
*
* Typically, there will be only one central ProcessEngine instance needed in a end-user application. Building a ProcessEngine is done through a {@link ProcessEngineConfiguration} instance and is a
* costly operation which should be avoided. For that purpose, it is advised to store it in a static field or JNDI location (or something similar). This is a thread-safe object, so no special
* precautions need to be taken.
*
*
*/
@Internal
public interface ProcessEngine {
/** the version of the activiti library */
public static String VERSION = "7.1.0.0"; // Note the extra .x at the end. To cater for snapshot releases with different database changes
public static String VERSION = "7.1.0-M6"; // Note the extra -x at the end. To cater for snapshot releases with different database changes
/**
* The name as specified in 'process-engine-name' in the activiti.cfg.xml configuration file. The default name for a process engine is 'default
......@@ -47,7 +47,7 @@ public interface ProcessEngine {
String getName();
void close();
RepositoryService getRepositoryService();
RuntimeService getRuntimeService();
......@@ -57,7 +57,7 @@ public interface ProcessEngine {
HistoryService getHistoryService();
ManagementService getManagementService();
DynamicBpmnService getDynamicBpmnService();
ProcessEngineConfiguration getProcessEngineConfiguration();
......
/* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
......@@ -20,7 +20,7 @@ import org.activiti.bpmn.model.FlowElement;
/**
* Execution used in {@link JavaDelegate}s and {@link ExecutionListener}s.
*
*
*/
......@@ -33,7 +33,7 @@ public interface DelegateExecution extends VariableScope {
/** Reference to the overall process instance */
String getProcessInstanceId();
/**
* The 'root' process instance. When using call activity for example, the processInstance
* set will not always be the root. This method returns the topmost process instance.
......@@ -44,9 +44,9 @@ public interface DelegateExecution extends VariableScope {
* Will contain the event name in case this execution is passed in for an {@link ExecutionListener}.
*/
String getEventName();
/**
* Sets the current event (typically when execution an {@link ExecutionListener}).
* Sets the current event (typically when execution an {@link ExecutionListener}).
*/
void setEventName(String eventName);
......@@ -79,26 +79,26 @@ public interface DelegateExecution extends VariableScope {
* Returns the tenant id, if any is set before on the process definition or process instance.
*/
String getTenantId();
/**
* The BPMN element where the execution currently is at.
* The BPMN element where the execution currently is at.
*/
FlowElement getCurrentFlowElement();
/**
* Change the current BPMN element the execution is at.
* Change the current BPMN element the execution is at.
*/
void setCurrentFlowElement(FlowElement flowElement);
/**
* Returns the {@link ActivitiListener} instance matching an {@link ExecutionListener}
* if currently an execution listener is being execution.
* if currently an execution listener is being execution.
* Returns null otherwise.
*/
ActivitiListener getCurrentActivitiListener();
/**
* Called when an {@link ExecutionListener} is being executed.
* Called when an {@link ExecutionListener} is being executed.
*/
void setCurrentActivitiListener(ActivitiListener currentActivitiListener);
......@@ -160,12 +160,12 @@ public interface DelegateExecution extends VariableScope {
* Changes whether this execution is a scope or not.
*/
void setScope(boolean isScope);
/**
* Returns whather this execution is the root of a multi instance execution.
*/
boolean isMultiInstanceRoot();
/**
* Changes whether this execution is a multi instance root or not.
* @param isMultiInstanceRoot
......
/* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
......@@ -55,7 +55,7 @@ public class UserTaskActivityBehavior extends TaskActivityBehavior {
private static final long serialVersionUID = 1L;
private static final Logger LOGGER = LoggerFactory.getLogger(UserTaskActivityBehavior.class);
protected UserTask userTask;
public UserTaskActivityBehavior(UserTask userTask) {
......@@ -65,9 +65,10 @@ public class UserTaskActivityBehavior extends TaskActivityBehavior {
public void execute(DelegateExecution execution) {
CommandContext commandContext = Context.getCommandContext();
TaskEntityManager taskEntityManager = commandContext.getTaskEntityManager();
TaskEntity task = taskEntityManager.create();
task.setExecution((ExecutionEntity) execution);
ExecutionEntity executionEntity = (ExecutionEntity) execution;
task.setExecution(executionEntity);
task.setTaskDefinitionKey(userTask.getId());
String activeTaskName = null;
......@@ -81,10 +82,10 @@ public class UserTaskActivityBehavior extends TaskActivityBehavior {
String activeTaskOwner = null;
List<String> activeTaskCandidateUsers = null;
List<String> activeTaskCandidateGroups = null;
ProcessEngineConfigurationImpl processEngineConfiguration = Context.getProcessEngineConfiguration();
ExpressionManager expressionManager = processEngineConfiguration.getExpressionManager();
if (Context.getProcessEngineConfiguration().isEnableProcessDefinitionInfoCache()) {
ObjectNode taskElementProperties = Context.getBpmnOverrideElementProperties(userTask.getId(), execution.getProcessDefinitionId());
activeTaskName = getActiveValue(userTask.getName(), DynamicBpmnConstants.USER_TASK_NAME, taskElementProperties);
......@@ -98,7 +99,7 @@ public class UserTaskActivityBehavior extends TaskActivityBehavior {
activeTaskOwner = getActiveValue(userTask.getOwner(), DynamicBpmnConstants.USER_TASK_OWNER, taskElementProperties);
activeTaskCandidateUsers = getActiveValueList(userTask.getCandidateUsers(), DynamicBpmnConstants.USER_TASK_CANDIDATE_USERS, taskElementProperties);
activeTaskCandidateGroups = getActiveValueList(userTask.getCandidateGroups(), DynamicBpmnConstants.USER_TASK_CANDIDATE_GROUPS, taskElementProperties);
} else {
activeTaskName = userTask.getName();
activeTaskDescription = userTask.getDocumentation();
......@@ -123,7 +124,7 @@ public class UserTaskActivityBehavior extends TaskActivityBehavior {
}
task.setName(name);
}
if (StringUtils.isNotEmpty(activeTaskDescription)) {
String description = null;
try {
......@@ -147,17 +148,17 @@ public class UserTaskActivityBehavior extends TaskActivityBehavior {
} else {
businessCalendarName = DueDateBusinessCalendar.NAME;
}
BusinessCalendar businessCalendar = Context.getProcessEngineConfiguration().getBusinessCalendarManager()
.getBusinessCalendar(businessCalendarName);
task.setDueDate(businessCalendar.resolveDuedate((String) dueDate));
} else {
throw new ActivitiIllegalArgumentException("Due date expression does not resolve to a Date or Date string: " + activeTaskDueDate);
}
}
}
if (StringUtils.isNotEmpty(activeTaskPriority)) {
final Object priority = expressionManager.createExpression(activeTaskPriority).getValue(execution);
if (priority != null) {
......@@ -185,7 +186,7 @@ public class UserTaskActivityBehavior extends TaskActivityBehavior {
}
}
}
if (StringUtils.isNotEmpty(activeTaskFormKey)) {
final Object formKey = expressionManager.createExpression(activeTaskFormKey).getValue(execution);
if (formKey != null) {
......@@ -197,26 +198,27 @@ public class UserTaskActivityBehavior extends TaskActivityBehavior {
}
}
task.setAppVersion(executionEntity.getProcessInstance().getAppVersion());
taskEntityManager.insert(task, (ExecutionEntity) execution);
taskEntityManager.insert(task, executionEntity);
task.setVariablesLocal(calculateInputVariables(execution));
boolean skipUserTask = false;
if (StringUtils.isNotEmpty(activeTaskSkipExpression)) {
Expression skipExpression = expressionManager.createExpression(activeTaskSkipExpression);
skipUserTask = SkipExpressionUtil.isSkipExpressionEnabled(execution, skipExpression)
skipUserTask = SkipExpressionUtil.isSkipExpressionEnabled(execution, skipExpression)
&& SkipExpressionUtil.shouldSkipFlowElement(execution, skipExpression);
}
// Handling assignments need to be done after the task is inserted, to have an id
if (!skipUserTask) {
handleAssignments(taskEntityManager, activeTaskAssignee, activeTaskOwner,
handleAssignments(taskEntityManager, activeTaskAssignee, activeTaskOwner,
activeTaskCandidateUsers, activeTaskCandidateGroups, task, expressionManager, execution);
}
processEngineConfiguration.getListenerNotificationHelper().executeTaskListeners(task, TaskListener.EVENTNAME_CREATE);
// All properties set, now fire events
if (Context.getProcessEngineConfiguration().getEventDispatcher().isEnabled()) {
ActivitiEventDispatcher eventDispatcher = Context.getProcessEngineConfiguration().getEventDispatcher();
......@@ -227,7 +229,7 @@ public class UserTaskActivityBehavior extends TaskActivityBehavior {
ActivitiEventBuilder.createEntityEvent(ActivitiEventType.TASK_ASSIGNED, task));
}
}
if (skipUserTask) {
taskEntityManager.deleteTask(task, null, false, false);
leave(execution);
......@@ -243,7 +245,7 @@ public class UserTaskActivityBehavior extends TaskActivityBehavior {
return Collections.emptyMap();
}
}
protected Map<String, Object> calculateOutBoundVariables(DelegateExecution execution,
Map<String, Object> taskVariables) {
CommandContext commandContext = Context.getCommandContext();
......@@ -255,7 +257,7 @@ public class UserTaskActivityBehavior extends TaskActivityBehavior {
public void trigger(DelegateExecution execution, String signalName, Object signalData) {
CommandContext commandContext = Context.getCommandContext();
TaskEntityManager taskEntityManager = commandContext.getTaskEntityManager();
List<TaskEntity> taskEntities = taskEntityManager.findTasksByExecutionId(execution.getId()); // Should be only one
for (TaskEntity taskEntity : taskEntities) {
......@@ -292,7 +294,7 @@ public class UserTaskActivityBehavior extends TaskActivityBehavior {
@SuppressWarnings({ "unchecked", "rawtypes" })
protected void handleAssignments(TaskEntityManager taskEntityManager, String assignee, String owner, List<String> candidateUsers,
List<String> candidateGroups, TaskEntity task, ExpressionManager expressionManager, DelegateExecution execution) {
if (StringUtils.isNotEmpty(assignee)) {
Object assigneeExpressionValue = expressionManager.createExpression(assignee).getValue(execution);
String assigneeValue = null;
......@@ -342,9 +344,9 @@ public class UserTaskActivityBehavior extends TaskActivityBehavior {
}
}
}
if (userTask.getCustomUserIdentityLinks() != null && !userTask.getCustomUserIdentityLinks().isEmpty()) {
for (String customUserIdentityLinkType : userTask.getCustomUserIdentityLinks().keySet()) {
for (String userIdentityLink : userTask.getCustomUserIdentityLinks().get(customUserIdentityLinkType)) {
Expression idExpression = expressionManager.createExpression(userIdentityLink);
......@@ -362,17 +364,17 @@ public class UserTaskActivityBehavior extends TaskActivityBehavior {
} else {
throw new ActivitiException("Expression did not resolve to a string or collection of strings");
}
}
}
}
if (userTask.getCustomGroupIdentityLinks() != null && !userTask.getCustomGroupIdentityLinks().isEmpty()) {
for (String customGroupIdentityLinkType : userTask.getCustomGroupIdentityLinks().keySet()) {
for (String groupIdentityLink : userTask.getCustomGroupIdentityLinks().get(customGroupIdentityLinkType)) {
Expression idExpression = expressionManager.createExpression(groupIdentityLink);
Object value = idExpression.getValue(execution);
if (value instanceof String) {
......@@ -388,17 +390,17 @@ public class UserTaskActivityBehavior extends TaskActivityBehavior {
} else {
throw new ActivitiException("Expression did not resolve to a string or collection of strings");
}
}
}
}
}
/**
* Extract a candidate list from a string.
*
*
* @param str
* @return
*/
......
......@@ -80,6 +80,8 @@ public class BpmnDeployer implements Deployer {
getPreviousVersionsOfProcessDefinitions(parsedDeployment);
setProcessDefinitionVersionsAndIds(parsedDeployment,
mapOfNewProcessDefinitionToPreviousVersion);
setProcessDefinitionAppVersion(parsedDeployment);
persistProcessDefinitionsAndAuthorizations(parsedDeployment);
updateTimersAndEvents(parsedDeployment,
mapOfNewProcessDefinitionToPreviousVersion);
......@@ -437,6 +439,15 @@ public class BpmnDeployer implements Deployer {
return isEqual;
}
private void setProcessDefinitionAppVersion(ParsedDeployment parsedDeployment) {
if (parsedDeployment.getDeployment().getProjectReleaseVersion() != null) {
Integer version = parsedDeployment.getDeployment().getVersion();
for (ProcessDefinitionEntity processDefinition : parsedDeployment.getAllProcessDefinitions()) {
processDefinition.setAppVersion(version);
}
}
}
protected boolean localizeDataObjectElements(List<ValuedDataObject> dataObjects,
ObjectNode infoNode) {
boolean localizationValuesChanged = false;
......
......@@ -82,7 +82,7 @@ public class DeployCmd<T> implements Command<Deployment>, Serializable {
existingDeployment)) {
return existingDeployment;
} else {
deployment.setVersion(existingDeployment.getVersion() != null? existingDeployment.getVersion() + 1 : 2);
deployment.setVersion(existingDeployment.getVersion() + 1);
}
}
}
......
/* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
......@@ -13,30 +13,37 @@
package org.activiti.engine.impl.cmd;
import java.io.Serializable;
import java.util.Optional;
import org.activiti.engine.impl.interceptor.Command;
import org.activiti.engine.impl.interceptor.CommandContext;
import org.activiti.engine.impl.persistence.entity.DeploymentEntity;
import org.activiti.engine.impl.persistence.entity.DeploymentEntityManager;
import org.activiti.engine.impl.persistence.entity.TaskEntity;
import org.activiti.engine.task.Task;
/**
*/
public class NewTaskCmd implements Command<Task>, Serializable {
private static final long serialVersionUID = 1L;
private static final long serialVersionUID = 1L;
protected String taskId;
private final String taskId;
public NewTaskCmd(String taskId) {
this.taskId = taskId;
}
public NewTaskCmd(String taskId) {
this.taskId = taskId;
}
public Task execute(CommandContext commandContext) {
TaskEntity task = commandContext.getTaskEntityManager().create();
task.setId(taskId);
task.setRevision(0);
return task;
}
public Task execute(CommandContext commandContext) {
TaskEntity task = commandContext.getTaskEntityManager().create();
task.setId(taskId);
task.setRevision(0);
findAppVersionFromDeployment(commandContext.getDeploymentEntityManager())
.ifPresent(task::setAppVersion);
return task;
}
private Optional<Integer> findAppVersionFromDeployment(DeploymentEntityManager deploymentEntityManager) {
DeploymentEntity deployment = deploymentEntityManager.findLatestDeploymentByName("SpringAutoDeployment");
return Optional.ofNullable(deployment)
.map(DeploymentEntity::getVersion);
}
}
/* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
......@@ -32,8 +32,6 @@ import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import org.activiti.engine.ActivitiException;
import org.activiti.engine.ActivitiOptimisticLockingException;
......@@ -68,16 +66,10 @@ import org.apache.ibatis.session.SqlSession;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
*/
public class DbSqlSession implements Session {
private static final Logger log = LoggerFactory.getLogger(DbSqlSession.class);
protected static final Pattern CLEAN_VERSION_REGEX = Pattern.compile("\\d\\.\\d*");
protected static final String LAST_V5_VERSION = "5.99.0.0";
protected static final List<ActivitiVersion> ACTIVITI_VERSIONS = new ArrayList<ActivitiVersion>();
......@@ -118,11 +110,11 @@ public class DbSqlSession implements Session {
ACTIVITI_VERSIONS.add(new ActivitiVersion("5.20.0.1"));
ACTIVITI_VERSIONS.add(new ActivitiVersion("5.20.0.2"));
ACTIVITI_VERSIONS.add(new ActivitiVersion("5.21.0.0"));
/*
* Version 5.18.0.1 is the latest v5 version in the list here, although if you would look at the v5 code,
* you'll see there are a few other releases afterwards.
*
*
* The reasoning is as follows: after 5.18.0.1, no database changes were done anymore.
* And if there would be database changes, they would have been part of both 5.x _and_ 6.x upgrade scripts.
* The logic below will assume it's one of these releases in case it isn't found in the list here
......@@ -141,6 +133,7 @@ public class DbSqlSession implements Session {
// Version 7
ACTIVITI_VERSIONS.add(new ActivitiVersion("7.0.0.0"));
ACTIVITI_VERSIONS.add(new ActivitiVersion("7.1.0.0"));
/* Current */
ACTIVITI_VERSIONS.add(new ActivitiVersion(ProcessEngine.VERSION));
......@@ -1191,49 +1184,6 @@ public class DbSqlSession implements Session {
}
}
protected boolean isUpgradeNeeded(String versionInDatabase) {
if (ProcessEngine.VERSION.equals(versionInDatabase)) {
return false;
}
String cleanDbVersion = getCleanVersion(versionInDatabase);
String[] cleanDbVersionSplitted = cleanDbVersion.split("\\.");
int dbMajorVersion = Integer.valueOf(cleanDbVersionSplitted[0]);
int dbMinorVersion = Integer.valueOf(cleanDbVersionSplitted[1]);
String cleanEngineVersion = getCleanVersion(ProcessEngine.VERSION);
String[] cleanEngineVersionSplitted = cleanEngineVersion.split("\\.");
int engineMajorVersion = Integer.valueOf(cleanEngineVersionSplitted[0]);
int engineMinorVersion = Integer.valueOf(cleanEngineVersionSplitted[1]);
if ((dbMajorVersion > engineMajorVersion) || ((dbMajorVersion <= engineMajorVersion) && (dbMinorVersion > engineMinorVersion))) {
throw new ActivitiException("Version of activiti database (" + versionInDatabase + ") is more recent than the engine (" + ProcessEngine.VERSION + ")");
} else if (cleanDbVersion.compareTo(cleanEngineVersion) == 0) {
// Versions don't match exactly, possibly snapshot is being used
log.warn("Engine-version is the same, but not an exact match: {} vs. {}. Not performing database-upgrade.",
versionInDatabase,
ProcessEngine.VERSION);
return false;
}
return true;
}
protected String getCleanVersion(String versionString) {
Matcher matcher = CLEAN_VERSION_REGEX.matcher(versionString);
if (!matcher.find()) {
throw new ActivitiException("Illegal format for version: " + versionString);
}
String cleanString = matcher.group();
try {
Double.parseDouble(cleanString); // try to parse it, to see if it is
// really a number
return cleanString;
} catch (NumberFormatException nfe) {
throw new ActivitiException("Illegal format for version: " + versionString);
}
}
protected String prependDatabaseTablePrefix(String tableName) {
return dbSqlSessionFactory.getDatabaseTablePrefix() + tableName;
}
......
/* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
......@@ -22,11 +22,9 @@ import org.activiti.engine.impl.db.HasRevision;
import org.activiti.engine.runtime.Execution;
import org.activiti.engine.runtime.ProcessInstance;
/**
*/
@Internal
public interface ExecutionEntity extends DelegateExecution, Execution, ProcessInstance, Entity, HasRevision {
void setBusinessKey(String businessKey);
void setProcessDefinitionId(String processDefinitionId);
......@@ -42,7 +40,7 @@ public interface ExecutionEntity extends DelegateExecution, Execution, ProcessIn
ExecutionEntity getProcessInstance();
void setProcessInstance(ExecutionEntity processInstance);
ExecutionEntity getParent();
void setParent(ExecutionEntity parent);
......@@ -56,25 +54,25 @@ public interface ExecutionEntity extends DelegateExecution, Execution, ProcessIn
void setSubProcessInstance(ExecutionEntity subProcessInstance);
void setRootProcessInstanceId(String rootProcessInstanceId);
public void setParentProcessInstanceId(String parentProcessInstanceId);
ExecutionEntity getRootProcessInstance();
void setRootProcessInstance(ExecutionEntity rootProcessInstance);
List<? extends ExecutionEntity> getExecutions();
void addChildExecution(ExecutionEntity executionEntity);
List<TaskEntity> getTasks();
List<EventSubscriptionEntity> getEventSubscriptions();
List<JobEntity> getJobs();
List<TimerJobEntity> getTimerJobs();
List<IdentityLinkEntity> getIdentityLinks();
void setProcessInstanceId(String processInstanceId);
......@@ -96,19 +94,19 @@ public interface ExecutionEntity extends DelegateExecution, Execution, ProcessIn
boolean isEventScope();
void setEventScope(boolean isEventScope);
boolean isMultiInstanceRoot();
void setMultiInstanceRoot(boolean isMultiInstanceRoot);
void setName(String name);
void setDescription(String description);
void setLocalizedName(String localizedName);
void setLocalizedDescription(String localizedDescription);
void setTenantId(String tenantId);
Date getLockTime();
......@@ -118,7 +116,7 @@ public interface ExecutionEntity extends DelegateExecution, Execution, ProcessIn
boolean isDeleted();
void setDeleted(boolean isDeleted);
void forceUpdate();
String getStartUserId();
......@@ -128,5 +126,5 @@ public interface ExecutionEntity extends DelegateExecution, Execution, ProcessIn
Date getStartTime();
void setStartTime(Date startTime);
}
/* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
......@@ -31,21 +31,13 @@ import org.activiti.engine.impl.interceptor.CommandContext;
import org.activiti.engine.impl.persistence.CountingExecutionEntity;
import org.activiti.engine.impl.util.ProcessDefinitionUtil;
/**
*/
public class ExecutionEntityImpl extends VariableScopeImpl implements ExecutionEntity, CountingExecutionEntity {
private static final long serialVersionUID = 1L;
// current position /////////////////////////////////////////////////////////
protected FlowElement currentFlowElement;
protected FlowElement currentFlowElement;
protected ActivitiListener currentActivitiListener; // Only set when executing an execution listener
/**
......@@ -75,7 +67,7 @@ public class ExecutionEntityImpl extends VariableScopeImpl implements ExecutionE
protected Date lockTime;
// state/type of execution //////////////////////////////////////////////////
protected boolean isActive = true;
protected boolean isScope = true;
protected boolean isConcurrent;
......@@ -85,7 +77,7 @@ public class ExecutionEntityImpl extends VariableScopeImpl implements ExecutionE
protected boolean isCountEnabled;
// events ///////////////////////////////////////////////////////////////////
// TODO: still needed in v6?
protected String eventName;
......@@ -102,13 +94,13 @@ public class ExecutionEntityImpl extends VariableScopeImpl implements ExecutionE
// cascade deletion ////////////////////////////////////////////////////////
protected String deleteReason;
protected int suspensionState = SuspensionState.ACTIVE.getStateCode();
protected String startUserId;
protected Date startTime;
// CountingExecutionEntity
// CountingExecutionEntity
protected int eventSubscriptionCount;
protected int taskCount;
protected int jobCount;
......@@ -120,7 +112,7 @@ public class ExecutionEntityImpl extends VariableScopeImpl implements ExecutionE
/**
* persisted reference to the processDefinition.
*
*
* @see #processDefinition
* @see #setProcessDefinition(ProcessDefinitionImpl)
* @see #getProcessDefinition()
......@@ -149,7 +141,7 @@ public class ExecutionEntityImpl extends VariableScopeImpl implements ExecutionE
/**
* persisted reference to the current position in the diagram within the {@link #processDefinition}.
*
*
* @see #activity
* @see #setActivity(ActivityImpl)
* @see #getActivity()
......@@ -163,7 +155,7 @@ public class ExecutionEntityImpl extends VariableScopeImpl implements ExecutionE
/**
* persisted reference to the process instance.
*
*
* @see #getProcessInstance()
*/
protected String processInstanceId;
......@@ -175,7 +167,7 @@ public class ExecutionEntityImpl extends VariableScopeImpl implements ExecutionE
/**
* persisted reference to the parent of this execution.
*
*
* @see #getParent()
* @see #setParentId(String)
*/
......@@ -183,27 +175,29 @@ public class ExecutionEntityImpl extends VariableScopeImpl implements ExecutionE
/**
* persisted reference to the super execution of this execution
*
*
* @See {@link #getSuperExecution()}
* @see #setSuperExecution(ExecutionEntityImpl)
*/
protected String superExecutionId;
protected String rootProcessInstanceId;
protected ExecutionEntityImpl rootProcessInstance;
protected boolean forcedUpdate;
protected List<VariableInstanceEntity> queryVariables;
protected boolean isDeleted; // TODO: should be in entity superclass probably
protected String parentProcessInstanceId;
public ExecutionEntityImpl() {
private Integer appVersion;
public ExecutionEntityImpl() {
}
/**
* Static factory method: to be used when a new execution is created for the very first time/
* Calling this will make sure no extra db fetches are needed later on, as all collections
......@@ -221,8 +215,8 @@ public class ExecutionEntityImpl extends VariableScopeImpl implements ExecutionE
execution.identityLinks = new ArrayList<IdentityLinkEntity>(1);
return execution;
}
//persistent state /////////////////////////////////////////////////////////
public Object getPersistentState() {
......@@ -255,7 +249,7 @@ public class ExecutionEntityImpl extends VariableScopeImpl implements ExecutionE
persistentState.put("identityLinkCount", identityLinkCount);
return persistentState;
}
// The current flow element, will be filled during operation execution
public FlowElement getCurrentFlowElement() {
......@@ -277,7 +271,7 @@ public class ExecutionEntityImpl extends VariableScopeImpl implements ExecutionE
this.activityId = null;
}
}
public ActivitiListener getCurrentActivitiListener() {
return currentActivitiListener;
}
......@@ -293,7 +287,7 @@ public class ExecutionEntityImpl extends VariableScopeImpl implements ExecutionE
ensureExecutionsInitialized();
return executions;
}
@Override
public void addChildExecution(ExecutionEntity executionEntity) {
ensureExecutionsInitialized();
......@@ -421,7 +415,7 @@ public class ExecutionEntityImpl extends VariableScopeImpl implements ExecutionE
public void setParentProcessInstanceId(String parentProcessInstanceId) {
this.parentProcessInstanceId = parentProcessInstanceId;
}
// super- and subprocess executions /////////////////////////////////////////
public String getSuperExecutionId() {
......@@ -441,7 +435,7 @@ public class ExecutionEntityImpl extends VariableScopeImpl implements ExecutionE
if (superExecution != null) {
this.superExecutionId = ((ExecutionEntityImpl) superExecution).getId();
this.parentProcessInstanceId = superExecution.getProcessInstanceId();
this.parentProcessInstanceId = superExecution.getProcessInstanceId();
} else {
this.superExecutionId = null;
this.parentProcessInstanceId = null;
......@@ -468,18 +462,18 @@ public class ExecutionEntityImpl extends VariableScopeImpl implements ExecutionE
subProcessInstance = (ExecutionEntityImpl) Context.getCommandContext().getExecutionEntityManager().findSubProcessInstanceBySuperExecutionId(id);
}
}
public ExecutionEntity getRootProcessInstance() {
ensureRootProcessInstanceInitialized();
return rootProcessInstance;
}
protected void ensureRootProcessInstanceInitialized() {
if (rootProcessInstanceId == null) {
rootProcessInstance = (ExecutionEntityImpl) Context.getCommandContext().getExecutionEntityManager().findById(rootProcessInstanceId);
}
}
public void setRootProcessInstance(ExecutionEntity rootProcessInstance) {
this.rootProcessInstance = (ExecutionEntityImpl) rootProcessInstance;
......@@ -489,11 +483,11 @@ public class ExecutionEntityImpl extends VariableScopeImpl implements ExecutionE
this.rootProcessInstanceId = null;
}
}
public String getRootProcessInstanceId() {
return rootProcessInstanceId;
}
public void setRootProcessInstanceId(String rootProcessInstanceId) {
this.rootProcessInstanceId = rootProcessInstanceId;
}
......@@ -511,11 +505,11 @@ public class ExecutionEntityImpl extends VariableScopeImpl implements ExecutionE
public void forceUpdate() {
this.forcedUpdate = true;
}
// VariableScopeImpl methods //////////////////////////////////////////////////////////////////
// TODO: this should ideally move to another place
// TODO: this should ideally move to another place
@Override
protected void initializeVariableInstanceBackPointer(VariableInstanceEntity variableInstance) {
if (processInstanceId != null) {
......@@ -558,7 +552,7 @@ public class ExecutionEntityImpl extends VariableScopeImpl implements ExecutionE
}
return result;
}
@Override
protected void updateVariableInstance(VariableInstanceEntity variableInstance, Object value, ExecutionEntity sourceActivityExecution) {
super.updateVariableInstance(variableInstance, value, sourceActivityExecution);
......@@ -614,18 +608,18 @@ public class ExecutionEntityImpl extends VariableScopeImpl implements ExecutionE
ensureJobsInitialized();
return jobs;
}
protected void ensureJobsInitialized() {
if (jobs == null) {
jobs = Context.getCommandContext().getJobEntityManager().findJobsByExecutionId(id);
}
}
public List<TimerJobEntity> getTimerJobs() {
ensureTimerJobsInitialized();
return timerJobs;
}
protected void ensureTimerJobsInitialized() {
if (timerJobs == null) {
timerJobs = Context.getCommandContext().getTimerJobEntityManager().findJobsByExecutionId(id);
......@@ -695,7 +689,7 @@ public class ExecutionEntityImpl extends VariableScopeImpl implements ExecutionE
public void setActive(boolean isActive) {
this.isActive = isActive;
}
public void inactivate() {
this.isActive = false;
}
......@@ -703,7 +697,7 @@ public class ExecutionEntityImpl extends VariableScopeImpl implements ExecutionE
public boolean isEnded() {
return isEnded;
}
public void setEnded(boolean isEnded) {
this.isEnded = isEnded;
}
......@@ -743,17 +737,17 @@ public class ExecutionEntityImpl extends VariableScopeImpl implements ExecutionE
public void setEventScope(boolean isEventScope) {
this.isEventScope = isEventScope;
}
@Override
public boolean isMultiInstanceRoot() {
return isMultiInstanceRoot;
}
@Override
public void setMultiInstanceRoot(boolean isMultiInstanceRoot) {
this.isMultiInstanceRoot = isMultiInstanceRoot;
}
@Override
public boolean isCountEnabled() {
return isCountEnabled;
......@@ -788,23 +782,23 @@ public class ExecutionEntityImpl extends VariableScopeImpl implements ExecutionE
return description;
}
}
public void setDescription(String description) {
this.description = description;
}
public String getLocalizedName() {
return localizedName;
}
public void setLocalizedName(String localizedName) {
this.localizedName = localizedName;
}
public String getLocalizedDescription() {
return localizedDescription;
}
public void setLocalizedDescription(String localizedDescription) {
this.localizedDescription = localizedDescription;
}
......@@ -855,7 +849,7 @@ public class ExecutionEntityImpl extends VariableScopeImpl implements ExecutionE
public void setDeleted(boolean isDeleted) {
this.isDeleted = isDeleted;
}
public String getActivityName() {
return activityName;
}
......@@ -875,7 +869,7 @@ public class ExecutionEntityImpl extends VariableScopeImpl implements ExecutionE
public void setStartTime(Date startTime) {
this.startTime = startTime;
}
public int getEventSubscriptionCount() {
return eventSubscriptionCount;
}
......@@ -899,7 +893,7 @@ public class ExecutionEntityImpl extends VariableScopeImpl implements ExecutionE
public void setJobCount(int jobCount) {
this.jobCount = jobCount;
}
public int getTimerJobCount() {
return timerJobCount;
}
......@@ -931,15 +925,24 @@ public class ExecutionEntityImpl extends VariableScopeImpl implements ExecutionE
public void setVariableCount(int variableCount) {
this.variableCount = variableCount;
}
public int getIdentityLinkCount() {
return identityLinkCount;
}
public void setIdentityLinkCount(int identityLinkCount) {
this.identityLinkCount = identityLinkCount;
}
}
@Override
public void setAppVersion(Integer appVersion) {
this.appVersion = appVersion;
}
@Override
public Integer getAppVersion() {
return appVersion;
}
//toString /////////////////////////////////////////////////////////////////
......
......@@ -18,10 +18,6 @@ import org.activiti.engine.api.internal.Internal;
import org.activiti.engine.impl.db.HasRevision;
import org.activiti.engine.repository.ProcessDefinition;
/**
*/
@Internal
public interface ProcessDefinitionEntity extends ProcessDefinition, Entity, HasRevision {
......
......@@ -22,10 +22,6 @@ import org.activiti.engine.ProcessEngineConfiguration;
import org.activiti.engine.impl.bpmn.data.IOSpecification;
import org.activiti.engine.impl.context.Context;
/**
*/
public class ProcessDefinitionEntityImpl extends AbstractEntity implements ProcessDefinitionEntity, Serializable {
private static final long serialVersionUID = 1L;
......@@ -47,6 +43,7 @@ public class ProcessDefinitionEntityImpl extends AbstractEntity implements Proce
protected boolean isIdentityLinksInitialized;
protected List<IdentityLinkEntity> definitionIdentityLinkEntities = new ArrayList<IdentityLinkEntity>();
protected IOSpecification ioSpecification;
protected Integer appVersion;
// Backwards compatibility
protected String engineVersion;
......@@ -218,4 +215,12 @@ public class ProcessDefinitionEntityImpl extends AbstractEntity implements Proce
return "ProcessDefinitionEntity[" + id + "]";
}
public void setAppVersion(Integer appVersion){
this.appVersion = appVersion;
}
public Integer getAppVersion(){
return this.appVersion;
}
}
......@@ -92,6 +92,8 @@ public class TaskEntityImpl extends VariableScopeImpl implements TaskEntity, Ser
protected Date claimTime;
protected Integer appVersion;
public TaskEntityImpl() {
}
......@@ -600,6 +602,14 @@ public class TaskEntityImpl extends VariableScopeImpl implements TaskEntity, Ser
this.claimTime = claimTime;
}
public Integer getAppVersion(){
return this.appVersion;
}
public void setAppVersion (Integer appVersion){
this.appVersion = appVersion;
}
public String toString() {
return "Task[id=" + id + ", name=" + name + "]";
}
......
......@@ -80,6 +80,7 @@ public class TaskEntityManagerImpl extends AbstractEntityManager<TaskEntity> imp
taskEntity.setExecutionId(execution.getId());
taskEntity.setProcessInstanceId(execution.getProcessInstanceId());
taskEntity.setProcessDefinitionId(execution.getProcessDefinitionId());
taskEntity.setAppVersion(execution.getAppVersion());
getHistoryManager().recordTaskExecutionIdChange(taskEntity.getId(), taskEntity.getExecutionId());
}
......
......@@ -132,9 +132,9 @@ public class ProcessInstanceHelper {
// Map message payload variables before creating process instance
Map<String, Object> processVariables = commandContext.getProcessEngineConfiguration()
.getEventSubscriptionPayloadMappingProvider()
.apply(messageVariables,
.apply(messageVariables,
eventSubscription);
// Create process instance with executions but defer to start process after dispatching ACTIVITY_MESSAGE_RECEIVED
ExecutionEntity processInstance = createProcessInstanceWithInitialFlowElement(processDefinition,
businessKey,
......@@ -145,13 +145,13 @@ public class ProcessInstanceHelper {
transientVariables);
// Dispatch message received event
dispatchStartMessageReceivedEvent(processInstance, messageName, messageVariables);
// Finally start the process
// Finally start the process
startProcessInstance(processInstance, commandContext, processVariables);
return processInstance;
}
public ProcessInstance createAndStartProcessInstanceWithInitialFlowElement(ProcessDefinition processDefinition,
String businessKey, String processInstanceName, FlowElement initialFlowElement,
Process process, Map<String, Object> variables, Map<String, Object> transientVariables, boolean startProcessInstance) {
......@@ -164,8 +164,8 @@ public class ProcessInstanceHelper {
variables,
transientVariables);
if (startProcessInstance) {
CommandContext commandContext = Context.getCommandContext();
CommandContext commandContext = Context.getCommandContext();
startProcessInstance(processInstance, commandContext, variables);
}
......@@ -196,19 +196,19 @@ public class ProcessInstanceHelper {
ExecutionEntity messageExecution = commandContext.getExecutionEntityManager().createChildExecution(processInstance);
messageExecution.setCurrentFlowElement(startEvent);
messageExecution.setEventScope(true);
String messageName = getMessageName(commandContext,
messageEventDefinition,
String messageName = getMessageName(commandContext,
messageEventDefinition,
messageExecution);
MessageEventSubscriptionEntity subscription = commandContext.getEventSubscriptionEntityManager()
.insertMessageEvent(messageName,
messageExecution);
Optional<String> correlationKey = getCorrelationKey(commandContext,
messageEventDefinition,
messageExecution);
Optional<String> correlationKey = getCorrelationKey(commandContext,
messageEventDefinition,
messageExecution);
correlationKey.ifPresent(subscription::setConfiguration);
messageEventSubscriptions.add(subscription);
}
}
......@@ -216,14 +216,17 @@ public class ProcessInstanceHelper {
}
}
}
ExecutionEntity execution = processInstance.getExecutions().get(0); // There will always be one child execution created
execution.setAppVersion(processInstance.getAppVersion());
commandContext.getAgenda().planContinueProcessOperation(execution);
if (Context.getProcessEngineConfiguration().getEventDispatcher().isEnabled()) {
ActivitiEventDispatcher eventDispatcher = Context.getProcessEngineConfiguration().getEventDispatcher();
eventDispatcher.dispatchEvent(ActivitiEventBuilder.createProcessStartedEvent(execution, variables, false));
for (MessageEventSubscriptionEntity messageEventSubscription : messageEventSubscriptions) {
commandContext.getProcessEngineConfiguration().getEventDispatcher()
.dispatchEvent(ActivitiEventBuilder.createMessageWaitingEvent(messageEventSubscription.getExecution(),
......@@ -243,39 +246,39 @@ public class ProcessInstanceHelper {
}
return variablesMap;
}
protected Optional<String> getCorrelationKey(CommandContext commandContext,
MessageEventDefinition messageEventDefinition,
DelegateExecution execution) {
ExpressionManager expressionManager = commandContext.getProcessEngineConfiguration()
.getExpressionManager();
return Optional.ofNullable(messageEventDefinition.getCorrelationKey())
.map(correlationKey -> {
Expression expression = expressionManager.createExpression(messageEventDefinition.getCorrelationKey());
return expression.getValue(execution)
.toString();
});
});
}
protected String getMessageName(CommandContext commandContext,
MessageEventDefinition messageEventDefinition,
DelegateExecution execution) {
ExpressionManager expressionManager = commandContext.getProcessEngineConfiguration()
.getExpressionManager();
String messageName = Optional.ofNullable(messageEventDefinition.getMessageRef())
.orElse(messageEventDefinition.getMessageExpression());
Expression expression = expressionManager.createExpression(messageName);
return expression.getValue(execution)
.toString();
}
public ExecutionEntity createProcessInstanceWithInitialFlowElement(ProcessDefinition processDefinition,
String businessKey,
......@@ -345,19 +348,19 @@ public class ProcessInstanceHelper {
Map<String, Object> variables) {
// Dispatch message received event
if (Context.getProcessEngineConfiguration().getEventDispatcher().isEnabled()) {
// There will always be one child execution created
// There will always be one child execution created
DelegateExecution execution = processInstance.getExecutions()
.get(0);
ActivitiEventDispatcher eventDispatcher = Context.getProcessEngineConfiguration()
.getEventDispatcher();
eventDispatcher.dispatchEvent(ActivitiEventBuilder.createMessageReceivedEvent(execution,
messageName,
null,
variables));
}
}
}
......@@ -78,4 +78,8 @@ public interface ProcessDefinition {
/** The engine version for this process definition (5 or 6) */
String getEngineVersion();
void setAppVersion(Integer appVersion);
Integer getAppVersion();
}
......@@ -99,4 +99,8 @@ public interface ProcessInstance extends Execution {
* Returns the user id of this process instance.
*/
String getStartUserId();
void setAppVersion(Integer appVersion);
Integer getAppVersion();
}
......@@ -79,4 +79,8 @@ public interface Task extends TaskInfo {
/** Indicates whether this task is suspended or not. */
boolean isSuspended();
Integer getAppVersion();
void setAppVersion(Integer appVersion);
}
......@@ -6,10 +6,10 @@ create table ACT_GE_PROPERTY (
);
insert into ACT_GE_PROPERTY
values ('schema.version', '7.0.0.0', 1);
values ('schema.version', '7.1.0-M6', 1);
insert into ACT_GE_PROPERTY
values ('schema.history', 'create(7.0.0.0)', 1);
values ('schema.history', 'create(7.1.0-M6)', 1);
insert into ACT_GE_PROPERTY
values ('next.dbid', '1', 1);
......@@ -32,7 +32,7 @@ create table ACT_RE_DEPLOYMENT (
TENANT_ID_ varchar(255) default '',
DEPLOY_TIME_ timestamp,
ENGINE_VERSION_ varchar(255),
VERSION_ integer,
VERSION_ integer default 1,
PROJECT_RELEASE_VERSION_ varchar(255),
primary key (ID_)
);
......@@ -77,14 +77,15 @@ create table ACT_RU_EXECUTION (
START_USER_ID_ varchar(255),
LOCK_TIME_ timestamp,
IS_COUNT_ENABLED_ smallint check(IS_COUNT_ENABLED_ in (1,0)),
EVT_SUBSCR_COUNT_ integer,
TASK_COUNT_ integer,
JOB_COUNT_ integer,
EVT_SUBSCR_COUNT_ integer,
TASK_COUNT_ integer,
JOB_COUNT_ integer,
TIMER_JOB_COUNT_ integer,
SUSP_JOB_COUNT_ integer,
DEADLETTER_JOB_COUNT_ integer,
VAR_COUNT_ integer,
VAR_COUNT_ integer,
ID_LINK_COUNT_ integer,
APP_VERSION_ integer,
primary key (ID_)
);
......@@ -183,6 +184,7 @@ create table ACT_RE_PROCDEF (
SUSPENSION_STATE_ integer,
TENANT_ID_ varchar(255) not null default '',
ENGINE_VERSION_ varchar(255),
APP_VERSION_ integer,
primary key (ID_)
);
......@@ -207,6 +209,7 @@ create table ACT_RU_TASK (
TENANT_ID_ varchar(255) default '',
FORM_KEY_ varchar(255),
CLAIM_TIME_ timestamp,
APP_VERSION_ integer,
primary key (ID_)
);
......@@ -328,67 +331,67 @@ create index ACT_IDX_DEADLETTER_JOB_EXCEPTION_STACK_ID on ACT_RU_DEADLETTER_JOB(
create index ACT_IDX_INFO_PROCDEF on ACT_PROCDEF_INFO(PROC_DEF_ID_);
alter table ACT_GE_BYTEARRAY
add constraint ACT_FK_BYTEARR_DEPL
foreign key (DEPLOYMENT_ID_)
add constraint ACT_FK_BYTEARR_DEPL
foreign key (DEPLOYMENT_ID_)
references ACT_RE_DEPLOYMENT (ID_);
alter table ACT_RE_PROCDEF
add constraint ACT_UNIQ_PROCDEF
unique (KEY_,VERSION_, TENANT_ID_);
alter table ACT_RU_EXECUTION
add constraint ACT_FK_EXE_PROCINST
foreign key (PROC_INST_ID_)
add constraint ACT_FK_EXE_PROCINST
foreign key (PROC_INST_ID_)
references ACT_RU_EXECUTION (ID_);
alter table ACT_RU_EXECUTION
add constraint ACT_FK_EXE_PARENT
foreign key (PARENT_ID_)
add constraint ACT_FK_EXE_PARENT
foreign key (PARENT_ID_)
references ACT_RU_EXECUTION (ID_);
alter table ACT_RU_EXECUTION
add constraint ACT_FK_EXE_SUPER
foreign key (SUPER_EXEC_)
references ACT_RU_EXECUTION (ID_);
add constraint ACT_FK_EXE_SUPER
foreign key (SUPER_EXEC_)
references ACT_RU_EXECUTION (ID_);
alter table ACT_RU_EXECUTION
add constraint ACT_FK_EXE_PROCDEF
foreign key (PROC_DEF_ID_)
references ACT_RE_PROCDEF (ID_);
add constraint ACT_FK_EXE_PROCDEF
foreign key (PROC_DEF_ID_)
references ACT_RE_PROCDEF (ID_);
alter table ACT_RU_IDENTITYLINK
add constraint ACT_FK_TSKASS_TASK
foreign key (TASK_ID_)
add constraint ACT_FK_TSKASS_TASK
foreign key (TASK_ID_)
references ACT_RU_TASK (ID_);
alter table ACT_RU_IDENTITYLINK
add constraint ACT_FK_ATHRZ_PROCEDEF
foreign key (PROC_DEF_ID_)
add constraint ACT_FK_ATHRZ_PROCEDEF
foreign key (PROC_DEF_ID_)
references ACT_RE_PROCDEF (ID_);
alter table ACT_RU_IDENTITYLINK
add constraint ACT_FK_IDL_PROCINST
foreign key (PROC_INST_ID_)
references ACT_RU_EXECUTION (ID_);
foreign key (PROC_INST_ID_)
references ACT_RU_EXECUTION (ID_);
alter table ACT_RU_TASK
add constraint ACT_FK_TASK_EXE
foreign key (EXECUTION_ID_)
references ACT_RU_EXECUTION (ID_);
alter table ACT_RU_TASK
add constraint ACT_FK_TASK_PROCINST
foreign key (PROC_INST_ID_)
references ACT_RU_EXECUTION (ID_);
alter table ACT_RU_TASK
add constraint ACT_FK_TASK_PROCDEF
foreign key (PROC_DEF_ID_)
references ACT_RE_PROCDEF (ID_);
alter table ACT_RU_VARIABLE
add constraint ACT_FK_VAR_EXE
foreign key (EXECUTION_ID_)
alter table ACT_RU_VARIABLE
add constraint ACT_FK_VAR_EXE
foreign key (EXECUTION_ID_)
references ACT_RU_EXECUTION (ID_);
alter table ACT_RU_VARIABLE
......@@ -396,121 +399,121 @@ alter table ACT_RU_VARIABLE
foreign key (PROC_INST_ID_)
references ACT_RU_EXECUTION(ID_);
alter table ACT_RU_VARIABLE
add constraint ACT_FK_VAR_BYTEARRAY
foreign key (BYTEARRAY_ID_)
alter table ACT_RU_VARIABLE
add constraint ACT_FK_VAR_BYTEARRAY
foreign key (BYTEARRAY_ID_)
references ACT_GE_BYTEARRAY (ID_);
alter table ACT_RU_JOB
add constraint ACT_FK_JOB_EXECUTION
foreign key (EXECUTION_ID_)
add constraint ACT_FK_JOB_EXECUTION
foreign key (EXECUTION_ID_)
references ACT_RU_EXECUTION (ID_);
alter table ACT_RU_JOB
add constraint ACT_FK_JOB_PROCESS_INSTANCE
foreign key (PROCESS_INSTANCE_ID_)
alter table ACT_RU_JOB
add constraint ACT_FK_JOB_PROCESS_INSTANCE
foreign key (PROCESS_INSTANCE_ID_)
references ACT_RU_EXECUTION (ID_);
alter table ACT_RU_JOB
alter table ACT_RU_JOB
add constraint ACT_FK_JOB_PROC_DEF
foreign key (PROC_DEF_ID_)
foreign key (PROC_DEF_ID_)
references ACT_RE_PROCDEF (ID_);
alter table ACT_RU_JOB
add constraint ACT_FK_JOB_EXCEPTION
foreign key (EXCEPTION_STACK_ID_)
alter table ACT_RU_JOB
add constraint ACT_FK_JOB_EXCEPTION
foreign key (EXCEPTION_STACK_ID_)
references ACT_GE_BYTEARRAY (ID_);
alter table ACT_RU_TIMER_JOB
add constraint ACT_FK_TIMER_JOB_EXECUTION
foreign key (EXECUTION_ID_)
alter table ACT_RU_TIMER_JOB
add constraint ACT_FK_TIMER_JOB_EXECUTION
foreign key (EXECUTION_ID_)
references ACT_RU_EXECUTION (ID_);
alter table ACT_RU_TIMER_JOB
add constraint ACT_FK_TIMER_JOB_PROCESS_INSTANCE
foreign key (PROCESS_INSTANCE_ID_)
alter table ACT_RU_TIMER_JOB
add constraint ACT_FK_TIMER_JOB_PROCESS_INSTANCE
foreign key (PROCESS_INSTANCE_ID_)
references ACT_RU_EXECUTION (ID_);
alter table ACT_RU_TIMER_JOB
alter table ACT_RU_TIMER_JOB
add constraint ACT_FK_TIMER_JOB_PROC_DEF
foreign key (PROC_DEF_ID_)
foreign key (PROC_DEF_ID_)
references ACT_RE_PROCDEF (ID_);
alter table ACT_RU_TIMER_JOB
add constraint ACT_FK_TIMER_JOB_EXCEPTION
foreign key (EXCEPTION_STACK_ID_)
alter table ACT_RU_TIMER_JOB
add constraint ACT_FK_TIMER_JOB_EXCEPTION
foreign key (EXCEPTION_STACK_ID_)
references ACT_GE_BYTEARRAY (ID_);
alter table ACT_RU_SUSPENDED_JOB
add constraint ACT_FK_SUSPENDED_JOB_EXECUTION
foreign key (EXECUTION_ID_)
alter table ACT_RU_SUSPENDED_JOB
add constraint ACT_FK_SUSPENDED_JOB_EXECUTION
foreign key (EXECUTION_ID_)
references ACT_RU_EXECUTION (ID_);
alter table ACT_RU_SUSPENDED_JOB
add constraint ACT_FK_SUSPENDED_JOB_PROCESS_INSTANCE
foreign key (PROCESS_INSTANCE_ID_)
alter table ACT_RU_SUSPENDED_JOB
add constraint ACT_FK_SUSPENDED_JOB_PROCESS_INSTANCE
foreign key (PROCESS_INSTANCE_ID_)
references ACT_RU_EXECUTION (ID_);
alter table ACT_RU_SUSPENDED_JOB
alter table ACT_RU_SUSPENDED_JOB
add constraint ACT_FK_SUSPENDED_JOB_PROC_DEF
foreign key (PROC_DEF_ID_)
foreign key (PROC_DEF_ID_)
references ACT_RE_PROCDEF (ID_);
alter table ACT_RU_SUSPENDED_JOB
add constraint ACT_FK_SUSPENDED_JOB_EXCEPTION
foreign key (EXCEPTION_STACK_ID_)
alter table ACT_RU_SUSPENDED_JOB
add constraint ACT_FK_SUSPENDED_JOB_EXCEPTION
foreign key (EXCEPTION_STACK_ID_)
references ACT_GE_BYTEARRAY (ID_);
alter table ACT_RU_DEADLETTER_JOB
add constraint ACT_FK_DEADLETTER_JOB_EXECUTION
foreign key (EXECUTION_ID_)
alter table ACT_RU_DEADLETTER_JOB
add constraint ACT_FK_DEADLETTER_JOB_EXECUTION
foreign key (EXECUTION_ID_)
references ACT_RU_EXECUTION (ID_);
alter table ACT_RU_DEADLETTER_JOB
add constraint ACT_FK_DEADLETTER_JOB_PROCESS_INSTANCE
foreign key (PROCESS_INSTANCE_ID_)
alter table ACT_RU_DEADLETTER_JOB
add constraint ACT_FK_DEADLETTER_JOB_PROCESS_INSTANCE
foreign key (PROCESS_INSTANCE_ID_)
references ACT_RU_EXECUTION (ID_);
alter table ACT_RU_DEADLETTER_JOB
alter table ACT_RU_DEADLETTER_JOB
add constraint ACT_FK_DEADLETTER_JOB_PROC_DEF
foreign key (PROC_DEF_ID_)
foreign key (PROC_DEF_ID_)
references ACT_RE_PROCDEF (ID_);
alter table ACT_RU_DEADLETTER_JOB
add constraint ACT_FK_DEADLETTER_JOB_EXCEPTION
foreign key (EXCEPTION_STACK_ID_)
alter table ACT_RU_DEADLETTER_JOB
add constraint ACT_FK_DEADLETTER_JOB_EXCEPTION
foreign key (EXCEPTION_STACK_ID_)
references ACT_GE_BYTEARRAY (ID_);
alter table ACT_RU_EVENT_SUBSCR
add constraint ACT_FK_EVENT_EXEC
foreign key (EXECUTION_ID_)
references ACT_RU_EXECUTION(ID_);
alter table ACT_RE_MODEL
add constraint ACT_FK_MODEL_SOURCE
foreign key (EDITOR_SOURCE_VALUE_ID_)
alter table ACT_RE_MODEL
add constraint ACT_FK_MODEL_SOURCE
foreign key (EDITOR_SOURCE_VALUE_ID_)
references ACT_GE_BYTEARRAY (ID_);
alter table ACT_RE_MODEL
add constraint ACT_FK_MODEL_SOURCE_EXTRA
foreign key (EDITOR_SOURCE_EXTRA_VALUE_ID_)
alter table ACT_RE_MODEL
add constraint ACT_FK_MODEL_SOURCE_EXTRA
foreign key (EDITOR_SOURCE_EXTRA_VALUE_ID_)
references ACT_GE_BYTEARRAY (ID_);
alter table ACT_RE_MODEL
add constraint ACT_FK_MODEL_DEPLOYMENT
foreign key (DEPLOYMENT_ID_)
references ACT_RE_DEPLOYMENT (ID_);
alter table ACT_PROCDEF_INFO
add constraint ACT_FK_INFO_JSON_BA
foreign key (INFO_JSON_ID_)
alter table ACT_RE_MODEL
add constraint ACT_FK_MODEL_DEPLOYMENT
foreign key (DEPLOYMENT_ID_)
references ACT_RE_DEPLOYMENT (ID_);
alter table ACT_PROCDEF_INFO
add constraint ACT_FK_INFO_JSON_BA
foreign key (INFO_JSON_ID_)
references ACT_GE_BYTEARRAY (ID_);
alter table ACT_PROCDEF_INFO
add constraint ACT_FK_INFO_PROCDEF
foreign key (PROC_DEF_ID_)
alter table ACT_PROCDEF_INFO
add constraint ACT_FK_INFO_PROCDEF
foreign key (PROC_DEF_ID_)
references ACT_RE_PROCDEF (ID_);
alter table ACT_PROCDEF_INFO
add constraint ACT_UNIQ_INFO_PROCDEF
unique (PROC_DEF_ID_);
......
......@@ -6,10 +6,10 @@ create table ACT_GE_PROPERTY (
);
insert into ACT_GE_PROPERTY
values ('schema.version', '7.1.0.0', 1);
values ('schema.version', '7.1.0-M6', 1);
insert into ACT_GE_PROPERTY
values ('schema.history', 'create(7.1.0.0)', 1);
values ('schema.history', 'create(7.1.0-M6)', 1);
insert into ACT_GE_PROPERTY
values ('next.dbid', '1', 1);
......@@ -32,7 +32,7 @@ create table ACT_RE_DEPLOYMENT (
TENANT_ID_ varchar(255) default '',
DEPLOY_TIME_ timestamp,
ENGINE_VERSION_ varchar(255),
VERSION_ integer,
VERSION_ integer default 1,
PROJECT_RELEASE_VERSION_ varchar(255),
primary key (ID_)
);
......@@ -77,14 +77,15 @@ create table ACT_RU_EXECUTION (
START_USER_ID_ varchar(255),
LOCK_TIME_ timestamp,
IS_COUNT_ENABLED_ bit,
EVT_SUBSCR_COUNT_ integer,
TASK_COUNT_ integer,
JOB_COUNT_ integer,
EVT_SUBSCR_COUNT_ integer,
TASK_COUNT_ integer,
JOB_COUNT_ integer,
TIMER_JOB_COUNT_ integer,
SUSP_JOB_COUNT_ integer,
DEADLETTER_JOB_COUNT_ integer,
VAR_COUNT_ integer,
VAR_COUNT_ integer,
ID_LINK_COUNT_ integer,
APP_VERSION_ integer,
primary key (ID_)
);
......@@ -183,6 +184,7 @@ create table ACT_RE_PROCDEF (
SUSPENSION_STATE_ integer,
TENANT_ID_ varchar(255) default '',
ENGINE_VERSION_ varchar(255),
APP_VERSION_ integer,
primary key (ID_)
);
......@@ -207,6 +209,7 @@ create table ACT_RU_TASK (
TENANT_ID_ varchar(255) default '',
FORM_KEY_ varchar(255),
CLAIM_TIME_ timestamp,
APP_VERSION_ integer,
primary key (ID_)
);
......@@ -304,7 +307,7 @@ alter table ACT_GE_BYTEARRAY
alter table ACT_RE_PROCDEF
add constraint ACT_UNIQ_PROCDEF
unique (KEY_,VERSION_, TENANT_ID_);
alter table ACT_RU_EXECUTION
add constraint ACT_FK_EXE_PROCINST
foreign key (PROC_INST_ID_)
......@@ -314,17 +317,17 @@ alter table ACT_RU_EXECUTION
add constraint ACT_FK_EXE_PARENT
foreign key (PARENT_ID_)
references ACT_RU_EXECUTION;
alter table ACT_RU_EXECUTION
add constraint ACT_FK_EXE_SUPER
foreign key (SUPER_EXEC_)
add constraint ACT_FK_EXE_SUPER
foreign key (SUPER_EXEC_)
references ACT_RU_EXECUTION;
alter table ACT_RU_EXECUTION
add constraint ACT_FK_EXE_PROCDEF
foreign key (PROC_DEF_ID_)
references ACT_RE_PROCDEF (ID_);
add constraint ACT_FK_EXE_PROCDEF
foreign key (PROC_DEF_ID_)
references ACT_RE_PROCDEF (ID_);
alter table ACT_RU_IDENTITYLINK
add constraint ACT_FK_TSKASS_TASK
foreign key (TASK_ID_)
......@@ -334,11 +337,11 @@ alter table ACT_RU_IDENTITYLINK
add constraint ACT_FK_ATHRZ_PROCEDEF
foreign key (PROC_DEF_ID_)
references ACT_RE_PROCDEF;
alter table ACT_RU_IDENTITYLINK
add constraint ACT_FK_IDL_PROCINST
foreign key (PROC_INST_ID_)
references ACT_RU_EXECUTION (ID_);
foreign key (PROC_INST_ID_)
references ACT_RU_EXECUTION (ID_);
alter table ACT_RU_TASK
add constraint ACT_FK_TASK_EXE
......@@ -369,42 +372,42 @@ alter table ACT_RU_VARIABLE
add constraint ACT_FK_VAR_BYTEARRAY
foreign key (BYTEARRAY_ID_)
references ACT_GE_BYTEARRAY;
alter table ACT_RU_JOB
add constraint ACT_FK_JOB_EXECUTION
foreign key (EXECUTION_ID_)
references ACT_RU_EXECUTION;
alter table ACT_RU_JOB
add constraint ACT_FK_JOB_PROCESS_INSTANCE
foreign key (PROCESS_INSTANCE_ID_)
references ACT_RU_EXECUTION;
alter table ACT_RU_JOB
add constraint ACT_FK_JOB_PROC_DEF
foreign key (PROC_DEF_ID_)
references ACT_RE_PROCDEF;
alter table ACT_RU_JOB
add constraint ACT_FK_JOB_EXCEPTION
foreign key (EXCEPTION_STACK_ID_)
references ACT_GE_BYTEARRAY;
alter table ACT_RU_TIMER_JOB
add constraint ACT_FK_TIMER_JOB_EXECUTION
foreign key (EXECUTION_ID_)
references ACT_RU_EXECUTION;
alter table ACT_RU_TIMER_JOB
add constraint ACT_FK_TIMER_JOB_PROCESS_INSTANCE
foreign key (PROCESS_INSTANCE_ID_)
references ACT_RU_EXECUTION;
alter table ACT_RU_TIMER_JOB
add constraint ACT_FK_TIMER_JOB_PROC_DEF
foreign key (PROC_DEF_ID_)
references ACT_RE_PROCDEF;
references ACT_RE_PROCDEF;
alter table ACT_RU_TIMER_JOB
add constraint ACT_FK_TIMER_JOB_EXCEPTION
foreign key (EXCEPTION_STACK_ID_)
......@@ -414,17 +417,17 @@ alter table ACT_RU_SUSPENDED_JOB
add constraint ACT_FK_SUSPENDED_JOB_EXECUTION
foreign key (EXECUTION_ID_)
references ACT_RU_EXECUTION;
alter table ACT_RU_SUSPENDED_JOB
add constraint ACT_FK_SUSPENDED_JOB_PROCESS_INSTANCE
foreign key (PROCESS_INSTANCE_ID_)
references ACT_RU_EXECUTION;
alter table ACT_RU_SUSPENDED_JOB
add constraint ACT_FK_SUSPENDED_JOB_PROC_DEF
foreign key (PROC_DEF_ID_)
references ACT_RE_PROCDEF;
alter table ACT_RU_SUSPENDED_JOB
add constraint ACT_FK_SUSPENDED_JOB_EXCEPTION
foreign key (EXCEPTION_STACK_ID_)
......@@ -434,12 +437,12 @@ alter table ACT_RU_DEADLETTER_JOB
add constraint ACT_FK_DEADLETTER_JOB_EXECUTION
foreign key (EXECUTION_ID_)
references ACT_RU_EXECUTION;
alter table ACT_RU_DEADLETTER_JOB
add constraint ACT_FK_DEADLETTER_JOB_PROCESS_INSTANCE
foreign key (PROCESS_INSTANCE_ID_)
references ACT_RU_EXECUTION;
alter table ACT_RU_DEADLETTER_JOB
add constraint ACT_FK_DEADLETTER_JOB_PROC_DEF
foreign key (PROC_DEF_ID_)
......@@ -455,31 +458,31 @@ alter table ACT_RU_EVENT_SUBSCR
foreign key (EXECUTION_ID_)
references ACT_RU_EXECUTION;
alter table ACT_RE_MODEL
add constraint ACT_FK_MODEL_SOURCE
foreign key (EDITOR_SOURCE_VALUE_ID_)
alter table ACT_RE_MODEL
add constraint ACT_FK_MODEL_SOURCE
foreign key (EDITOR_SOURCE_VALUE_ID_)
references ACT_GE_BYTEARRAY (ID_);
alter table ACT_RE_MODEL
add constraint ACT_FK_MODEL_SOURCE_EXTRA
foreign key (EDITOR_SOURCE_EXTRA_VALUE_ID_)
alter table ACT_RE_MODEL
add constraint ACT_FK_MODEL_SOURCE_EXTRA
foreign key (EDITOR_SOURCE_EXTRA_VALUE_ID_)
references ACT_GE_BYTEARRAY (ID_);
alter table ACT_RE_MODEL
add constraint ACT_FK_MODEL_DEPLOYMENT
foreign key (DEPLOYMENT_ID_)
references ACT_RE_DEPLOYMENT (ID_);
alter table ACT_PROCDEF_INFO
add constraint ACT_FK_INFO_JSON_BA
foreign key (INFO_JSON_ID_)
alter table ACT_RE_MODEL
add constraint ACT_FK_MODEL_DEPLOYMENT
foreign key (DEPLOYMENT_ID_)
references ACT_RE_DEPLOYMENT (ID_);
alter table ACT_PROCDEF_INFO
add constraint ACT_FK_INFO_JSON_BA
foreign key (INFO_JSON_ID_)
references ACT_GE_BYTEARRAY (ID_);
alter table ACT_PROCDEF_INFO
add constraint ACT_FK_INFO_PROCDEF
foreign key (PROC_DEF_ID_)
alter table ACT_PROCDEF_INFO
add constraint ACT_FK_INFO_PROCDEF
foreign key (PROC_DEF_ID_)
references ACT_RE_PROCDEF (ID_);
alter table ACT_PROCDEF_INFO
add constraint ACT_UNIQ_INFO_PROCDEF
unique (PROC_DEF_ID_);
......
......@@ -6,10 +6,10 @@ create table ACT_GE_PROPERTY (
);
insert into ACT_GE_PROPERTY
values ('schema.version', '7.0.0.0', 1);
values ('schema.version', '7.1.0-M6', 1);
insert into ACT_GE_PROPERTY
values ('schema.history', 'create(7.0.0.0)', 1);
values ('schema.history', 'create(7.1.0-M6)', 1);
insert into ACT_GE_PROPERTY
values ('next.dbid', '1', 1);
......@@ -32,7 +32,7 @@ create table ACT_RE_DEPLOYMENT (
TENANT_ID_ varchar(255) default '',
DEPLOY_TIME_ timestamp,
ENGINE_VERSION_ varchar(255),
VERSION_ integer,
VERSION_ integer DEFAULT 1,
PROJECT_RELEASE_VERSION_ varchar(255),
primary key (ID_)
);
......@@ -77,14 +77,15 @@ create table ACT_RU_EXECUTION (
START_USER_ID_ varchar(255),
LOCK_TIME_ timestamp,
IS_COUNT_ENABLED_ bit,
EVT_SUBSCR_COUNT_ integer,
TASK_COUNT_ integer,
JOB_COUNT_ integer,
EVT_SUBSCR_COUNT_ integer,
TASK_COUNT_ integer,
JOB_COUNT_ integer,
TIMER_JOB_COUNT_ integer,
SUSP_JOB_COUNT_ integer,
DEADLETTER_JOB_COUNT_ integer,
VAR_COUNT_ integer,
VAR_COUNT_ integer,
ID_LINK_COUNT_ integer,
APP_VERSION_ integer,
primary key (ID_)
);
......@@ -183,6 +184,7 @@ create table ACT_RE_PROCDEF (
SUSPENSION_STATE_ integer,
TENANT_ID_ varchar(255) default '',
ENGINE_VERSION_ varchar(255),
APP_VERSION_ integer,
primary key (ID_)
);
......@@ -207,6 +209,7 @@ create table ACT_RU_TASK (
TENANT_ID_ varchar(255) default '',
FORM_KEY_ varchar(255),
CLAIM_TIME_ timestamp,
APP_VERSION_ integer,
primary key (ID_)
);
......@@ -304,7 +307,7 @@ alter table ACT_GE_BYTEARRAY
alter table ACT_RE_PROCDEF
add constraint ACT_UNIQ_PROCDEF
unique (KEY_,VERSION_, TENANT_ID_);
alter table ACT_RU_EXECUTION
add constraint ACT_FK_EXE_PROCINST
foreign key (PROC_INST_ID_)
......@@ -314,17 +317,17 @@ alter table ACT_RU_EXECUTION
add constraint ACT_FK_EXE_PARENT
foreign key (PARENT_ID_)
references ACT_RU_EXECUTION;
alter table ACT_RU_EXECUTION
add constraint ACT_FK_EXE_SUPER
foreign key (SUPER_EXEC_)
add constraint ACT_FK_EXE_SUPER
foreign key (SUPER_EXEC_)
references ACT_RU_EXECUTION;
alter table ACT_RU_EXECUTION
add constraint ACT_FK_EXE_PROCDEF
foreign key (PROC_DEF_ID_)
references ACT_RE_PROCDEF (ID_);
add constraint ACT_FK_EXE_PROCDEF
foreign key (PROC_DEF_ID_)
references ACT_RE_PROCDEF (ID_);
alter table ACT_RU_IDENTITYLINK
add constraint ACT_FK_TSKASS_TASK
foreign key (TASK_ID_)
......@@ -334,11 +337,11 @@ alter table ACT_RU_IDENTITYLINK
add constraint ACT_FK_ATHRZ_PROCEDEF
foreign key (PROC_DEF_ID_)
references ACT_RE_PROCDEF;
alter table ACT_RU_IDENTITYLINK
add constraint ACT_FK_IDL_PROCINST
foreign key (PROC_INST_ID_)
references ACT_RU_EXECUTION (ID_);
foreign key (PROC_INST_ID_)
references ACT_RU_EXECUTION (ID_);
alter table ACT_RU_TASK
add constraint ACT_FK_TASK_EXE
......@@ -369,42 +372,42 @@ alter table ACT_RU_VARIABLE
add constraint ACT_FK_VAR_BYTEARRAY
foreign key (BYTEARRAY_ID_)
references ACT_GE_BYTEARRAY;
alter table ACT_RU_JOB
add constraint ACT_FK_JOB_EXECUTION
foreign key (EXECUTION_ID_)
references ACT_RU_EXECUTION;
alter table ACT_RU_JOB
add constraint ACT_FK_JOB_PROCESS_INSTANCE
foreign key (PROCESS_INSTANCE_ID_)
references ACT_RU_EXECUTION;
alter table ACT_RU_JOB
add constraint ACT_FK_JOB_PROC_DEF
foreign key (PROC_DEF_ID_)
references ACT_RE_PROCDEF;
alter table ACT_RU_JOB
add constraint ACT_FK_JOB_EXCEPTION
foreign key (EXCEPTION_STACK_ID_)
references ACT_GE_BYTEARRAY;
alter table ACT_RU_TIMER_JOB
add constraint ACT_FK_TIMER_JOB_EXECUTION
foreign key (EXECUTION_ID_)
references ACT_RU_EXECUTION;
alter table ACT_RU_TIMER_JOB
add constraint ACT_FK_TIMER_JOB_PROCESS_INSTANCE
foreign key (PROCESS_INSTANCE_ID_)
references ACT_RU_EXECUTION;
alter table ACT_RU_TIMER_JOB
add constraint ACT_FK_TIMER_JOB_PROC_DEF
foreign key (PROC_DEF_ID_)
references ACT_RE_PROCDEF;
references ACT_RE_PROCDEF;
alter table ACT_RU_TIMER_JOB
add constraint ACT_FK_TIMER_JOB_EXCEPTION
foreign key (EXCEPTION_STACK_ID_)
......@@ -414,17 +417,17 @@ alter table ACT_RU_SUSPENDED_JOB
add constraint ACT_FK_SUSPENDED_JOB_EXECUTION
foreign key (EXECUTION_ID_)
references ACT_RU_EXECUTION;
alter table ACT_RU_SUSPENDED_JOB
add constraint ACT_FK_SUSPENDED_JOB_PROCESS_INSTANCE
foreign key (PROCESS_INSTANCE_ID_)
references ACT_RU_EXECUTION;
alter table ACT_RU_SUSPENDED_JOB
add constraint ACT_FK_SUSPENDED_JOB_PROC_DEF
foreign key (PROC_DEF_ID_)
references ACT_RE_PROCDEF;
alter table ACT_RU_SUSPENDED_JOB
add constraint ACT_FK_SUSPENDED_JOB_EXCEPTION
foreign key (EXCEPTION_STACK_ID_)
......@@ -434,12 +437,12 @@ alter table ACT_RU_DEADLETTER_JOB
add constraint ACT_FK_DEADLETTER_JOB_EXECUTION
foreign key (EXECUTION_ID_)
references ACT_RU_EXECUTION;
alter table ACT_RU_DEADLETTER_JOB
add constraint ACT_FK_DEADLETTER_JOB_PROCESS_INSTANCE
foreign key (PROCESS_INSTANCE_ID_)
references ACT_RU_EXECUTION;
alter table ACT_RU_DEADLETTER_JOB
add constraint ACT_FK_DEADLETTER_JOB_PROC_DEF
foreign key (PROC_DEF_ID_)
......@@ -455,31 +458,31 @@ alter table ACT_RU_EVENT_SUBSCR
foreign key (EXECUTION_ID_)
references ACT_RU_EXECUTION;
alter table ACT_RE_MODEL
add constraint ACT_FK_MODEL_SOURCE
foreign key (EDITOR_SOURCE_VALUE_ID_)
alter table ACT_RE_MODEL
add constraint ACT_FK_MODEL_SOURCE
foreign key (EDITOR_SOURCE_VALUE_ID_)
references ACT_GE_BYTEARRAY (ID_);
alter table ACT_RE_MODEL
add constraint ACT_FK_MODEL_SOURCE_EXTRA
foreign key (EDITOR_SOURCE_EXTRA_VALUE_ID_)
alter table ACT_RE_MODEL
add constraint ACT_FK_MODEL_SOURCE_EXTRA
foreign key (EDITOR_SOURCE_EXTRA_VALUE_ID_)
references ACT_GE_BYTEARRAY (ID_);
alter table ACT_RE_MODEL
add constraint ACT_FK_MODEL_DEPLOYMENT
foreign key (DEPLOYMENT_ID_)
references ACT_RE_DEPLOYMENT (ID_);
alter table ACT_PROCDEF_INFO
add constraint ACT_FK_INFO_JSON_BA
foreign key (INFO_JSON_ID_)
alter table ACT_RE_MODEL
add constraint ACT_FK_MODEL_DEPLOYMENT
foreign key (DEPLOYMENT_ID_)
references ACT_RE_DEPLOYMENT (ID_);
alter table ACT_PROCDEF_INFO
add constraint ACT_FK_INFO_JSON_BA
foreign key (INFO_JSON_ID_)
references ACT_GE_BYTEARRAY (ID_);
alter table ACT_PROCDEF_INFO
add constraint ACT_FK_INFO_PROCDEF
foreign key (PROC_DEF_ID_)
alter table ACT_PROCDEF_INFO
add constraint ACT_FK_INFO_PROCDEF
foreign key (PROC_DEF_ID_)
references ACT_RE_PROCDEF (ID_);
alter table ACT_PROCDEF_INFO
add constraint ACT_UNIQ_INFO_PROCDEF
unique (PROC_DEF_ID_);
......
......@@ -77,14 +77,15 @@ create table ACT_RU_EXECUTION (
START_USER_ID_ nvarchar(255),
LOCK_TIME_ datetime,
IS_COUNT_ENABLED_ tinyint,
EVT_SUBSCR_COUNT_ int,
TASK_COUNT_ int,
JOB_COUNT_ int,
EVT_SUBSCR_COUNT_ int,
TASK_COUNT_ int,
JOB_COUNT_ int,
TIMER_JOB_COUNT_ int,
SUSP_JOB_COUNT_ int,
DEADLETTER_JOB_COUNT_ int,
VAR_COUNT_ int,
VAR_COUNT_ int,
ID_LINK_COUNT_ int,
APP_VERSION_ int,
primary key (ID_)
);
......@@ -183,6 +184,7 @@ create table ACT_RE_PROCDEF (
SUSPENSION_STATE_ tinyint,
TENANT_ID_ nvarchar(255) default '',
ENGINE_VERSION_ nvarchar(255),
APP_VERSION_ int,
primary key (ID_)
);
......@@ -207,6 +209,7 @@ create table ACT_RU_TASK (
TENANT_ID_ nvarchar(255) default '',
FORM_KEY_ nvarchar(255),
CLAIM_TIME_ datetime,
APP_VERSION_ int,
primary key (ID_)
);
......@@ -328,62 +331,62 @@ create index ACT_IDX_DEADLETTER_JOB_EXCEPTION_STACK_ID on ACT_RU_DEADLETTER_JOB(
create index ACT_IDX_INFO_PROCDEF on ACT_PROCDEF_INFO(PROC_DEF_ID_);
alter table ACT_GE_BYTEARRAY
add constraint ACT_FK_BYTEARR_DEPL
foreign key (DEPLOYMENT_ID_)
add constraint ACT_FK_BYTEARR_DEPL
foreign key (DEPLOYMENT_ID_)
references ACT_RE_DEPLOYMENT (ID_);
alter table ACT_RE_PROCDEF
add constraint ACT_UNIQ_PROCDEF
unique (KEY_,VERSION_, TENANT_ID_);
alter table ACT_RU_EXECUTION
add constraint ACT_FK_EXE_PARENT
foreign key (PARENT_ID_)
add constraint ACT_FK_EXE_PARENT
foreign key (PARENT_ID_)
references ACT_RU_EXECUTION (ID_);
alter table ACT_RU_EXECUTION
add constraint ACT_FK_EXE_SUPER
foreign key (SUPER_EXEC_)
add constraint ACT_FK_EXE_SUPER
foreign key (SUPER_EXEC_)
references ACT_RU_EXECUTION (ID_);
alter table ACT_RU_EXECUTION
add constraint ACT_FK_EXE_PROCDEF
foreign key (PROC_DEF_ID_)
add constraint ACT_FK_EXE_PROCDEF
foreign key (PROC_DEF_ID_)
references ACT_RE_PROCDEF (ID_);
alter table ACT_RU_IDENTITYLINK
add constraint ACT_FK_TSKASS_TASK
foreign key (TASK_ID_)
add constraint ACT_FK_TSKASS_TASK
foreign key (TASK_ID_)
references ACT_RU_TASK (ID_);
alter table ACT_RU_IDENTITYLINK
add constraint ACT_FK_ATHRZ_PROCEDEF
foreign key (PROC_DEF_ID_)
foreign key (PROC_DEF_ID_)
references ACT_RE_PROCDEF (ID_);
alter table ACT_RU_IDENTITYLINK
add constraint ACT_FK_IDL_PROCINST
foreign key (PROC_INST_ID_)
references ACT_RU_EXECUTION (ID_);
foreign key (PROC_INST_ID_)
references ACT_RU_EXECUTION (ID_);
alter table ACT_RU_TASK
add constraint ACT_FK_TASK_EXE
foreign key (EXECUTION_ID_)
references ACT_RU_EXECUTION (ID_);
alter table ACT_RU_TASK
add constraint ACT_FK_TASK_PROCINST
foreign key (PROC_INST_ID_)
references ACT_RU_EXECUTION (ID_);
alter table ACT_RU_TASK
add constraint ACT_FK_TASK_PROCDEF
foreign key (PROC_DEF_ID_)
references ACT_RE_PROCDEF (ID_);
alter table ACT_RU_VARIABLE
add constraint ACT_FK_VAR_EXE
foreign key (EXECUTION_ID_)
alter table ACT_RU_VARIABLE
add constraint ACT_FK_VAR_EXE
foreign key (EXECUTION_ID_)
references ACT_RU_EXECUTION (ID_);
alter table ACT_RU_VARIABLE
......@@ -391,121 +394,121 @@ alter table ACT_RU_VARIABLE
foreign key (PROC_INST_ID_)
references ACT_RU_EXECUTION(ID_);
alter table ACT_RU_VARIABLE
add constraint ACT_FK_VAR_BYTEARRAY
foreign key (BYTEARRAY_ID_)
alter table ACT_RU_VARIABLE
add constraint ACT_FK_VAR_BYTEARRAY
foreign key (BYTEARRAY_ID_)
references ACT_GE_BYTEARRAY (ID_);
alter table ACT_RU_JOB
add constraint ACT_FK_JOB_EXECUTION
foreign key (EXECUTION_ID_)
alter table ACT_RU_JOB
add constraint ACT_FK_JOB_EXECUTION
foreign key (EXECUTION_ID_)
references ACT_RU_EXECUTION (ID_);
alter table ACT_RU_JOB
add constraint ACT_FK_JOB_PROCESS_INSTANCE
foreign key (PROCESS_INSTANCE_ID_)
alter table ACT_RU_JOB
add constraint ACT_FK_JOB_PROCESS_INSTANCE
foreign key (PROCESS_INSTANCE_ID_)
references ACT_RU_EXECUTION (ID_);
alter table ACT_RU_JOB
alter table ACT_RU_JOB
add constraint ACT_FK_JOB_PROC_DEF
foreign key (PROC_DEF_ID_)
foreign key (PROC_DEF_ID_)
references ACT_RE_PROCDEF (ID_);
alter table ACT_RU_JOB
add constraint ACT_FK_JOB_EXCEPTION
foreign key (EXCEPTION_STACK_ID_)
alter table ACT_RU_JOB
add constraint ACT_FK_JOB_EXCEPTION
foreign key (EXCEPTION_STACK_ID_)
references ACT_GE_BYTEARRAY (ID_);
alter table ACT_RU_TIMER_JOB
add constraint ACT_FK_TIMER_JOB_EXECUTION
foreign key (EXECUTION_ID_)
alter table ACT_RU_TIMER_JOB
add constraint ACT_FK_TIMER_JOB_EXECUTION
foreign key (EXECUTION_ID_)
references ACT_RU_EXECUTION (ID_);
alter table ACT_RU_TIMER_JOB
add constraint ACT_FK_TIMER_JOB_PROCESS_INSTANCE
foreign key (PROCESS_INSTANCE_ID_)
alter table ACT_RU_TIMER_JOB
add constraint ACT_FK_TIMER_JOB_PROCESS_INSTANCE
foreign key (PROCESS_INSTANCE_ID_)
references ACT_RU_EXECUTION (ID_);
alter table ACT_RU_TIMER_JOB
alter table ACT_RU_TIMER_JOB
add constraint ACT_FK_TIMER_JOB_PROC_DEF
foreign key (PROC_DEF_ID_)
foreign key (PROC_DEF_ID_)
references ACT_RE_PROCDEF (ID_);
alter table ACT_RU_TIMER_JOB
add constraint ACT_FK_TIMER_JOB_EXCEPTION
foreign key (EXCEPTION_STACK_ID_)
alter table ACT_RU_TIMER_JOB
add constraint ACT_FK_TIMER_JOB_EXCEPTION
foreign key (EXCEPTION_STACK_ID_)
references ACT_GE_BYTEARRAY (ID_);
alter table ACT_RU_SUSPENDED_JOB
add constraint ACT_FK_SUSPENDED_JOB_EXECUTION
foreign key (EXECUTION_ID_)
alter table ACT_RU_SUSPENDED_JOB
add constraint ACT_FK_SUSPENDED_JOB_EXECUTION
foreign key (EXECUTION_ID_)
references ACT_RU_EXECUTION (ID_);
alter table ACT_RU_SUSPENDED_JOB
add constraint ACT_FK_SUSPENDED_JOB_PROCESS_INSTANCE
foreign key (PROCESS_INSTANCE_ID_)
alter table ACT_RU_SUSPENDED_JOB
add constraint ACT_FK_SUSPENDED_JOB_PROCESS_INSTANCE
foreign key (PROCESS_INSTANCE_ID_)
references ACT_RU_EXECUTION (ID_);
alter table ACT_RU_SUSPENDED_JOB
alter table ACT_RU_SUSPENDED_JOB
add constraint ACT_FK_SUSPENDED_JOB_PROC_DEF
foreign key (PROC_DEF_ID_)
foreign key (PROC_DEF_ID_)
references ACT_RE_PROCDEF (ID_);
alter table ACT_RU_SUSPENDED_JOB
add constraint ACT_FK_SUSPENDED_JOB_EXCEPTION
foreign key (EXCEPTION_STACK_ID_)
alter table ACT_RU_SUSPENDED_JOB
add constraint ACT_FK_SUSPENDED_JOB_EXCEPTION
foreign key (EXCEPTION_STACK_ID_)
references ACT_GE_BYTEARRAY (ID_);
alter table ACT_RU_DEADLETTER_JOB
add constraint ACT_FK_DEADLETTER_JOB_EXECUTION
foreign key (EXECUTION_ID_)
alter table ACT_RU_DEADLETTER_JOB
add constraint ACT_FK_DEADLETTER_JOB_EXECUTION
foreign key (EXECUTION_ID_)
references ACT_RU_EXECUTION (ID_);
alter table ACT_RU_DEADLETTER_JOB
add constraint ACT_FK_DEADLETTER_JOB_PROCESS_INSTANCE
foreign key (PROCESS_INSTANCE_ID_)
alter table ACT_RU_DEADLETTER_JOB
add constraint ACT_FK_DEADLETTER_JOB_PROCESS_INSTANCE
foreign key (PROCESS_INSTANCE_ID_)
references ACT_RU_EXECUTION (ID_);
alter table ACT_RU_DEADLETTER_JOB
alter table ACT_RU_DEADLETTER_JOB
add constraint ACT_FK_DEADLETTER_JOB_PROC_DEF
foreign key (PROC_DEF_ID_)
foreign key (PROC_DEF_ID_)
references ACT_RE_PROCDEF (ID_);
alter table ACT_RU_DEADLETTER_JOB
add constraint ACT_FK_DEADLETTER_JOB_EXCEPTION
foreign key (EXCEPTION_STACK_ID_)
alter table ACT_RU_DEADLETTER_JOB
add constraint ACT_FK_DEADLETTER_JOB_EXCEPTION
foreign key (EXCEPTION_STACK_ID_)
references ACT_GE_BYTEARRAY (ID_);
alter table ACT_RU_EVENT_SUBSCR
add constraint ACT_FK_EVENT_EXEC
foreign key (EXECUTION_ID_)
references ACT_RU_EXECUTION(ID_);
alter table ACT_RE_MODEL
add constraint ACT_FK_MODEL_SOURCE
foreign key (EDITOR_SOURCE_VALUE_ID_)
alter table ACT_RE_MODEL
add constraint ACT_FK_MODEL_SOURCE
foreign key (EDITOR_SOURCE_VALUE_ID_)
references ACT_GE_BYTEARRAY (ID_);
alter table ACT_RE_MODEL
add constraint ACT_FK_MODEL_SOURCE_EXTRA
foreign key (EDITOR_SOURCE_EXTRA_VALUE_ID_)
alter table ACT_RE_MODEL
add constraint ACT_FK_MODEL_SOURCE_EXTRA
foreign key (EDITOR_SOURCE_EXTRA_VALUE_ID_)
references ACT_GE_BYTEARRAY (ID_);
alter table ACT_RE_MODEL
add constraint ACT_FK_MODEL_DEPLOYMENT
foreign key (DEPLOYMENT_ID_)
references ACT_RE_DEPLOYMENT (ID_);
alter table ACT_RE_MODEL
add constraint ACT_FK_MODEL_DEPLOYMENT
foreign key (DEPLOYMENT_ID_)
references ACT_RE_DEPLOYMENT (ID_);
alter table ACT_PROCDEF_INFO
add constraint ACT_FK_INFO_JSON_BA
foreign key (INFO_JSON_ID_)
alter table ACT_PROCDEF_INFO
add constraint ACT_FK_INFO_JSON_BA
foreign key (INFO_JSON_ID_)
references ACT_GE_BYTEARRAY (ID_);
alter table ACT_PROCDEF_INFO
add constraint ACT_FK_INFO_PROCDEF
foreign key (PROC_DEF_ID_)
alter table ACT_PROCDEF_INFO
add constraint ACT_FK_INFO_PROCDEF
foreign key (PROC_DEF_ID_)
references ACT_RE_PROCDEF (ID_);
alter table ACT_PROCDEF_INFO
add constraint ACT_UNIQ_INFO_PROCDEF
unique (PROC_DEF_ID_);
......
......@@ -6,10 +6,10 @@ create table ACT_GE_PROPERTY (
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin;
insert into ACT_GE_PROPERTY
values ('schema.version', '7.0.0.0', 1);
values ('schema.version', '7.1.0-M6', 1);
insert into ACT_GE_PROPERTY
values ('schema.history', 'create(7.0.0.0)', 1);
values ('schema.history', 'create(7.1.0-M6)', 1);
insert into ACT_GE_PROPERTY
values ('next.dbid', '1', 1);
......@@ -32,7 +32,7 @@ create table ACT_RE_DEPLOYMENT (
TENANT_ID_ varchar(255) default '',
DEPLOY_TIME_ timestamp(3) NULL,
ENGINE_VERSION_ varchar(255),
VERSION_ integer,
VERSION_ integer default 1,
PROJECT_RELEASE_VERSION_ varchar(255),
primary key (ID_)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin;
......@@ -77,14 +77,15 @@ create table ACT_RU_EXECUTION (
START_USER_ID_ varchar(255),
LOCK_TIME_ timestamp(3) NULL,
IS_COUNT_ENABLED_ TINYINT,
EVT_SUBSCR_COUNT_ integer,
TASK_COUNT_ integer,
JOB_COUNT_ integer,
EVT_SUBSCR_COUNT_ integer,
TASK_COUNT_ integer,
JOB_COUNT_ integer,
TIMER_JOB_COUNT_ integer,
SUSP_JOB_COUNT_ integer,
DEADLETTER_JOB_COUNT_ integer,
VAR_COUNT_ integer,
VAR_COUNT_ integer,
ID_LINK_COUNT_ integer,
APP_VERSION_ integer,
primary key (ID_)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin;
......@@ -183,6 +184,7 @@ create table ACT_RE_PROCDEF (
SUSPENSION_STATE_ integer,
TENANT_ID_ varchar(255) default '',
ENGINE_VERSION_ varchar(255),
APP_VERSION_ integer,
primary key (ID_)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin;
......@@ -207,6 +209,7 @@ create table ACT_RU_TASK (
TENANT_ID_ varchar(255) default '',
FORM_KEY_ varchar(255),
CLAIM_TIME_ datetime(3),
APP_VERSION_ integer,
primary key (ID_)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin;
......@@ -218,7 +221,7 @@ create table ACT_RU_IDENTITYLINK (
USER_ID_ varchar(255),
TASK_ID_ varchar(64),
PROC_INST_ID_ varchar(64),
PROC_DEF_ID_ varchar(64),
PROC_DEF_ID_ varchar(64),
primary key (ID_)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin;
......@@ -298,67 +301,67 @@ create index ACT_IDX_ATHRZ_PROCEDEF on ACT_RU_IDENTITYLINK(PROC_DEF_ID_);
create index ACT_IDX_INFO_PROCDEF on ACT_PROCDEF_INFO(PROC_DEF_ID_);
alter table ACT_GE_BYTEARRAY
add constraint ACT_FK_BYTEARR_DEPL
foreign key (DEPLOYMENT_ID_)
add constraint ACT_FK_BYTEARR_DEPL
foreign key (DEPLOYMENT_ID_)
references ACT_RE_DEPLOYMENT (ID_);
alter table ACT_RE_PROCDEF
add constraint ACT_UNIQ_PROCDEF
unique (KEY_,VERSION_, TENANT_ID_);
alter table ACT_RU_EXECUTION
add constraint ACT_FK_EXE_PROCINST
foreign key (PROC_INST_ID_)
add constraint ACT_FK_EXE_PROCINST
foreign key (PROC_INST_ID_)
references ACT_RU_EXECUTION (ID_) on delete cascade on update cascade;
alter table ACT_RU_EXECUTION
add constraint ACT_FK_EXE_PARENT
foreign key (PARENT_ID_)
add constraint ACT_FK_EXE_PARENT
foreign key (PARENT_ID_)
references ACT_RU_EXECUTION (ID_) on delete cascade;
alter table ACT_RU_EXECUTION
add constraint ACT_FK_EXE_SUPER
foreign key (SUPER_EXEC_)
add constraint ACT_FK_EXE_SUPER
foreign key (SUPER_EXEC_)
references ACT_RU_EXECUTION (ID_) on delete cascade;
alter table ACT_RU_EXECUTION
add constraint ACT_FK_EXE_PROCDEF
foreign key (PROC_DEF_ID_)
add constraint ACT_FK_EXE_PROCDEF
foreign key (PROC_DEF_ID_)
references ACT_RE_PROCDEF (ID_);
alter table ACT_RU_IDENTITYLINK
add constraint ACT_FK_TSKASS_TASK
foreign key (TASK_ID_)
add constraint ACT_FK_TSKASS_TASK
foreign key (TASK_ID_)
references ACT_RU_TASK (ID_);
alter table ACT_RU_IDENTITYLINK
add constraint ACT_FK_ATHRZ_PROCEDEF
foreign key (PROC_DEF_ID_)
add constraint ACT_FK_ATHRZ_PROCEDEF
foreign key (PROC_DEF_ID_)
references ACT_RE_PROCDEF(ID_);
alter table ACT_RU_IDENTITYLINK
add constraint ACT_FK_IDL_PROCINST
foreign key (PROC_INST_ID_)
references ACT_RU_EXECUTION (ID_);
foreign key (PROC_INST_ID_)
references ACT_RU_EXECUTION (ID_);
alter table ACT_RU_TASK
add constraint ACT_FK_TASK_EXE
foreign key (EXECUTION_ID_)
references ACT_RU_EXECUTION (ID_);
alter table ACT_RU_TASK
add constraint ACT_FK_TASK_PROCINST
foreign key (PROC_INST_ID_)
references ACT_RU_EXECUTION (ID_);
alter table ACT_RU_TASK
add constraint ACT_FK_TASK_PROCDEF
foreign key (PROC_DEF_ID_)
references ACT_RE_PROCDEF (ID_);
alter table ACT_RU_VARIABLE
add constraint ACT_FK_VAR_EXE
foreign key (EXECUTION_ID_)
alter table ACT_RU_VARIABLE
add constraint ACT_FK_VAR_EXE
foreign key (EXECUTION_ID_)
references ACT_RU_EXECUTION (ID_);
alter table ACT_RU_VARIABLE
......@@ -366,121 +369,121 @@ alter table ACT_RU_VARIABLE
foreign key (PROC_INST_ID_)
references ACT_RU_EXECUTION(ID_);
alter table ACT_RU_VARIABLE
add constraint ACT_FK_VAR_BYTEARRAY
foreign key (BYTEARRAY_ID_)
alter table ACT_RU_VARIABLE
add constraint ACT_FK_VAR_BYTEARRAY
foreign key (BYTEARRAY_ID_)
references ACT_GE_BYTEARRAY (ID_);
alter table ACT_RU_JOB
add constraint ACT_FK_JOB_EXECUTION
foreign key (EXECUTION_ID_)
alter table ACT_RU_JOB
add constraint ACT_FK_JOB_EXECUTION
foreign key (EXECUTION_ID_)
references ACT_RU_EXECUTION (ID_);
alter table ACT_RU_JOB
add constraint ACT_FK_JOB_PROCESS_INSTANCE
foreign key (PROCESS_INSTANCE_ID_)
alter table ACT_RU_JOB
add constraint ACT_FK_JOB_PROCESS_INSTANCE
foreign key (PROCESS_INSTANCE_ID_)
references ACT_RU_EXECUTION (ID_);
alter table ACT_RU_JOB
alter table ACT_RU_JOB
add constraint ACT_FK_JOB_PROC_DEF
foreign key (PROC_DEF_ID_)
foreign key (PROC_DEF_ID_)
references ACT_RE_PROCDEF (ID_);
alter table ACT_RU_JOB
add constraint ACT_FK_JOB_EXCEPTION
foreign key (EXCEPTION_STACK_ID_)
alter table ACT_RU_JOB
add constraint ACT_FK_JOB_EXCEPTION
foreign key (EXCEPTION_STACK_ID_)
references ACT_GE_BYTEARRAY (ID_);
alter table ACT_RU_TIMER_JOB
add constraint ACT_FK_TIMER_JOB_EXECUTION
foreign key (EXECUTION_ID_)
alter table ACT_RU_TIMER_JOB
add constraint ACT_FK_TIMER_JOB_EXECUTION
foreign key (EXECUTION_ID_)
references ACT_RU_EXECUTION (ID_);
alter table ACT_RU_TIMER_JOB
add constraint ACT_FK_TIMER_JOB_PROCESS_INSTANCE
foreign key (PROCESS_INSTANCE_ID_)
alter table ACT_RU_TIMER_JOB
add constraint ACT_FK_TIMER_JOB_PROCESS_INSTANCE
foreign key (PROCESS_INSTANCE_ID_)
references ACT_RU_EXECUTION (ID_);
alter table ACT_RU_TIMER_JOB
alter table ACT_RU_TIMER_JOB
add constraint ACT_FK_TIMER_JOB_PROC_DEF
foreign key (PROC_DEF_ID_)
foreign key (PROC_DEF_ID_)
references ACT_RE_PROCDEF (ID_);
alter table ACT_RU_TIMER_JOB
add constraint ACT_FK_TIMER_JOB_EXCEPTION
foreign key (EXCEPTION_STACK_ID_)
alter table ACT_RU_TIMER_JOB
add constraint ACT_FK_TIMER_JOB_EXCEPTION
foreign key (EXCEPTION_STACK_ID_)
references ACT_GE_BYTEARRAY (ID_);
alter table ACT_RU_SUSPENDED_JOB
add constraint ACT_FK_SUSPENDED_JOB_EXECUTION
foreign key (EXECUTION_ID_)
alter table ACT_RU_SUSPENDED_JOB
add constraint ACT_FK_SUSPENDED_JOB_EXECUTION
foreign key (EXECUTION_ID_)
references ACT_RU_EXECUTION (ID_);
alter table ACT_RU_SUSPENDED_JOB
add constraint ACT_FK_SUSPENDED_JOB_PROCESS_INSTANCE
foreign key (PROCESS_INSTANCE_ID_)
alter table ACT_RU_SUSPENDED_JOB
add constraint ACT_FK_SUSPENDED_JOB_PROCESS_INSTANCE
foreign key (PROCESS_INSTANCE_ID_)
references ACT_RU_EXECUTION (ID_);
alter table ACT_RU_SUSPENDED_JOB
alter table ACT_RU_SUSPENDED_JOB
add constraint ACT_FK_SUSPENDED_JOB_PROC_DEF
foreign key (PROC_DEF_ID_)
foreign key (PROC_DEF_ID_)
references ACT_RE_PROCDEF (ID_);
alter table ACT_RU_SUSPENDED_JOB
add constraint ACT_FK_SUSPENDED_JOB_EXCEPTION
foreign key (EXCEPTION_STACK_ID_)
alter table ACT_RU_SUSPENDED_JOB
add constraint ACT_FK_SUSPENDED_JOB_EXCEPTION
foreign key (EXCEPTION_STACK_ID_)
references ACT_GE_BYTEARRAY (ID_);
alter table ACT_RU_DEADLETTER_JOB
add constraint ACT_FK_DEADLETTER_JOB_EXECUTION
foreign key (EXECUTION_ID_)
alter table ACT_RU_DEADLETTER_JOB
add constraint ACT_FK_DEADLETTER_JOB_EXECUTION
foreign key (EXECUTION_ID_)
references ACT_RU_EXECUTION (ID_);
alter table ACT_RU_DEADLETTER_JOB
add constraint ACT_FK_DEADLETTER_JOB_PROCESS_INSTANCE
foreign key (PROCESS_INSTANCE_ID_)
alter table ACT_RU_DEADLETTER_JOB
add constraint ACT_FK_DEADLETTER_JOB_PROCESS_INSTANCE
foreign key (PROCESS_INSTANCE_ID_)
references ACT_RU_EXECUTION (ID_);
alter table ACT_RU_DEADLETTER_JOB
alter table ACT_RU_DEADLETTER_JOB
add constraint ACT_FK_DEADLETTER_JOB_PROC_DEF
foreign key (PROC_DEF_ID_)
foreign key (PROC_DEF_ID_)
references ACT_RE_PROCDEF (ID_);
alter table ACT_RU_DEADLETTER_JOB
add constraint ACT_FK_DEADLETTER_JOB_EXCEPTION
foreign key (EXCEPTION_STACK_ID_)
alter table ACT_RU_DEADLETTER_JOB
add constraint ACT_FK_DEADLETTER_JOB_EXCEPTION
foreign key (EXCEPTION_STACK_ID_)
references ACT_GE_BYTEARRAY (ID_);
alter table ACT_RU_EVENT_SUBSCR
add constraint ACT_FK_EVENT_EXEC
foreign key (EXECUTION_ID_)
references ACT_RU_EXECUTION(ID_);
alter table ACT_RE_MODEL
add constraint ACT_FK_MODEL_SOURCE
foreign key (EDITOR_SOURCE_VALUE_ID_)
alter table ACT_RE_MODEL
add constraint ACT_FK_MODEL_SOURCE
foreign key (EDITOR_SOURCE_VALUE_ID_)
references ACT_GE_BYTEARRAY (ID_);
alter table ACT_RE_MODEL
add constraint ACT_FK_MODEL_SOURCE_EXTRA
foreign key (EDITOR_SOURCE_EXTRA_VALUE_ID_)
alter table ACT_RE_MODEL
add constraint ACT_FK_MODEL_SOURCE_EXTRA
foreign key (EDITOR_SOURCE_EXTRA_VALUE_ID_)
references ACT_GE_BYTEARRAY (ID_);
alter table ACT_RE_MODEL
add constraint ACT_FK_MODEL_DEPLOYMENT
foreign key (DEPLOYMENT_ID_)
references ACT_RE_DEPLOYMENT (ID_);
alter table ACT_PROCDEF_INFO
add constraint ACT_FK_INFO_JSON_BA
foreign key (INFO_JSON_ID_)
alter table ACT_RE_MODEL
add constraint ACT_FK_MODEL_DEPLOYMENT
foreign key (DEPLOYMENT_ID_)
references ACT_RE_DEPLOYMENT (ID_);
alter table ACT_PROCDEF_INFO
add constraint ACT_FK_INFO_JSON_BA
foreign key (INFO_JSON_ID_)
references ACT_GE_BYTEARRAY (ID_);
alter table ACT_PROCDEF_INFO
add constraint ACT_FK_INFO_PROCDEF
foreign key (PROC_DEF_ID_)
alter table ACT_PROCDEF_INFO
add constraint ACT_FK_INFO_PROCDEF
foreign key (PROC_DEF_ID_)
references ACT_RE_PROCDEF (ID_);
alter table ACT_PROCDEF_INFO
add constraint ACT_UNIQ_INFO_PROCDEF
unique (PROC_DEF_ID_);
......
......@@ -32,7 +32,7 @@ create table ACT_RE_DEPLOYMENT (
TENANT_ID_ varchar(255) default '',
DEPLOY_TIME_ timestamp NULL,
ENGINE_VERSION_ varchar(255),
VERSION_ integer,
VERSION_ integer default 1,
PROJECT_RELEASE_VERSION_ varchar(255),
primary key (ID_)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin;
......@@ -77,14 +77,15 @@ create table ACT_RU_EXECUTION (
START_USER_ID_ varchar(255),
LOCK_TIME_ timestamp NULL,
IS_COUNT_ENABLED_ TINYINT,
EVT_SUBSCR_COUNT_ integer,
TASK_COUNT_ integer,
JOB_COUNT_ integer,
EVT_SUBSCR_COUNT_ integer,
TASK_COUNT_ integer,
JOB_COUNT_ integer,
TIMER_JOB_COUNT_ integer,
SUSP_JOB_COUNT_ integer,
DEADLETTER_JOB_COUNT_ integer,
VAR_COUNT_ integer,
VAR_COUNT_ integer,
ID_LINK_COUNT_ integer,
APP_VERSION_ integer,
primary key (ID_)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin;
......@@ -183,6 +184,7 @@ create table ACT_RE_PROCDEF (
SUSPENSION_STATE_ integer,
TENANT_ID_ varchar(255) default '',
ENGINE_VERSION_ varchar(255),
APP_VERSION_ integer,
primary key (ID_)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin;
......@@ -207,6 +209,7 @@ create table ACT_RU_TASK (
TENANT_ID_ varchar(255) default '',
FORM_KEY_ varchar(255),
CLAIM_TIME_ datetime,
APP_VERSION_ integer,
primary key (ID_)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin;
......@@ -218,7 +221,7 @@ create table ACT_RU_IDENTITYLINK (
USER_ID_ varchar(255),
TASK_ID_ varchar(64),
PROC_INST_ID_ varchar(64),
PROC_DEF_ID_ varchar(64),
PROC_DEF_ID_ varchar(64),
primary key (ID_)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin;
......@@ -298,67 +301,67 @@ create index ACT_IDX_ATHRZ_PROCEDEF on ACT_RU_IDENTITYLINK(PROC_DEF_ID_);
create index ACT_IDX_INFO_PROCDEF on ACT_PROCDEF_INFO(PROC_DEF_ID_);
alter table ACT_GE_BYTEARRAY
add constraint ACT_FK_BYTEARR_DEPL
foreign key (DEPLOYMENT_ID_)
add constraint ACT_FK_BYTEARR_DEPL
foreign key (DEPLOYMENT_ID_)
references ACT_RE_DEPLOYMENT (ID_);
alter table ACT_RE_PROCDEF
add constraint ACT_UNIQ_PROCDEF
unique (KEY_,VERSION_, TENANT_ID_);
alter table ACT_RU_EXECUTION
add constraint ACT_FK_EXE_PROCINST
foreign key (PROC_INST_ID_)
add constraint ACT_FK_EXE_PROCINST
foreign key (PROC_INST_ID_)
references ACT_RU_EXECUTION (ID_) on delete cascade on update cascade;
alter table ACT_RU_EXECUTION
add constraint ACT_FK_EXE_PARENT
foreign key (PARENT_ID_)
add constraint ACT_FK_EXE_PARENT
foreign key (PARENT_ID_)
references ACT_RU_EXECUTION (ID_) on delete cascade;
alter table ACT_RU_EXECUTION
add constraint ACT_FK_EXE_SUPER
foreign key (SUPER_EXEC_)
add constraint ACT_FK_EXE_SUPER
foreign key (SUPER_EXEC_)
references ACT_RU_EXECUTION (ID_);
alter table ACT_RU_EXECUTION
add constraint ACT_FK_EXE_PROCDEF
foreign key (PROC_DEF_ID_)
add constraint ACT_FK_EXE_PROCDEF
foreign key (PROC_DEF_ID_)
references ACT_RE_PROCDEF (ID_);
alter table ACT_RU_IDENTITYLINK
add constraint ACT_FK_TSKASS_TASK
foreign key (TASK_ID_)
add constraint ACT_FK_TSKASS_TASK
foreign key (TASK_ID_)
references ACT_RU_TASK (ID_);
alter table ACT_RU_IDENTITYLINK
add constraint ACT_FK_ATHRZ_PROCEDEF
foreign key (PROC_DEF_ID_)
add constraint ACT_FK_ATHRZ_PROCEDEF
foreign key (PROC_DEF_ID_)
references ACT_RE_PROCDEF(ID_);
alter table ACT_RU_IDENTITYLINK
add constraint ACT_FK_IDL_PROCINST
foreign key (PROC_INST_ID_)
references ACT_RU_EXECUTION (ID_);
foreign key (PROC_INST_ID_)
references ACT_RU_EXECUTION (ID_);
alter table ACT_RU_TASK
add constraint ACT_FK_TASK_EXE
foreign key (EXECUTION_ID_)
references ACT_RU_EXECUTION (ID_);
alter table ACT_RU_TASK
add constraint ACT_FK_TASK_PROCINST
foreign key (PROC_INST_ID_)
references ACT_RU_EXECUTION (ID_);
alter table ACT_RU_TASK
add constraint ACT_FK_TASK_PROCDEF
foreign key (PROC_DEF_ID_)
references ACT_RE_PROCDEF (ID_);
alter table ACT_RU_VARIABLE
add constraint ACT_FK_VAR_EXE
foreign key (EXECUTION_ID_)
alter table ACT_RU_VARIABLE
add constraint ACT_FK_VAR_EXE
foreign key (EXECUTION_ID_)
references ACT_RU_EXECUTION (ID_);
alter table ACT_RU_VARIABLE
......@@ -366,121 +369,121 @@ alter table ACT_RU_VARIABLE
foreign key (PROC_INST_ID_)
references ACT_RU_EXECUTION(ID_);
alter table ACT_RU_VARIABLE
add constraint ACT_FK_VAR_BYTEARRAY
foreign key (BYTEARRAY_ID_)
alter table ACT_RU_VARIABLE
add constraint ACT_FK_VAR_BYTEARRAY
foreign key (BYTEARRAY_ID_)
references ACT_GE_BYTEARRAY (ID_);
alter table ACT_RU_JOB
add constraint ACT_FK_JOB_EXECUTION
foreign key (EXECUTION_ID_)
alter table ACT_RU_JOB
add constraint ACT_FK_JOB_EXECUTION
foreign key (EXECUTION_ID_)
references ACT_RU_EXECUTION (ID_);
alter table ACT_RU_JOB
add constraint ACT_FK_JOB_PROCESS_INSTANCE
foreign key (PROCESS_INSTANCE_ID_)
alter table ACT_RU_JOB
add constraint ACT_FK_JOB_PROCESS_INSTANCE
foreign key (PROCESS_INSTANCE_ID_)
references ACT_RU_EXECUTION (ID_);
alter table ACT_RU_JOB
alter table ACT_RU_JOB
add constraint ACT_FK_JOB_PROC_DEF
foreign key (PROC_DEF_ID_)
foreign key (PROC_DEF_ID_)
references ACT_RE_PROCDEF (ID_);
alter table ACT_RU_JOB
add constraint ACT_FK_JOB_EXCEPTION
foreign key (EXCEPTION_STACK_ID_)
alter table ACT_RU_JOB
add constraint ACT_FK_JOB_EXCEPTION
foreign key (EXCEPTION_STACK_ID_)
references ACT_GE_BYTEARRAY (ID_);
alter table ACT_RU_TIMER_JOB
add constraint ACT_FK_TIMER_JOB_EXECUTION
foreign key (EXECUTION_ID_)
alter table ACT_RU_TIMER_JOB
add constraint ACT_FK_TIMER_JOB_EXECUTION
foreign key (EXECUTION_ID_)
references ACT_RU_EXECUTION (ID_);
alter table ACT_RU_TIMER_JOB
add constraint ACT_FK_TIMER_JOB_PROCESS_INSTANCE
foreign key (PROCESS_INSTANCE_ID_)
alter table ACT_RU_TIMER_JOB
add constraint ACT_FK_TIMER_JOB_PROCESS_INSTANCE
foreign key (PROCESS_INSTANCE_ID_)
references ACT_RU_EXECUTION (ID_);
alter table ACT_RU_TIMER_JOB
alter table ACT_RU_TIMER_JOB
add constraint ACT_FK_TIMER_JOB_PROC_DEF
foreign key (PROC_DEF_ID_)
foreign key (PROC_DEF_ID_)
references ACT_RE_PROCDEF (ID_);
alter table ACT_RU_TIMER_JOB
add constraint ACT_FK_TIMER_JOB_EXCEPTION
foreign key (EXCEPTION_STACK_ID_)
alter table ACT_RU_TIMER_JOB
add constraint ACT_FK_TIMER_JOB_EXCEPTION
foreign key (EXCEPTION_STACK_ID_)
references ACT_GE_BYTEARRAY (ID_);
alter table ACT_RU_SUSPENDED_JOB
add constraint ACT_FK_SUSPENDED_JOB_EXECUTION
foreign key (EXECUTION_ID_)
alter table ACT_RU_SUSPENDED_JOB
add constraint ACT_FK_SUSPENDED_JOB_EXECUTION
foreign key (EXECUTION_ID_)
references ACT_RU_EXECUTION (ID_);
alter table ACT_RU_SUSPENDED_JOB
add constraint ACT_FK_SUSPENDED_JOB_PROCESS_INSTANCE
foreign key (PROCESS_INSTANCE_ID_)
alter table ACT_RU_SUSPENDED_JOB
add constraint ACT_FK_SUSPENDED_JOB_PROCESS_INSTANCE
foreign key (PROCESS_INSTANCE_ID_)
references ACT_RU_EXECUTION (ID_);
alter table ACT_RU_SUSPENDED_JOB
alter table ACT_RU_SUSPENDED_JOB
add constraint ACT_FK_SUSPENDED_JOB_PROC_DEF
foreign key (PROC_DEF_ID_)
foreign key (PROC_DEF_ID_)
references ACT_RE_PROCDEF (ID_);
alter table ACT_RU_SUSPENDED_JOB
add constraint ACT_FK_SUSPENDED_JOB_EXCEPTION
foreign key (EXCEPTION_STACK_ID_)
alter table ACT_RU_SUSPENDED_JOB
add constraint ACT_FK_SUSPENDED_JOB_EXCEPTION
foreign key (EXCEPTION_STACK_ID_)
references ACT_GE_BYTEARRAY (ID_);
alter table ACT_RU_DEADLETTER_JOB
add constraint ACT_FK_DEADLETTER_JOB_EXECUTION
foreign key (EXECUTION_ID_)
alter table ACT_RU_DEADLETTER_JOB
add constraint ACT_FK_DEADLETTER_JOB_EXECUTION
foreign key (EXECUTION_ID_)
references ACT_RU_EXECUTION (ID_);
alter table ACT_RU_DEADLETTER_JOB
add constraint ACT_FK_DEADLETTER_JOB_PROCESS_INSTANCE
foreign key (PROCESS_INSTANCE_ID_)
alter table ACT_RU_DEADLETTER_JOB
add constraint ACT_FK_DEADLETTER_JOB_PROCESS_INSTANCE
foreign key (PROCESS_INSTANCE_ID_)
references ACT_RU_EXECUTION (ID_);
alter table ACT_RU_DEADLETTER_JOB
alter table ACT_RU_DEADLETTER_JOB
add constraint ACT_FK_DEADLETTER_JOB_PROC_DEF
foreign key (PROC_DEF_ID_)
foreign key (PROC_DEF_ID_)
references ACT_RE_PROCDEF (ID_);
alter table ACT_RU_DEADLETTER_JOB
add constraint ACT_FK_DEADLETTER_JOB_EXCEPTION
foreign key (EXCEPTION_STACK_ID_)
alter table ACT_RU_DEADLETTER_JOB
add constraint ACT_FK_DEADLETTER_JOB_EXCEPTION
foreign key (EXCEPTION_STACK_ID_)
references ACT_GE_BYTEARRAY (ID_);
alter table ACT_RU_EVENT_SUBSCR
add constraint ACT_FK_EVENT_EXEC
foreign key (EXECUTION_ID_)
references ACT_RU_EXECUTION(ID_);
alter table ACT_RE_MODEL
add constraint ACT_FK_MODEL_SOURCE
foreign key (EDITOR_SOURCE_VALUE_ID_)
alter table ACT_RE_MODEL
add constraint ACT_FK_MODEL_SOURCE
foreign key (EDITOR_SOURCE_VALUE_ID_)
references ACT_GE_BYTEARRAY (ID_);
alter table ACT_RE_MODEL
add constraint ACT_FK_MODEL_SOURCE_EXTRA
foreign key (EDITOR_SOURCE_EXTRA_VALUE_ID_)
alter table ACT_RE_MODEL
add constraint ACT_FK_MODEL_SOURCE_EXTRA
foreign key (EDITOR_SOURCE_EXTRA_VALUE_ID_)
references ACT_GE_BYTEARRAY (ID_);
alter table ACT_RE_MODEL
add constraint ACT_FK_MODEL_DEPLOYMENT
foreign key (DEPLOYMENT_ID_)
references ACT_RE_DEPLOYMENT (ID_);
alter table ACT_PROCDEF_INFO
add constraint ACT_FK_INFO_JSON_BA
foreign key (INFO_JSON_ID_)
alter table ACT_RE_MODEL
add constraint ACT_FK_MODEL_DEPLOYMENT
foreign key (DEPLOYMENT_ID_)
references ACT_RE_DEPLOYMENT (ID_);
alter table ACT_PROCDEF_INFO
add constraint ACT_FK_INFO_JSON_BA
foreign key (INFO_JSON_ID_)
references ACT_GE_BYTEARRAY (ID_);
alter table ACT_PROCDEF_INFO
add constraint ACT_FK_INFO_PROCDEF
foreign key (PROC_DEF_ID_)
alter table ACT_PROCDEF_INFO
add constraint ACT_FK_INFO_PROCDEF
foreign key (PROC_DEF_ID_)
references ACT_RE_PROCDEF (ID_);
alter table ACT_PROCDEF_INFO
add constraint ACT_UNIQ_INFO_PROCDEF
unique (PROC_DEF_ID_);
......
......@@ -32,7 +32,7 @@ create table ACT_RE_DEPLOYMENT (
TENANT_ID_ NVARCHAR2(255) DEFAULT '',
DEPLOY_TIME_ TIMESTAMP(6),
ENGINE_VERSION_ NVARCHAR2(255),
VERSION_ INTEGER,
VERSION_ INTEGER DEFAULT 1,
PROJECT_RELEASE_VERSION_ NVARCHAR2(255),
primary key (ID_)
);
......@@ -77,14 +77,15 @@ create table ACT_RU_EXECUTION (
START_USER_ID_ NVARCHAR2(255),
LOCK_TIME_ TIMESTAMP(6),
IS_COUNT_ENABLED_ NUMBER(1,0) CHECK (IS_COUNT_ENABLED_ IN (1,0)),
EVT_SUBSCR_COUNT_ INTEGER,
TASK_COUNT_ INTEGER,
JOB_COUNT_ INTEGER,
EVT_SUBSCR_COUNT_ INTEGER,
TASK_COUNT_ INTEGER,
JOB_COUNT_ INTEGER,
TIMER_JOB_COUNT_ INTEGER,
SUSP_JOB_COUNT_ INTEGER,
DEADLETTER_JOB_COUNT_ INTEGER,
VAR_COUNT_ INTEGER,
VAR_COUNT_ INTEGER,
ID_LINK_COUNT_ INTEGER,
APP_VERSION_ INTEGER,
primary key (ID_)
);
......@@ -183,6 +184,7 @@ create table ACT_RE_PROCDEF (
SUSPENSION_STATE_ INTEGER,
TENANT_ID_ NVARCHAR2(255) DEFAULT '',
ENGINE_VERSION_ NVARCHAR2(255),
APP_VERSION_ INTEGER,
primary key (ID_)
);
......@@ -207,6 +209,7 @@ create table ACT_RU_TASK (
TENANT_ID_ NVARCHAR2(255) DEFAULT '',
FORM_KEY_ NVARCHAR2(255),
CLAIM_TIME_ TIMESTAMP(6),
APP_VERSION_ INTEGER,
primary key (ID_)
);
......@@ -300,77 +303,77 @@ create index ACT_IDX_VARIABLE_TASK_ID on ACT_RU_VARIABLE(TASK_ID_);
create index ACT_IDX_BYTEAR_DEPL on ACT_GE_BYTEARRAY(DEPLOYMENT_ID_);
alter table ACT_GE_BYTEARRAY
add constraint ACT_FK_BYTEARR_DEPL
foreign key (DEPLOYMENT_ID_)
foreign key (DEPLOYMENT_ID_)
references ACT_RE_DEPLOYMENT (ID_);
alter table ACT_RE_PROCDEF
add constraint ACT_UNIQ_PROCDEF
unique (KEY_,VERSION_, TENANT_ID_);
create index ACT_IDX_EXE_PROCINST on ACT_RU_EXECUTION(PROC_INST_ID_);
alter table ACT_RU_EXECUTION
add constraint ACT_FK_EXE_PROCINST
foreign key (PROC_INST_ID_)
foreign key (PROC_INST_ID_)
references ACT_RU_EXECUTION (ID_);
create index ACT_IDX_EXE_PARENT on ACT_RU_EXECUTION(PARENT_ID_);
alter table ACT_RU_EXECUTION
add constraint ACT_FK_EXE_PARENT
foreign key (PARENT_ID_)
foreign key (PARENT_ID_)
references ACT_RU_EXECUTION (ID_);
create index ACT_IDX_EXE_SUPER on ACT_RU_EXECUTION(SUPER_EXEC_);
alter table ACT_RU_EXECUTION
add constraint ACT_FK_EXE_SUPER
foreign key (SUPER_EXEC_)
foreign key (SUPER_EXEC_)
references ACT_RU_EXECUTION (ID_);
create index ACT_IDX_EXE_PROCDEF on ACT_RU_EXECUTION(PROC_DEF_ID_);
alter table ACT_RU_EXECUTION
add constraint ACT_FK_EXE_PROCDEF
foreign key (PROC_DEF_ID_)
references ACT_RE_PROCDEF (ID_);
add constraint ACT_FK_EXE_PROCDEF
foreign key (PROC_DEF_ID_)
references ACT_RE_PROCDEF (ID_);
create index ACT_IDX_TSKASS_TASK on ACT_RU_IDENTITYLINK(TASK_ID_);
alter table ACT_RU_IDENTITYLINK
add constraint ACT_FK_TSKASS_TASK
foreign key (TASK_ID_)
foreign key (TASK_ID_)
references ACT_RU_TASK (ID_);
create index ACT_IDX_ATHRZ_PROCEDEF on ACT_RU_IDENTITYLINK(PROC_DEF_ID_);
alter table ACT_RU_IDENTITYLINK
add constraint ACT_FK_ATHRZ_PROCEDEF
foreign key (PROC_DEF_ID_)
foreign key (PROC_DEF_ID_)
references ACT_RE_PROCDEF (ID_);
create index ACT_IDX_IDL_PROCINST on ACT_RU_IDENTITYLINK(PROC_INST_ID_);
alter table ACT_RU_IDENTITYLINK
add constraint ACT_FK_IDL_PROCINST
foreign key (PROC_INST_ID_)
references ACT_RU_EXECUTION (ID_);
foreign key (PROC_INST_ID_)
references ACT_RU_EXECUTION (ID_);
create index ACT_IDX_TASK_EXEC on ACT_RU_TASK(EXECUTION_ID_);
alter table ACT_RU_TASK
add constraint ACT_FK_TASK_EXE
foreign key (EXECUTION_ID_)
references ACT_RU_EXECUTION (ID_);
create index ACT_IDX_TASK_PROCINST on ACT_RU_TASK(PROC_INST_ID_);
alter table ACT_RU_TASK
add constraint ACT_FK_TASK_PROCINST
foreign key (PROC_INST_ID_)
references ACT_RU_EXECUTION (ID_);
create index ACT_IDX_TASK_PROCDEF on ACT_RU_TASK(PROC_DEF_ID_);
alter table ACT_RU_TASK
add constraint ACT_FK_TASK_PROCDEF
foreign key (PROC_DEF_ID_)
references ACT_RE_PROCDEF (ID_);
create index ACT_IDX_VAR_EXE on ACT_RU_VARIABLE(EXECUTION_ID_);
alter table ACT_RU_VARIABLE
alter table ACT_RU_VARIABLE
add constraint ACT_FK_VAR_EXE
foreign key (EXECUTION_ID_)
foreign key (EXECUTION_ID_)
references ACT_RU_EXECUTION (ID_);
create index ACT_IDX_VAR_PROCINST on ACT_RU_VARIABLE(PROC_INST_ID_);
......@@ -380,107 +383,107 @@ alter table ACT_RU_VARIABLE
references ACT_RU_EXECUTION(ID_);
create index ACT_IDX_VAR_BYTEARRAY on ACT_RU_VARIABLE(BYTEARRAY_ID_);
alter table ACT_RU_VARIABLE
add constraint ACT_FK_VAR_BYTEARRAY
foreign key (BYTEARRAY_ID_)
alter table ACT_RU_VARIABLE
add constraint ACT_FK_VAR_BYTEARRAY
foreign key (BYTEARRAY_ID_)
references ACT_GE_BYTEARRAY (ID_);
create index ACT_IDX_JOB_EXECUTION_ID on ACT_RU_JOB(EXECUTION_ID_);
alter table ACT_RU_JOB
add constraint ACT_FK_JOB_EXECUTION
foreign key (EXECUTION_ID_)
alter table ACT_RU_JOB
add constraint ACT_FK_JOB_EXECUTION
foreign key (EXECUTION_ID_)
references ACT_RU_EXECUTION (ID_);
create index ACT_IDX_JOB_PROC_INST_ID on ACT_RU_JOB(PROCESS_INSTANCE_ID_);
alter table ACT_RU_JOB
add constraint ACT_FK_JOB_PROCESS_INSTANCE
foreign key (PROCESS_INSTANCE_ID_)
alter table ACT_RU_JOB
add constraint ACT_FK_JOB_PROCESS_INSTANCE
foreign key (PROCESS_INSTANCE_ID_)
references ACT_RU_EXECUTION (ID_);
create index ACT_IDX_JOB_PROC_DEF_ID on ACT_RU_JOB(PROC_DEF_ID_);
alter table ACT_RU_JOB
alter table ACT_RU_JOB
add constraint ACT_FK_JOB_PROC_DEF
foreign key (PROC_DEF_ID_)
foreign key (PROC_DEF_ID_)
references ACT_RE_PROCDEF (ID_);
create index ACT_IDX_JOB_EXCEPTION on ACT_RU_JOB(EXCEPTION_STACK_ID_);
alter table ACT_RU_JOB
add constraint ACT_FK_JOB_EXCEPTION
foreign key (EXCEPTION_STACK_ID_)
alter table ACT_RU_JOB
add constraint ACT_FK_JOB_EXCEPTION
foreign key (EXCEPTION_STACK_ID_)
references ACT_GE_BYTEARRAY (ID_);
create index ACT_IDX_TJOB_EXECUTION_ID on ACT_RU_TIMER_JOB(EXECUTION_ID_);
alter table ACT_RU_TIMER_JOB
add constraint ACT_FK_TJOB_EXECUTION
foreign key (EXECUTION_ID_)
alter table ACT_RU_TIMER_JOB
add constraint ACT_FK_TJOB_EXECUTION
foreign key (EXECUTION_ID_)
references ACT_RU_EXECUTION (ID_);
create index ACT_IDX_TJOB_PROC_INST_ID on ACT_RU_TIMER_JOB(PROCESS_INSTANCE_ID_);
alter table ACT_RU_TIMER_JOB
add constraint ACT_FK_TJOB_PROCESS_INSTANCE
foreign key (PROCESS_INSTANCE_ID_)
alter table ACT_RU_TIMER_JOB
add constraint ACT_FK_TJOB_PROCESS_INSTANCE
foreign key (PROCESS_INSTANCE_ID_)
references ACT_RU_EXECUTION (ID_);
create index ACT_IDX_TJOB_PROC_DEF_ID on ACT_RU_TIMER_JOB(PROC_DEF_ID_);
alter table ACT_RU_TIMER_JOB
alter table ACT_RU_TIMER_JOB
add constraint ACT_FK_TJOB_PROC_DEF
foreign key (PROC_DEF_ID_)
foreign key (PROC_DEF_ID_)
references ACT_RE_PROCDEF (ID_);
create index ACT_IDX_TJOB_EXCEPTION on ACT_RU_TIMER_JOB(EXCEPTION_STACK_ID_);
alter table ACT_RU_TIMER_JOB
add constraint ACT_FK_TJOB_EXCEPTION
foreign key (EXCEPTION_STACK_ID_)
create index ACT_IDX_TJOB_EXCEPTION on ACT_RU_TIMER_JOB(EXCEPTION_STACK_ID_);
alter table ACT_RU_TIMER_JOB
add constraint ACT_FK_TJOB_EXCEPTION
foreign key (EXCEPTION_STACK_ID_)
references ACT_GE_BYTEARRAY (ID_);
create index ACT_IDX_SJOB_EXECUTION_ID on ACT_RU_SUSPENDED_JOB(EXECUTION_ID_);
alter table ACT_RU_SUSPENDED_JOB
add constraint ACT_FK_SJOB_EXECUTION
foreign key (EXECUTION_ID_)
create index ACT_IDX_SJOB_EXECUTION_ID on ACT_RU_SUSPENDED_JOB(EXECUTION_ID_);
alter table ACT_RU_SUSPENDED_JOB
add constraint ACT_FK_SJOB_EXECUTION
foreign key (EXECUTION_ID_)
references ACT_RU_EXECUTION (ID_);
create index ACT_IDX_SJOB_PROC_INST_ID on ACT_RU_SUSPENDED_JOB(PROCESS_INSTANCE_ID_);
alter table ACT_RU_SUSPENDED_JOB
add constraint ACT_FK_SJOB_PROCESS_INSTANCE
foreign key (PROCESS_INSTANCE_ID_)
create index ACT_IDX_SJOB_PROC_INST_ID on ACT_RU_SUSPENDED_JOB(PROCESS_INSTANCE_ID_);
alter table ACT_RU_SUSPENDED_JOB
add constraint ACT_FK_SJOB_PROCESS_INSTANCE
foreign key (PROCESS_INSTANCE_ID_)
references ACT_RU_EXECUTION (ID_);
create index ACT_IDX_SJOB_PROC_DEF_ID on ACT_RU_SUSPENDED_JOB(PROC_DEF_ID_);
alter table ACT_RU_SUSPENDED_JOB
create index ACT_IDX_SJOB_PROC_DEF_ID on ACT_RU_SUSPENDED_JOB(PROC_DEF_ID_);
alter table ACT_RU_SUSPENDED_JOB
add constraint ACT_FK_SJOB_PROC_DEF
foreign key (PROC_DEF_ID_)
foreign key (PROC_DEF_ID_)
references ACT_RE_PROCDEF (ID_);
create index ACT_IDX_SJOB_EXCEPTION on ACT_RU_SUSPENDED_JOB(EXCEPTION_STACK_ID_);
alter table ACT_RU_SUSPENDED_JOB
add constraint ACT_FK_SJOB_EXCEPTION
foreign key (EXCEPTION_STACK_ID_)
create index ACT_IDX_SJOB_EXCEPTION on ACT_RU_SUSPENDED_JOB(EXCEPTION_STACK_ID_);
alter table ACT_RU_SUSPENDED_JOB
add constraint ACT_FK_SJOB_EXCEPTION
foreign key (EXCEPTION_STACK_ID_)
references ACT_GE_BYTEARRAY (ID_);
create index ACT_IDX_DJOB_EXECUTION_ID on ACT_RU_DEADLETTER_JOB(EXECUTION_ID_);
alter table ACT_RU_DEADLETTER_JOB
add constraint ACT_FK_DJOB_EXECUTION
foreign key (EXECUTION_ID_)
create index ACT_IDX_DJOB_EXECUTION_ID on ACT_RU_DEADLETTER_JOB(EXECUTION_ID_);
alter table ACT_RU_DEADLETTER_JOB
add constraint ACT_FK_DJOB_EXECUTION
foreign key (EXECUTION_ID_)
references ACT_RU_EXECUTION (ID_);
create index ACT_IDX_DJOB_PROC_INST_ID on ACT_RU_DEADLETTER_JOB(PROCESS_INSTANCE_ID_);
alter table ACT_RU_DEADLETTER_JOB
add constraint ACT_FK_DJOB_PROCESS_INSTANCE
foreign key (PROCESS_INSTANCE_ID_)
create index ACT_IDX_DJOB_PROC_INST_ID on ACT_RU_DEADLETTER_JOB(PROCESS_INSTANCE_ID_);
alter table ACT_RU_DEADLETTER_JOB
add constraint ACT_FK_DJOB_PROCESS_INSTANCE
foreign key (PROCESS_INSTANCE_ID_)
references ACT_RU_EXECUTION (ID_);
create index ACT_IDX_DJOB_PROC_DEF_ID on ACT_RU_DEADLETTER_JOB(PROC_DEF_ID_);
alter table ACT_RU_DEADLETTER_JOB
create index ACT_IDX_DJOB_PROC_DEF_ID on ACT_RU_DEADLETTER_JOB(PROC_DEF_ID_);
alter table ACT_RU_DEADLETTER_JOB
add constraint ACT_FK_DJOB_PROC_DEF
foreign key (PROC_DEF_ID_)
foreign key (PROC_DEF_ID_)
references ACT_RE_PROCDEF (ID_);
create index ACT_IDX_DJOB_EXCEPTION on ACT_RU_DEADLETTER_JOB(EXCEPTION_STACK_ID_);
alter table ACT_RU_DEADLETTER_JOB
add constraint ACT_FK_DJOB_EXCEPTION
foreign key (EXCEPTION_STACK_ID_)
create index ACT_IDX_DJOB_EXCEPTION on ACT_RU_DEADLETTER_JOB(EXCEPTION_STACK_ID_);
alter table ACT_RU_DEADLETTER_JOB
add constraint ACT_FK_DJOB_EXCEPTION
foreign key (EXCEPTION_STACK_ID_)
references ACT_GE_BYTEARRAY (ID_);
create index ACT_IDX_EVENT_SUBSCR on ACT_RU_EVENT_SUBSCR(EXECUTION_ID_);
alter table ACT_RU_EVENT_SUBSCR
add constraint ACT_FK_EVENT_EXEC
......@@ -488,35 +491,35 @@ alter table ACT_RU_EVENT_SUBSCR
references ACT_RU_EXECUTION(ID_);
create index ACT_IDX_MODEL_SOURCE on ACT_RE_MODEL(EDITOR_SOURCE_VALUE_ID_);
alter table ACT_RE_MODEL
add constraint ACT_FK_MODEL_SOURCE
foreign key (EDITOR_SOURCE_VALUE_ID_)
alter table ACT_RE_MODEL
add constraint ACT_FK_MODEL_SOURCE
foreign key (EDITOR_SOURCE_VALUE_ID_)
references ACT_GE_BYTEARRAY (ID_);
create index ACT_IDX_MODEL_SOURCE_EXTRA on ACT_RE_MODEL(EDITOR_SOURCE_EXTRA_VALUE_ID_);
alter table ACT_RE_MODEL
add constraint ACT_FK_MODEL_SOURCE_EXTRA
foreign key (EDITOR_SOURCE_EXTRA_VALUE_ID_)
alter table ACT_RE_MODEL
add constraint ACT_FK_MODEL_SOURCE_EXTRA
foreign key (EDITOR_SOURCE_EXTRA_VALUE_ID_)
references ACT_GE_BYTEARRAY (ID_);
create index ACT_IDX_MODEL_DEPLOYMENT on ACT_RE_MODEL(DEPLOYMENT_ID_);
alter table ACT_RE_MODEL
add constraint ACT_FK_MODEL_DEPLOYMENT
foreign key (DEPLOYMENT_ID_)
references ACT_RE_DEPLOYMENT (ID_);
create index ACT_IDX_MODEL_DEPLOYMENT on ACT_RE_MODEL(DEPLOYMENT_ID_);
alter table ACT_RE_MODEL
add constraint ACT_FK_MODEL_DEPLOYMENT
foreign key (DEPLOYMENT_ID_)
references ACT_RE_DEPLOYMENT (ID_);
create index ACT_IDX_PROCDEF_INFO_JSON on ACT_PROCDEF_INFO(INFO_JSON_ID_);
alter table ACT_PROCDEF_INFO
add constraint ACT_FK_INFO_JSON_BA
foreign key (INFO_JSON_ID_)
alter table ACT_PROCDEF_INFO
add constraint ACT_FK_INFO_JSON_BA
foreign key (INFO_JSON_ID_)
references ACT_GE_BYTEARRAY (ID_);
create index ACT_IDX_PROCDEF_INFO_PROC on ACT_PROCDEF_INFO(PROC_DEF_ID_);
alter table ACT_PROCDEF_INFO
add constraint ACT_FK_INFO_PROCDEF
foreign key (PROC_DEF_ID_)
alter table ACT_PROCDEF_INFO
add constraint ACT_FK_INFO_PROCDEF
foreign key (PROC_DEF_ID_)
references ACT_RE_PROCDEF (ID_);
alter table ACT_PROCDEF_INFO
add constraint ACT_UNIQ_INFO_PROCDEF
unique (PROC_DEF_ID_);
......
......@@ -6,10 +6,10 @@ create table ACT_GE_PROPERTY (
);
insert into ACT_GE_PROPERTY
values ('schema.version', '7.0.0.0', 1);
values ('schema.version', '7.1.0-M6', 1);
insert into ACT_GE_PROPERTY
values ('schema.history', 'create(7.0.0.0)', 1);
values ('schema.history', 'create(7.1.0-M6)', 1);
insert into ACT_GE_PROPERTY
values ('next.dbid', '1', 1);
......@@ -32,7 +32,7 @@ create table ACT_RE_DEPLOYMENT (
TENANT_ID_ varchar(255) default '',
DEPLOY_TIME_ timestamp,
ENGINE_VERSION_ varchar(255),
VERSION_ integer,
VERSION_ integer default 1,
PROJECT_RELEASE_VERSION_ varchar(255),
primary key (ID_)
);
......@@ -77,14 +77,15 @@ create table ACT_RU_EXECUTION (
START_USER_ID_ varchar(255),
LOCK_TIME_ timestamp,
IS_COUNT_ENABLED_ boolean,
EVT_SUBSCR_COUNT_ integer,
TASK_COUNT_ integer,
JOB_COUNT_ integer,
EVT_SUBSCR_COUNT_ integer,
TASK_COUNT_ integer,
JOB_COUNT_ integer,
TIMER_JOB_COUNT_ integer,
SUSP_JOB_COUNT_ integer,
DEADLETTER_JOB_COUNT_ integer,
VAR_COUNT_ integer,
VAR_COUNT_ integer,
ID_LINK_COUNT_ integer,
APP_VERSION_ integer,
primary key (ID_)
);
......@@ -183,6 +184,7 @@ create table ACT_RE_PROCDEF (
SUSPENSION_STATE_ integer,
TENANT_ID_ varchar(255) default '',
ENGINE_VERSION_ varchar(255),
APP_VERSION_ integer,
primary key (ID_)
);
......@@ -207,6 +209,7 @@ create table ACT_RU_TASK (
TENANT_ID_ varchar(255) default '',
FORM_KEY_ varchar(255),
CLAIM_TIME_ timestamp,
APP_VERSION_ integer,
primary key (ID_)
);
......@@ -297,79 +300,79 @@ create index ACT_IDX_VARIABLE_TASK_ID on ACT_RU_VARIABLE(TASK_ID_);
create index ACT_IDX_BYTEAR_DEPL on ACT_GE_BYTEARRAY(DEPLOYMENT_ID_);
alter table ACT_GE_BYTEARRAY
add constraint ACT_FK_BYTEARR_DEPL
foreign key (DEPLOYMENT_ID_)
foreign key (DEPLOYMENT_ID_)
references ACT_RE_DEPLOYMENT (ID_);
alter table ACT_RE_PROCDEF
add constraint ACT_UNIQ_PROCDEF
unique (KEY_,VERSION_, TENANT_ID_);
create index ACT_IDX_EXE_PROCINST on ACT_RU_EXECUTION(PROC_INST_ID_);
alter table ACT_RU_EXECUTION
add constraint ACT_FK_EXE_PROCINST
foreign key (PROC_INST_ID_)
add constraint ACT_FK_EXE_PROCINST
foreign key (PROC_INST_ID_)
references ACT_RU_EXECUTION (ID_);
create index ACT_IDX_EXE_PARENT on ACT_RU_EXECUTION(PARENT_ID_);
alter table ACT_RU_EXECUTION
add constraint ACT_FK_EXE_PARENT
foreign key (PARENT_ID_)
foreign key (PARENT_ID_)
references ACT_RU_EXECUTION (ID_);
create index ACT_IDX_EXE_SUPER on ACT_RU_EXECUTION(SUPER_EXEC_);
alter table ACT_RU_EXECUTION
add constraint ACT_FK_EXE_SUPER
foreign key (SUPER_EXEC_)
foreign key (SUPER_EXEC_)
references ACT_RU_EXECUTION (ID_);
create index ACT_IDX_EXE_PROCDEF on ACT_RU_EXECUTION(PROC_DEF_ID_);
create index ACT_IDX_EXE_PROCDEF on ACT_RU_EXECUTION(PROC_DEF_ID_);
alter table ACT_RU_EXECUTION
add constraint ACT_FK_EXE_PROCDEF
foreign key (PROC_DEF_ID_)
references ACT_RE_PROCDEF (ID_);
add constraint ACT_FK_EXE_PROCDEF
foreign key (PROC_DEF_ID_)
references ACT_RE_PROCDEF (ID_);
create index ACT_IDX_TSKASS_TASK on ACT_RU_IDENTITYLINK(TASK_ID_);
alter table ACT_RU_IDENTITYLINK
add constraint ACT_FK_TSKASS_TASK
foreign key (TASK_ID_)
foreign key (TASK_ID_)
references ACT_RU_TASK (ID_);
create index ACT_IDX_ATHRZ_PROCEDEF on ACT_RU_IDENTITYLINK(PROC_DEF_ID_);
alter table ACT_RU_IDENTITYLINK
add constraint ACT_FK_ATHRZ_PROCEDEF
foreign key (PROC_DEF_ID_)
foreign key (PROC_DEF_ID_)
references ACT_RE_PROCDEF (ID_);
create index ACT_IDX_IDL_PROCINST on ACT_RU_IDENTITYLINK(PROC_INST_ID_);
alter table ACT_RU_IDENTITYLINK
add constraint ACT_FK_IDL_PROCINST
foreign key (PROC_INST_ID_)
references ACT_RU_EXECUTION (ID_);
foreign key (PROC_INST_ID_)
references ACT_RU_EXECUTION (ID_);
create index ACT_IDX_TASK_EXEC on ACT_RU_TASK(EXECUTION_ID_);
alter table ACT_RU_TASK
add constraint ACT_FK_TASK_EXE
foreign key (EXECUTION_ID_)
references ACT_RU_EXECUTION (ID_);
create index ACT_IDX_TASK_PROCINST on ACT_RU_TASK(PROC_INST_ID_);
alter table ACT_RU_TASK
add constraint ACT_FK_TASK_PROCINST
foreign key (PROC_INST_ID_)
references ACT_RU_EXECUTION (ID_);
create index ACT_IDX_TASK_PROCDEF on ACT_RU_TASK(PROC_DEF_ID_);
alter table ACT_RU_TASK
add constraint ACT_FK_TASK_PROCDEF
foreign key (PROC_DEF_ID_)
references ACT_RE_PROCDEF (ID_);
create index ACT_IDX_VAR_EXE on ACT_RU_VARIABLE(EXECUTION_ID_);
alter table ACT_RU_VARIABLE
alter table ACT_RU_VARIABLE
add constraint ACT_FK_VAR_EXE
foreign key (EXECUTION_ID_)
foreign key (EXECUTION_ID_)
references ACT_RU_EXECUTION (ID_);
create index ACT_IDX_VAR_PROCINST on ACT_RU_VARIABLE(PROC_INST_ID_);
......@@ -379,105 +382,105 @@ alter table ACT_RU_VARIABLE
references ACT_RU_EXECUTION(ID_);
create index ACT_IDX_VAR_BYTEARRAY on ACT_RU_VARIABLE(BYTEARRAY_ID_);
alter table ACT_RU_VARIABLE
add constraint ACT_FK_VAR_BYTEARRAY
foreign key (BYTEARRAY_ID_)
alter table ACT_RU_VARIABLE
add constraint ACT_FK_VAR_BYTEARRAY
foreign key (BYTEARRAY_ID_)
references ACT_GE_BYTEARRAY (ID_);
create index ACT_IDX_JOB_EXECUTION_ID on ACT_RU_JOB(EXECUTION_ID_);
alter table ACT_RU_JOB
add constraint ACT_FK_JOB_EXECUTION
foreign key (EXECUTION_ID_)
alter table ACT_RU_JOB
add constraint ACT_FK_JOB_EXECUTION
foreign key (EXECUTION_ID_)
references ACT_RU_EXECUTION (ID_);
create index ACT_IDX_JOB_PROCESS_INSTANCE_ID on ACT_RU_JOB(PROCESS_INSTANCE_ID_);
alter table ACT_RU_JOB
add constraint ACT_FK_JOB_PROCESS_INSTANCE
foreign key (PROCESS_INSTANCE_ID_)
alter table ACT_RU_JOB
add constraint ACT_FK_JOB_PROCESS_INSTANCE
foreign key (PROCESS_INSTANCE_ID_)
references ACT_RU_EXECUTION (ID_);
create index ACT_IDX_JOB_PROC_DEF_ID on ACT_RU_JOB(PROC_DEF_ID_);
alter table ACT_RU_JOB
alter table ACT_RU_JOB
add constraint ACT_FK_JOB_PROC_DEF
foreign key (PROC_DEF_ID_)
foreign key (PROC_DEF_ID_)
references ACT_RE_PROCDEF (ID_);
create index ACT_IDX_JOB_EXCEPTION on ACT_RU_JOB(EXCEPTION_STACK_ID_);
alter table ACT_RU_JOB
add constraint ACT_FK_JOB_EXCEPTION
foreign key (EXCEPTION_STACK_ID_)
alter table ACT_RU_JOB
add constraint ACT_FK_JOB_EXCEPTION
foreign key (EXCEPTION_STACK_ID_)
references ACT_GE_BYTEARRAY (ID_);
create index ACT_IDX_TIMER_JOB_EXECUTION_ID on ACT_RU_TIMER_JOB(EXECUTION_ID_);
alter table ACT_RU_TIMER_JOB
add constraint ACT_FK_TIMER_JOB_EXECUTION
foreign key (EXECUTION_ID_)
alter table ACT_RU_TIMER_JOB
add constraint ACT_FK_TIMER_JOB_EXECUTION
foreign key (EXECUTION_ID_)
references ACT_RU_EXECUTION (ID_);
create index ACT_IDX_TIMER_JOB_PROCESS_INSTANCE_ID on ACT_RU_TIMER_JOB(PROCESS_INSTANCE_ID_);
alter table ACT_RU_TIMER_JOB
add constraint ACT_FK_TIMER_JOB_PROCESS_INSTANCE
foreign key (PROCESS_INSTANCE_ID_)
alter table ACT_RU_TIMER_JOB
add constraint ACT_FK_TIMER_JOB_PROCESS_INSTANCE
foreign key (PROCESS_INSTANCE_ID_)
references ACT_RU_EXECUTION (ID_);
create index ACT_IDX_TIMER_JOB_PROC_DEF_ID on ACT_RU_TIMER_JOB(PROC_DEF_ID_);
alter table ACT_RU_TIMER_JOB
alter table ACT_RU_TIMER_JOB
add constraint ACT_FK_TIMER_JOB_PROC_DEF
foreign key (PROC_DEF_ID_)
foreign key (PROC_DEF_ID_)
references ACT_RE_PROCDEF (ID_);
create index ACT_IDX_TIMER_JOB_EXCEPTION on ACT_RU_TIMER_JOB(EXCEPTION_STACK_ID_);
alter table ACT_RU_TIMER_JOB
add constraint ACT_FK_TIMER_JOB_EXCEPTION
foreign key (EXCEPTION_STACK_ID_)
create index ACT_IDX_TIMER_JOB_EXCEPTION on ACT_RU_TIMER_JOB(EXCEPTION_STACK_ID_);
alter table ACT_RU_TIMER_JOB
add constraint ACT_FK_TIMER_JOB_EXCEPTION
foreign key (EXCEPTION_STACK_ID_)
references ACT_GE_BYTEARRAY (ID_);
create index ACT_IDX_SUSPENDED_JOB_EXECUTION_ID on ACT_RU_SUSPENDED_JOB(EXECUTION_ID_);
alter table ACT_RU_SUSPENDED_JOB
add constraint ACT_FK_SUSPENDED_JOB_EXECUTION
foreign key (EXECUTION_ID_)
create index ACT_IDX_SUSPENDED_JOB_EXECUTION_ID on ACT_RU_SUSPENDED_JOB(EXECUTION_ID_);
alter table ACT_RU_SUSPENDED_JOB
add constraint ACT_FK_SUSPENDED_JOB_EXECUTION
foreign key (EXECUTION_ID_)
references ACT_RU_EXECUTION (ID_);
create index ACT_IDX_SUSPENDED_JOB_PROCESS_INSTANCE_ID on ACT_RU_SUSPENDED_JOB(PROCESS_INSTANCE_ID_);
alter table ACT_RU_SUSPENDED_JOB
add constraint ACT_FK_SUSPENDED_JOB_PROCESS_INSTANCE
foreign key (PROCESS_INSTANCE_ID_)
create index ACT_IDX_SUSPENDED_JOB_PROCESS_INSTANCE_ID on ACT_RU_SUSPENDED_JOB(PROCESS_INSTANCE_ID_);
alter table ACT_RU_SUSPENDED_JOB
add constraint ACT_FK_SUSPENDED_JOB_PROCESS_INSTANCE
foreign key (PROCESS_INSTANCE_ID_)
references ACT_RU_EXECUTION (ID_);
create index ACT_IDX_SUSPENDED_JOB_PROC_DEF_ID on ACT_RU_SUSPENDED_JOB(PROC_DEF_ID_);
alter table ACT_RU_SUSPENDED_JOB
create index ACT_IDX_SUSPENDED_JOB_PROC_DEF_ID on ACT_RU_SUSPENDED_JOB(PROC_DEF_ID_);
alter table ACT_RU_SUSPENDED_JOB
add constraint ACT_FK_SUSPENDED_JOB_PROC_DEF
foreign key (PROC_DEF_ID_)
foreign key (PROC_DEF_ID_)
references ACT_RE_PROCDEF (ID_);
create index ACT_IDX_SUSPENDED_JOB_EXCEPTION on ACT_RU_SUSPENDED_JOB(EXCEPTION_STACK_ID_);
alter table ACT_RU_SUSPENDED_JOB
add constraint ACT_FK_SUSPENDED_JOB_EXCEPTION
foreign key (EXCEPTION_STACK_ID_)
create index ACT_IDX_SUSPENDED_JOB_EXCEPTION on ACT_RU_SUSPENDED_JOB(EXCEPTION_STACK_ID_);
alter table ACT_RU_SUSPENDED_JOB
add constraint ACT_FK_SUSPENDED_JOB_EXCEPTION
foreign key (EXCEPTION_STACK_ID_)
references ACT_GE_BYTEARRAY (ID_);
create index ACT_IDX_DEADLETTER_JOB_EXECUTION_ID on ACT_RU_DEADLETTER_JOB(EXECUTION_ID_);
alter table ACT_RU_DEADLETTER_JOB
add constraint ACT_FK_DEADLETTER_JOB_EXECUTION
foreign key (EXECUTION_ID_)
create index ACT_IDX_DEADLETTER_JOB_EXECUTION_ID on ACT_RU_DEADLETTER_JOB(EXECUTION_ID_);
alter table ACT_RU_DEADLETTER_JOB
add constraint ACT_FK_DEADLETTER_JOB_EXECUTION
foreign key (EXECUTION_ID_)
references ACT_RU_EXECUTION (ID_);
create index ACT_IDX_DEADLETTER_JOB_PROCESS_INSTANCE_ID on ACT_RU_DEADLETTER_JOB(PROCESS_INSTANCE_ID_);
alter table ACT_RU_DEADLETTER_JOB
add constraint ACT_FK_DEADLETTER_JOB_PROCESS_INSTANCE
foreign key (PROCESS_INSTANCE_ID_)
create index ACT_IDX_DEADLETTER_JOB_PROCESS_INSTANCE_ID on ACT_RU_DEADLETTER_JOB(PROCESS_INSTANCE_ID_);
alter table ACT_RU_DEADLETTER_JOB
add constraint ACT_FK_DEADLETTER_JOB_PROCESS_INSTANCE
foreign key (PROCESS_INSTANCE_ID_)
references ACT_RU_EXECUTION (ID_);
create index ACT_IDX_DEADLETTER_JOB_PROC_DEF_ID on ACT_RU_DEADLETTER_JOB(PROC_DEF_ID_);
alter table ACT_RU_DEADLETTER_JOB
create index ACT_IDX_DEADLETTER_JOB_PROC_DEF_ID on ACT_RU_DEADLETTER_JOB(PROC_DEF_ID_);
alter table ACT_RU_DEADLETTER_JOB
add constraint ACT_FK_DEADLETTER_JOB_PROC_DEF
foreign key (PROC_DEF_ID_)
foreign key (PROC_DEF_ID_)
references ACT_RE_PROCDEF (ID_);
create index ACT_IDX_DEADLETTER_JOB_EXCEPTION on ACT_RU_DEADLETTER_JOB(EXCEPTION_STACK_ID_);
alter table ACT_RU_DEADLETTER_JOB
add constraint ACT_FK_DEADLETTER_JOB_EXCEPTION
foreign key (EXCEPTION_STACK_ID_)
create index ACT_IDX_DEADLETTER_JOB_EXCEPTION on ACT_RU_DEADLETTER_JOB(EXCEPTION_STACK_ID_);
alter table ACT_RU_DEADLETTER_JOB
add constraint ACT_FK_DEADLETTER_JOB_EXCEPTION
foreign key (EXCEPTION_STACK_ID_)
references ACT_GE_BYTEARRAY (ID_);
create index ACT_IDX_EVENT_SUBSCR on ACT_RU_EVENT_SUBSCR(EXECUTION_ID_);
......@@ -487,35 +490,35 @@ alter table ACT_RU_EVENT_SUBSCR
references ACT_RU_EXECUTION(ID_);
create index ACT_IDX_MODEL_SOURCE on ACT_RE_MODEL(EDITOR_SOURCE_VALUE_ID_);
alter table ACT_RE_MODEL
add constraint ACT_FK_MODEL_SOURCE
foreign key (EDITOR_SOURCE_VALUE_ID_)
alter table ACT_RE_MODEL
add constraint ACT_FK_MODEL_SOURCE
foreign key (EDITOR_SOURCE_VALUE_ID_)
references ACT_GE_BYTEARRAY (ID_);
create index ACT_IDX_MODEL_SOURCE_EXTRA on ACT_RE_MODEL(EDITOR_SOURCE_EXTRA_VALUE_ID_);
alter table ACT_RE_MODEL
add constraint ACT_FK_MODEL_SOURCE_EXTRA
foreign key (EDITOR_SOURCE_EXTRA_VALUE_ID_)
alter table ACT_RE_MODEL
add constraint ACT_FK_MODEL_SOURCE_EXTRA
foreign key (EDITOR_SOURCE_EXTRA_VALUE_ID_)
references ACT_GE_BYTEARRAY (ID_);
create index ACT_IDX_MODEL_DEPLOYMENT on ACT_RE_MODEL(DEPLOYMENT_ID_);
alter table ACT_RE_MODEL
add constraint ACT_FK_MODEL_DEPLOYMENT
foreign key (DEPLOYMENT_ID_)
references ACT_RE_DEPLOYMENT (ID_);
create index ACT_IDX_MODEL_DEPLOYMENT on ACT_RE_MODEL(DEPLOYMENT_ID_);
alter table ACT_RE_MODEL
add constraint ACT_FK_MODEL_DEPLOYMENT
foreign key (DEPLOYMENT_ID_)
references ACT_RE_DEPLOYMENT (ID_);
create index ACT_IDX_PROCDEF_INFO_JSON on ACT_PROCDEF_INFO(INFO_JSON_ID_);
alter table ACT_PROCDEF_INFO
add constraint ACT_FK_INFO_JSON_BA
foreign key (INFO_JSON_ID_)
alter table ACT_PROCDEF_INFO
add constraint ACT_FK_INFO_JSON_BA
foreign key (INFO_JSON_ID_)
references ACT_GE_BYTEARRAY (ID_);
create index ACT_IDX_PROCDEF_INFO_PROC on ACT_PROCDEF_INFO(PROC_DEF_ID_);
alter table ACT_PROCDEF_INFO
add constraint ACT_FK_INFO_PROCDEF
foreign key (PROC_DEF_ID_)
alter table ACT_PROCDEF_INFO
add constraint ACT_FK_INFO_PROCDEF
foreign key (PROC_DEF_ID_)
references ACT_RE_PROCDEF (ID_);
alter table ACT_PROCDEF_INFO
add constraint ACT_UNIQ_INFO_PROCDEF
unique (PROC_DEF_ID_);
......
......@@ -7,7 +7,7 @@
<!-- PROCESSDEFINITION INSERT -->
<insert id="insertProcessDefinition" parameterType="org.activiti.engine.impl.persistence.entity.ProcessDefinitionEntityImpl">
insert into ${prefix}ACT_RE_PROCDEF(ID_, REV_, CATEGORY_, NAME_, KEY_, VERSION_, DEPLOYMENT_ID_, RESOURCE_NAME_, DGRM_RESOURCE_NAME_, DESCRIPTION_, HAS_START_FORM_KEY_, HAS_GRAPHICAL_NOTATION_ , SUSPENSION_STATE_, TENANT_ID_, ENGINE_VERSION_)
insert into ${prefix}ACT_RE_PROCDEF(ID_, REV_, CATEGORY_, NAME_, KEY_, VERSION_, DEPLOYMENT_ID_, RESOURCE_NAME_, DGRM_RESOURCE_NAME_, DESCRIPTION_, HAS_START_FORM_KEY_, HAS_GRAPHICAL_NOTATION_ , SUSPENSION_STATE_, TENANT_ID_, ENGINE_VERSION_, APP_VERSION_)
values (#{id, jdbcType=VARCHAR},
1,
#{category, jdbcType=VARCHAR},
......@@ -22,11 +22,12 @@
#{isGraphicalNotationDefined, jdbcType=BOOLEAN},
#{suspensionState, jdbcType=INTEGER},
#{tenantId, jdbcType=VARCHAR},
#{engineVersion, jdbcType=VARCHAR})
#{engineVersion, jdbcType=VARCHAR},
#{appVersion, jdbcType=INTEGER})
</insert>
<insert id="bulkInsertProcessDefinition" parameterType="java.util.List">
INSERT INTO ${prefix}ACT_RE_PROCDEF(ID_, REV_, CATEGORY_, NAME_, KEY_, VERSION_, DEPLOYMENT_ID_, RESOURCE_NAME_, DGRM_RESOURCE_NAME_, DESCRIPTION_, HAS_START_FORM_KEY_, HAS_GRAPHICAL_NOTATION_ , SUSPENSION_STATE_, TENANT_ID_, ENGINE_VERSION_)
INSERT INTO ${prefix}ACT_RE_PROCDEF(ID_, REV_, CATEGORY_, NAME_, KEY_, VERSION_, DEPLOYMENT_ID_, RESOURCE_NAME_, DGRM_RESOURCE_NAME_, DESCRIPTION_, HAS_START_FORM_KEY_, HAS_GRAPHICAL_NOTATION_ , SUSPENSION_STATE_, TENANT_ID_, ENGINE_VERSION_, APP_VERSION_)
VALUES
<foreach collection="list" item="processDefinition" index="index" separator=",">
(#{processDefinition.id, jdbcType=VARCHAR},
......@@ -43,7 +44,8 @@
#{processDefinition.isGraphicalNotationDefined, jdbcType=BOOLEAN},
#{processDefinition.suspensionState, jdbcType=INTEGER},
#{processDefinition.tenantId, jdbcType=VARCHAR},
#{processDefinition.engineVersion, jdbcType=VARCHAR})
#{processDefinition.engineVersion, jdbcType=VARCHAR},
#{processDefinition.appVersion, jdbcType=INTEGER})
</foreach>
</insert>
......@@ -117,6 +119,7 @@
<result property="isGraphicalNotationDefined" column="HAS_GRAPHICAL_NOTATION_" jdbcType="BOOLEAN" />
<result property="suspensionState" column="SUSPENSION_STATE_" jdbcType="INTEGER"/>
<result property="engineVersion" column="ENGINE_VERSION_" jdbcType="VARCHAR" />
<result property="appVersion" column="APP_VERSION_" jdbcType="INTEGER" />
</resultMap>
<!-- PROCESSDEFINITION SELECT -->
......
update ACT_GE_PROPERTY set VALUE_ = '7.1.0.0' where NAME_ = 'schema.version';
alter table ACT_RE_DEPLOYMENT add column VERSION_ integer set default 1;
alter table ACT_RE_DEPLOYMENT add column PROJECT_RELEASE_VERSION_ varchar(255);
update ACT_GE_PROPERTY set VALUE_ = '7.1.0-M6' where NAME_ = 'schema.version';
alter table ACT_RE_PROCDEF add column APP_VERSION_ integer;
alter table ACT_RU_TASK add column APP_VERSION_ integer;
alter table ACT_RU_EXECUTION add column APP_VERSION_ integer;
update ACT_GE_PROPERTY set VALUE_ = '7.1.0.0' where NAME_ = 'schema.version';
alter table ACT_RE_DEPLOYMENT add column VERSION_ integer;
alter table ACT_RE_DEPLOYMENT add column VERSION_ integer set default 1;
alter table ACT_RE_DEPLOYMENT add column PROJECT_RELEASE_VERSION_ varchar(255);
......
update ACT_GE_PROPERTY set VALUE_ = '7.1.0-M6' where NAME_ = 'schema.version';
alter table ACT_RE_PROCDEF add column APP_VERSION_ integer;
alter table ACT_RU_TASK add column APP_VERSION_ integer;
alter table ACT_RU_EXECUTION add column APP_VERSION_ integer;
/* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
......@@ -21,7 +21,7 @@ import org.activiti.engine.management.TableMetaData;
/**
* Test case for the various operations of the {@link ManagementService}
*
*
*/
......@@ -44,10 +44,10 @@ public class ManagementServiceTest extends PluggableActivitiTestCase {
public void testGetTableMetaData() {
String tablePrefix = processEngineConfiguration.getDatabaseTablePrefix();
TableMetaData tableMetaData = managementService.getTableMetaData(tablePrefix+"ACT_RU_TASK");
assertEquals(tableMetaData.getColumnNames().size(), tableMetaData.getColumnTypes().size());
assertEquals(20, tableMetaData.getColumnNames().size());
assertEquals(21, tableMetaData.getColumnNames().size());
int assigneeIndex = tableMetaData.getColumnNames().indexOf("ASSIGNEE_");
int createTimeIndex = tableMetaData.getColumnNames().indexOf("CREATE_TIME_");
......
package org.activiti.spring.boot.process;
import java.util.List;
import java.util.stream.Collectors;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.catchThrowable;
import static org.mockito.Mockito.spy;
......@@ -44,10 +47,10 @@ public class ProcessRuntimeIT {
private static final String CATEGORIZE_PROCESS = "categorizeProcess";
private static final String CATEGORIZE_HUMAN_PROCESS = "categorizeHumanProcess";
private static final String ONE_STEP_PROCESS = "OneStepProcess";
private static final String SUB_PROCESS = "subProcess";
private static final String SUPER_PROCESS = "superProcess";
@Autowired
private ProcessRuntime processRuntime;
......@@ -74,20 +77,20 @@ public class ProcessRuntimeIT {
@Autowired
private APIVariableInstanceConverter variableInstanceConverter;
@Autowired
ProcessVariablesPayloadValidator processVariablesValidator;
@Autowired
private ProcessRuntimeConfiguration configuration;
@Autowired
private ApplicationEventPublisher applicationEventPublisher;
private ApplicationEventPublisher eventPublisher;
private ProcessRuntime processRuntimeMock;
private ProcessAdminRuntime processAdminRuntimeMock;
@Autowired
......@@ -101,7 +104,7 @@ public class ProcessRuntimeIT {
@Before
public void init() {
eventPublisher = spy(applicationEventPublisher);
processRuntimeMock = spy(new ProcessRuntimeImpl(repositoryService,
processDefinitionConverter,
runtimeService,
......@@ -563,7 +566,7 @@ public class ProcessRuntimeIT {
assertThat(deletedProcessInstance.getStatus()).isEqualTo(ProcessInstance.ProcessInstanceStatus.DELETED);
}
@Test
public void getSubprocesses() {
......@@ -571,7 +574,7 @@ public class ProcessRuntimeIT {
Page<ProcessInstance> processInstancePage;
ProcessInstance parentProcess,subProcess;
//given
// start a process with a business key to check filters
parentProcess=processRuntime.start(ProcessPayloadBuilder.start()
......@@ -592,29 +595,29 @@ public class ProcessRuntimeIT {
assertThat( processInstancePage.getContent().get(0).getProcessDefinitionKey()).isEqualTo(SUPER_PROCESS);
assertThat( processInstancePage.getContent().get(1).getProcessDefinitionKey()).isEqualTo(SUB_PROCESS);
//Check that parentProcess has 1 subprocess
processInstancePage = processRuntime.processInstances(Pageable.of(0,
50),
ProcessPayloadBuilder
.subprocesses(parentProcess.getId()));
assertThat(processInstancePage).isNotNull();
assertThat(processInstancePage.getContent()).hasSize(1);
subProcess=processInstancePage.getContent().get(0);
assertThat(subProcess.getProcessDefinitionKey()).isEqualTo(SUB_PROCESS);
assertThat(subProcess.getParentId()).isEqualTo(parentProcess.getId());
assertThat(subProcess.getProcessDefinitionVersion()).isEqualTo(1);
processRuntime.delete(ProcessPayloadBuilder.delete(subProcess));
processRuntime.delete(ProcessPayloadBuilder.delete(parentProcess));
}
......@@ -634,9 +637,9 @@ public class ProcessRuntimeIT {
assertThat(processInstancePage).isNotNull();
assertThat(processInstancePage.getContent()).hasSize(1);
assertThat(processInstancePage.getContent().get(0).getProcessDefinitionKey()).isEqualTo("processWithSignalStart1");
verify(eventPublisher).publishEvent(signalPayload);
processRuntimeMock.delete(ProcessPayloadBuilder.delete(processInstancePage.getContent().get(0).getId()));
}
......@@ -659,4 +662,33 @@ public class ProcessRuntimeIT {
processAdminRuntimeMock.delete(ProcessPayloadBuilder.delete(processInstancePage.getContent().get(0).getId()));
}
@Test
public void should_processInstanceAlwaysHaveAppVersion(){
securityUtil.logInAs("user");
ProcessInstance processInstance = processRuntime.start(ProcessPayloadBuilder.start()
.withProcessDefinitionKey(SUPER_PROCESS)
.build());
assertThat(processInstance.getAppVersion()).isEqualTo("1");
}
@Test
public void should_processDefinitionAlwaysHaveAppVersion(){
securityUtil.logInAs("user");
Page<ProcessDefinition> processDefinitionPage = processRuntime.processDefinitions(Pageable.of(0,
50));
assertThat(processDefinitionPage.getContent()).isNotEmpty();
List<ProcessDefinition> processDefinitions = processDefinitionPage.getContent().stream()
.filter(c -> c.getKey().equals(SUPER_PROCESS))
.collect(Collectors.toList());
assertThat(processDefinitions).hasSize(1);
ProcessDefinition result = processDefinitions.get(0);
assertThat(result.getAppVersion()).isEqualTo("1");
}
}
package org.activiti.spring.boot.process;
import org.activiti.api.process.model.ProcessInstance;
import org.activiti.api.process.model.builders.ProcessPayloadBuilder;
import org.activiti.api.process.runtime.ProcessRuntime;
import org.activiti.api.runtime.shared.query.Page;
import org.activiti.api.runtime.shared.query.Pageable;
import org.activiti.api.task.model.Task;
import org.activiti.api.task.model.builders.TaskPayloadBuilder;
import org.activiti.api.task.runtime.TaskRuntime;
import org.activiti.spring.boot.security.util.SecurityUtil;
import org.activiti.spring.boot.test.util.ProcessCleanUpUtil;
import org.activiti.spring.boot.test.util.TaskCleanUpUtil;
import org.junit.After;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
import static org.assertj.core.api.Assertions.assertThat;
@RunWith(SpringRunner.class)
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.NONE)
public class ProcessRuntimeTasksIT {
private static final String SINGLE_TASK_PROCESS = "SingleTaskProcess";
@Autowired
private ProcessRuntime processRuntime;
@Autowired
private TaskRuntime taskRuntime;
@Autowired
private SecurityUtil securityUtil;
@Autowired
private ProcessCleanUpUtil processCleanUpUtil;
@Autowired
private TaskCleanUpUtil taskCleanUpUtil;
@After
public void cleanUp() {
processCleanUpUtil.cleanUpWithAdmin();
taskCleanUpUtil.cleanUpWithAdmin();
}
@Test
public void should_taskAlwaysHaveAppVersion() {
securityUtil.logInAs("garth");
ProcessInstance processInstance = processRuntime.start(ProcessPayloadBuilder.start()
.withProcessDefinitionKey(SINGLE_TASK_PROCESS)
.build());
Page<Task> tasks = taskRuntime.tasks(Pageable.of(0, 50),
TaskPayloadBuilder
.tasks()
.withProcessInstanceId(processInstance.getId())
.build());
assertThat(tasks.getContent()).hasSize(1);
Task result = tasks.getContent().get(0);
assertThat(result.getName()).isEqualTo("my-task");
assertThat(result.getAppVersion()).isEqualTo("1");
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册