mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Merged BRANCHES/DEV/FRED/ACTIVITI-UPGRADE to HEAD:
44909: Creating branch for activiti 5.11 upgrade 44913: Upgraded to activiti 5.11 - to be validated 45025: Removing obsolete libraries 45026: Preventing optimistic locking during task-update sequence git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@45028 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -175,6 +175,7 @@
|
|||||||
<ref bean="patch.db-V4.2-upgrade-to-activiti-5.10" />
|
<ref bean="patch.db-V4.2-upgrade-to-activiti-5.10" />
|
||||||
<ref bean="patch.db-V4.1-rename-constraint-activiti" />
|
<ref bean="patch.db-V4.1-rename-constraint-activiti" />
|
||||||
<ref bean="patch.db-V4.2-add-activti-index-historic-activity" />
|
<ref bean="patch.db-V4.2-add-activti-index-historic-activity" />
|
||||||
|
<ref bean="patch.db-V4.2-upgrade-to-activiti-5.11" />
|
||||||
</list>
|
</list>
|
||||||
</property>
|
</property>
|
||||||
</bean>
|
</bean>
|
||||||
|
@@ -0,0 +1,122 @@
|
|||||||
|
--
|
||||||
|
-- Title: Upgraded Activiti tables to 5.11 version
|
||||||
|
-- Database: MySQL
|
||||||
|
-- Since: V4.1 Schema 6023
|
||||||
|
-- Author: Frederik Heremans
|
||||||
|
--
|
||||||
|
-- Please contact support@alfresco.com if you need assistance with the upgrade.
|
||||||
|
--
|
||||||
|
-- Upgraded Activiti tables to 5.11 version
|
||||||
|
|
||||||
|
alter table ACT_RE_PROCDEF
|
||||||
|
MODIFY KEY_ varchar(255) not null;
|
||||||
|
|
||||||
|
alter table ACT_RE_PROCDEF
|
||||||
|
MODIFY VERSION_ integer not null;
|
||||||
|
|
||||||
|
-- http://jira.codehaus.org/browse/ACT-1424
|
||||||
|
alter table ACT_RU_JOB
|
||||||
|
MODIFY LOCK_EXP_TIME_ timestamp null;
|
||||||
|
|
||||||
|
alter table ACT_RE_DEPLOYMENT
|
||||||
|
add CATEGORY_ varchar(255);
|
||||||
|
|
||||||
|
alter table ACT_RE_PROCDEF
|
||||||
|
add DESCRIPTION_ varchar(4000);
|
||||||
|
|
||||||
|
alter table ACT_RU_TASK
|
||||||
|
add SUSPENSION_STATE_ integer;
|
||||||
|
|
||||||
|
update ACT_RU_TASK set SUSPENSION_STATE_ = 1;
|
||||||
|
|
||||||
|
alter table ACT_RU_EXECUTION
|
||||||
|
add constraint ACT_FK_EXE_PROCDEF
|
||||||
|
foreign key (PROC_DEF_ID_)
|
||||||
|
references ACT_RE_PROCDEF (ID_);
|
||||||
|
|
||||||
|
create table ACT_RE_MODEL (
|
||||||
|
ID_ varchar(64) not null,
|
||||||
|
REV_ integer,
|
||||||
|
NAME_ varchar(255),
|
||||||
|
KEY_ varchar(255),
|
||||||
|
CATEGORY_ varchar(255),
|
||||||
|
CREATE_TIME_ timestamp null,
|
||||||
|
LAST_UPDATE_TIME_ timestamp null,
|
||||||
|
VERSION_ integer,
|
||||||
|
META_INFO_ varchar(4000),
|
||||||
|
DEPLOYMENT_ID_ varchar(64),
|
||||||
|
EDITOR_SOURCE_VALUE_ID_ varchar(64),
|
||||||
|
EDITOR_SOURCE_EXTRA_VALUE_ID_ varchar(64),
|
||||||
|
primary key (ID_)
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin;
|
||||||
|
|
||||||
|
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_)
|
||||||
|
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_);
|
||||||
|
|
||||||
|
delete from ACT_GE_PROPERTY where NAME_ = 'historyLevel';
|
||||||
|
|
||||||
|
alter table ACT_RU_JOB
|
||||||
|
add PROC_DEF_ID_ varchar(64);
|
||||||
|
|
||||||
|
update ACT_GE_PROPERTY set VALUE_ = '5.11' where NAME_ = 'schema.version';
|
||||||
|
|
||||||
|
create table ACT_HI_VARINST (
|
||||||
|
ID_ varchar(64) not null,
|
||||||
|
PROC_INST_ID_ varchar(64),
|
||||||
|
EXECUTION_ID_ varchar(64),
|
||||||
|
TASK_ID_ varchar(64),
|
||||||
|
NAME_ varchar(255) not null,
|
||||||
|
VAR_TYPE_ varchar(100),
|
||||||
|
REV_ integer,
|
||||||
|
BYTEARRAY_ID_ varchar(64),
|
||||||
|
DOUBLE_ double,
|
||||||
|
LONG_ bigint,
|
||||||
|
TEXT_ varchar(4000),
|
||||||
|
TEXT2_ varchar(4000),
|
||||||
|
primary key (ID_)
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin;
|
||||||
|
|
||||||
|
create index ACT_IDX_HI_PROCVAR_PROC_INST on ACT_HI_VARINST(PROC_INST_ID_);
|
||||||
|
create index ACT_IDX_HI_PROCVAR_NAME_TYPE on ACT_HI_VARINST(NAME_, VAR_TYPE_);
|
||||||
|
|
||||||
|
alter table ACT_HI_ACTINST
|
||||||
|
add TASK_ID_ varchar(64);
|
||||||
|
|
||||||
|
alter table ACT_HI_ACTINST
|
||||||
|
add CALL_PROC_INST_ID_ varchar(64);
|
||||||
|
|
||||||
|
alter table ACT_HI_DETAIL
|
||||||
|
MODIFY PROC_INST_ID_ varchar(64) null;
|
||||||
|
|
||||||
|
alter table ACT_HI_DETAIL
|
||||||
|
MODIFY EXECUTION_ID_ varchar(64) null;
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Update engine properties table
|
||||||
|
--
|
||||||
|
UPDATE ACT_GE_PROPERTY SET VALUE_ = '5.11' WHERE NAME_ = 'schema.version';
|
||||||
|
UPDATE ACT_GE_PROPERTY SET VALUE_ = CONCAT(VALUE_,' upgrade(5.11)') WHERE NAME_ = 'schema.history';
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Record script finish
|
||||||
|
--
|
||||||
|
DELETE FROM alf_applied_patch WHERE id = 'patch.db-V4.2-upgrade-to-activiti-5.11';
|
||||||
|
INSERT INTO alf_applied_patch
|
||||||
|
(id, description, fixes_from_schema, fixes_to_schema, applied_to_schema, target_schema, applied_on_date, applied_to_server, was_executed, succeeded, report)
|
||||||
|
VALUES
|
||||||
|
(
|
||||||
|
'patch.db-V4.2-upgrade-to-activiti-5.11', 'Manually executed script upgrade V4.2: Upgraded Activiti tables to 5.11 version',
|
||||||
|
0, 5111, -1, 5112, null, 'UNKNOWN', ${TRUE}, ${TRUE}, 'Script completed'
|
||||||
|
);
|
@@ -0,0 +1,119 @@
|
|||||||
|
--
|
||||||
|
-- Title: Upgraded Activiti tables to 5.11 version
|
||||||
|
-- Database: Postgres
|
||||||
|
-- Since: V4.1 Schema 6023
|
||||||
|
-- Author: Frederik Heremans
|
||||||
|
--
|
||||||
|
-- Please contact support@alfresco.com if you need assistance with the upgrade.
|
||||||
|
--
|
||||||
|
-- Upgraded Activiti tables to 5.11 version
|
||||||
|
|
||||||
|
alter table ACT_RE_PROCDEF
|
||||||
|
alter column KEY_ set not null;
|
||||||
|
|
||||||
|
alter table ACT_RE_PROCDEF
|
||||||
|
alter column VERSION_ set not null;
|
||||||
|
|
||||||
|
alter table ACT_RE_DEPLOYMENT
|
||||||
|
add CATEGORY_ varchar(255);
|
||||||
|
|
||||||
|
alter table ACT_RE_PROCDEF
|
||||||
|
add DESCRIPTION_ varchar(4000);
|
||||||
|
|
||||||
|
alter table ACT_RU_EXECUTION
|
||||||
|
add constraint ACT_FK_EXE_PROCDEF
|
||||||
|
foreign key (PROC_DEF_ID_)
|
||||||
|
references ACT_RE_PROCDEF (ID_);
|
||||||
|
|
||||||
|
alter table ACT_RU_TASK
|
||||||
|
add SUSPENSION_STATE_ integer;
|
||||||
|
|
||||||
|
update ACT_RU_TASK set SUSPENSION_STATE_ = 1;
|
||||||
|
|
||||||
|
create table ACT_RE_MODEL (
|
||||||
|
ID_ varchar(64) not null,
|
||||||
|
REV_ integer,
|
||||||
|
NAME_ varchar(255),
|
||||||
|
KEY_ varchar(255),
|
||||||
|
CATEGORY_ varchar(255),
|
||||||
|
CREATE_TIME_ timestamp,
|
||||||
|
LAST_UPDATE_TIME_ timestamp,
|
||||||
|
VERSION_ integer,
|
||||||
|
META_INFO_ varchar(4000),
|
||||||
|
DEPLOYMENT_ID_ varchar(64),
|
||||||
|
EDITOR_SOURCE_VALUE_ID_ varchar(64),
|
||||||
|
EDITOR_SOURCE_EXTRA_VALUE_ID_ varchar(64),
|
||||||
|
primary key (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_)
|
||||||
|
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_)
|
||||||
|
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_);
|
||||||
|
|
||||||
|
delete from ACT_GE_PROPERTY where NAME_ = 'historyLevel';
|
||||||
|
|
||||||
|
alter table ACT_RU_JOB
|
||||||
|
add PROC_DEF_ID_ varchar(64);
|
||||||
|
|
||||||
|
create table ACT_HI_VARINST (
|
||||||
|
ID_ varchar(64) not null,
|
||||||
|
PROC_INST_ID_ varchar(64),
|
||||||
|
EXECUTION_ID_ varchar(64),
|
||||||
|
TASK_ID_ varchar(64),
|
||||||
|
NAME_ varchar(255) not null,
|
||||||
|
VAR_TYPE_ varchar(100),
|
||||||
|
REV_ integer,
|
||||||
|
BYTEARRAY_ID_ varchar(64),
|
||||||
|
DOUBLE_ double precision,
|
||||||
|
LONG_ bigint,
|
||||||
|
TEXT_ varchar(4000),
|
||||||
|
TEXT2_ varchar(4000),
|
||||||
|
primary key (ID_)
|
||||||
|
);
|
||||||
|
|
||||||
|
create index ACT_IDX_HI_PROCVAR_PROC_INST on ACT_HI_VARINST(PROC_INST_ID_);
|
||||||
|
create index ACT_IDX_HI_PROCVAR_NAME_TYPE on ACT_HI_VARINST(NAME_, VAR_TYPE_);
|
||||||
|
|
||||||
|
alter table ACT_HI_ACTINST
|
||||||
|
add column TASK_ID_ varchar(64);
|
||||||
|
|
||||||
|
alter table ACT_HI_ACTINST
|
||||||
|
add column CALL_PROC_INST_ID_ varchar(64);
|
||||||
|
|
||||||
|
alter table ACT_HI_DETAIL
|
||||||
|
alter column PROC_INST_ID_ drop not null;
|
||||||
|
|
||||||
|
alter table ACT_HI_DETAIL
|
||||||
|
alter column EXECUTION_ID_ drop not null;
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Update engine properties table
|
||||||
|
--
|
||||||
|
UPDATE ACT_GE_PROPERTY SET VALUE_ = '5.11' WHERE NAME_ = 'schema.version';
|
||||||
|
UPDATE ACT_GE_PROPERTY SET VALUE_ = CONCAT(VALUE_,' upgrade(5.11)') WHERE NAME_ = 'schema.history';
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Record script finish
|
||||||
|
--
|
||||||
|
DELETE FROM alf_applied_patch WHERE id = 'patch.db-V4.2-upgrade-to-activiti-5.11';
|
||||||
|
INSERT INTO alf_applied_patch
|
||||||
|
(id, description, fixes_from_schema, fixes_to_schema, applied_to_schema, target_schema, applied_on_date, applied_to_server, was_executed, succeeded, report)
|
||||||
|
VALUES
|
||||||
|
(
|
||||||
|
'patch.db-V4.2-upgrade-to-activiti-5.11', 'Manually executed script upgrade V4.2: Upgraded Activiti tables to 5.11 version',
|
||||||
|
0, 5111, -1, 5112, null, 'UNKNOWN', ${TRUE}, ${TRUE}, 'Script completed'
|
||||||
|
);
|
@@ -3441,4 +3441,15 @@
|
|||||||
</property>
|
</property>
|
||||||
</bean>
|
</bean>
|
||||||
|
|
||||||
|
<bean id="patch.db-V4.2-upgrade-to-activiti-5.11" class="org.alfresco.repo.admin.patch.impl.SchemaUpgradeScriptPatch" parent="basePatch">
|
||||||
|
<property name="id"><value>patch.db-V4.2-upgrade-to-activiti-5.11</value></property>
|
||||||
|
<property name="description"><value>patch.upgradeToActiviti5-11.description</value></property>
|
||||||
|
<property name="fixesFromSchema"><value>0</value></property>
|
||||||
|
<property name="fixesToSchema"><value>6022</value></property>
|
||||||
|
<property name="targetSchema"><value>6023</value></property>
|
||||||
|
<property name="scriptUrl">
|
||||||
|
<value>classpath:alfresco/dbscripts/upgrade/4.2/${db.script.dialect}/activiti-upgrade-5-11.sql</value>
|
||||||
|
</property>
|
||||||
|
</bean>
|
||||||
|
|
||||||
</beans>
|
</beans>
|
||||||
|
@@ -23,4 +23,4 @@ version.build=r@scm-revision@-b@build-number@
|
|||||||
|
|
||||||
# Schema number
|
# Schema number
|
||||||
|
|
||||||
version.schema=6022
|
version.schema=6023
|
||||||
|
@@ -664,10 +664,12 @@ public class ActivitiWorkflowEngine extends BPMEngine implements WorkflowEngine
|
|||||||
private String getFormKey(TaskDefinition taskDefinition)
|
private String getFormKey(TaskDefinition taskDefinition)
|
||||||
{
|
{
|
||||||
TaskFormHandler handler = taskDefinition.getTaskFormHandler();
|
TaskFormHandler handler = taskDefinition.getTaskFormHandler();
|
||||||
|
// We cast to DefaultTaskFormHandler since we do not configure our own
|
||||||
if(handler != null && handler instanceof DefaultTaskFormHandler)
|
if(handler != null && handler instanceof DefaultTaskFormHandler)
|
||||||
{
|
{
|
||||||
// We cast to DefaultTaskFormHandler since we do not configure our own
|
// As of Activiti 5.11, form-key is an expression. For alfresco-usecases, we're the expression-text
|
||||||
return ((DefaultTaskFormHandler)handler).getFormKey();
|
// as is, as this will ALWAYS be a literal string, containing pointer to task-type.
|
||||||
|
return ((DefaultTaskFormHandler)handler).getFormKey().getExpressionText();
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@@ -1399,6 +1401,9 @@ public class ActivitiWorkflowEngine extends BPMEngine implements WorkflowEngine
|
|||||||
taskService.setAssignee(localTaskId, currentUserName);
|
taskService.setAssignee(localTaskId, currentUserName);
|
||||||
// Also update pojo used to set the outcome, this will read assignee as wel
|
// Also update pojo used to set the outcome, this will read assignee as wel
|
||||||
task.setAssignee(currentUserName);
|
task.setAssignee(currentUserName);
|
||||||
|
|
||||||
|
// Re-fetch the task-entity since it's revision has been updated by the setAssignee() call
|
||||||
|
task = taskService.createTaskQuery().taskId(localTaskId).singleResult();
|
||||||
}
|
}
|
||||||
|
|
||||||
setOutcome(task, transition);
|
setOutcome(task, transition);
|
||||||
|
@@ -301,4 +301,10 @@ public class AlfrescoBpmnParseListener implements BpmnParseListener
|
|||||||
ScopeImpl scopeElement, ActivityImpl nestedActivity) {
|
ScopeImpl scopeElement, ActivityImpl nestedActivity) {
|
||||||
// Nothing to do here
|
// Nothing to do here
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void parseBoundaryMessageEventDefinition(Element element, boolean interrupting,
|
||||||
|
ActivityImpl messageActivity)
|
||||||
|
{
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@@ -22,6 +22,7 @@ package org.alfresco.repo.workflow.activiti;
|
|||||||
import org.activiti.engine.impl.interceptor.CommandContext;
|
import org.activiti.engine.impl.interceptor.CommandContext;
|
||||||
import org.activiti.engine.impl.jobexecutor.JobHandler;
|
import org.activiti.engine.impl.jobexecutor.JobHandler;
|
||||||
import org.activiti.engine.impl.persistence.entity.ExecutionEntity;
|
import org.activiti.engine.impl.persistence.entity.ExecutionEntity;
|
||||||
|
import org.activiti.engine.impl.persistence.entity.JobEntity;
|
||||||
import org.alfresco.model.ContentModel;
|
import org.alfresco.model.ContentModel;
|
||||||
import org.alfresco.repo.security.authentication.AuthenticationUtil;
|
import org.alfresco.repo.security.authentication.AuthenticationUtil;
|
||||||
import org.alfresco.repo.security.authentication.AuthenticationUtil.RunAsWork;
|
import org.alfresco.repo.security.authentication.AuthenticationUtil.RunAsWork;
|
||||||
@@ -50,7 +51,7 @@ public class AuthenticatedAsyncJobHandler implements JobHandler
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void execute(final String configuration, final ExecutionEntity execution,
|
public void execute(final JobEntity job, final String configuration, final ExecutionEntity execution,
|
||||||
final CommandContext commandContext)
|
final CommandContext commandContext)
|
||||||
{
|
{
|
||||||
// Get initiator
|
// Get initiator
|
||||||
@@ -80,7 +81,7 @@ public class AuthenticatedAsyncJobHandler implements JobHandler
|
|||||||
@SuppressWarnings("synthetic-access")
|
@SuppressWarnings("synthetic-access")
|
||||||
public Void doWork() throws Exception
|
public Void doWork() throws Exception
|
||||||
{
|
{
|
||||||
wrappedHandler.execute(configuration, execution, commandContext);
|
wrappedHandler.execute(job, configuration, execution, commandContext);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}, userName);
|
}, userName);
|
||||||
|
@@ -23,6 +23,7 @@ import org.activiti.engine.impl.TaskQueryImpl;
|
|||||||
import org.activiti.engine.impl.interceptor.CommandContext;
|
import org.activiti.engine.impl.interceptor.CommandContext;
|
||||||
import org.activiti.engine.impl.jobexecutor.JobHandler;
|
import org.activiti.engine.impl.jobexecutor.JobHandler;
|
||||||
import org.activiti.engine.impl.persistence.entity.ExecutionEntity;
|
import org.activiti.engine.impl.persistence.entity.ExecutionEntity;
|
||||||
|
import org.activiti.engine.impl.persistence.entity.JobEntity;
|
||||||
import org.activiti.engine.impl.pvm.PvmActivity;
|
import org.activiti.engine.impl.pvm.PvmActivity;
|
||||||
import org.activiti.engine.task.Task;
|
import org.activiti.engine.task.Task;
|
||||||
import org.alfresco.repo.security.authentication.AuthenticationUtil;
|
import org.alfresco.repo.security.authentication.AuthenticationUtil;
|
||||||
@@ -53,7 +54,7 @@ public class AuthenticatedTimerJobHandler implements JobHandler
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void execute(final String configuration, final ExecutionEntity execution,
|
public void execute(final JobEntity job, final String configuration, final ExecutionEntity execution,
|
||||||
final CommandContext commandContext)
|
final CommandContext commandContext)
|
||||||
{
|
{
|
||||||
String userName = null;
|
String userName = null;
|
||||||
@@ -88,7 +89,7 @@ public class AuthenticatedTimerJobHandler implements JobHandler
|
|||||||
@SuppressWarnings("synthetic-access")
|
@SuppressWarnings("synthetic-access")
|
||||||
public Void doWork() throws Exception
|
public Void doWork() throws Exception
|
||||||
{
|
{
|
||||||
wrappedHandler.execute(configuration, execution, commandContext);
|
wrappedHandler.execute(job, configuration, execution, commandContext);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}, userName);
|
}, userName);
|
||||||
|
Reference in New Issue
Block a user