mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-31 17:39:05 +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:
@@ -664,10 +664,12 @@ public class ActivitiWorkflowEngine extends BPMEngine implements WorkflowEngine
|
||||
private String getFormKey(TaskDefinition taskDefinition)
|
||||
{
|
||||
TaskFormHandler handler = taskDefinition.getTaskFormHandler();
|
||||
// We cast to DefaultTaskFormHandler since we do not configure our own
|
||||
if(handler != null && handler instanceof DefaultTaskFormHandler)
|
||||
{
|
||||
// We cast to DefaultTaskFormHandler since we do not configure our own
|
||||
return ((DefaultTaskFormHandler)handler).getFormKey();
|
||||
// As of Activiti 5.11, form-key is an expression. For alfresco-usecases, we're the expression-text
|
||||
// as is, as this will ALWAYS be a literal string, containing pointer to task-type.
|
||||
return ((DefaultTaskFormHandler)handler).getFormKey().getExpressionText();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
@@ -1399,6 +1401,9 @@ public class ActivitiWorkflowEngine extends BPMEngine implements WorkflowEngine
|
||||
taskService.setAssignee(localTaskId, currentUserName);
|
||||
// Also update pojo used to set the outcome, this will read assignee as wel
|
||||
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);
|
||||
|
@@ -301,4 +301,10 @@ public class AlfrescoBpmnParseListener implements BpmnParseListener
|
||||
ScopeImpl scopeElement, ActivityImpl nestedActivity) {
|
||||
// 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.jobexecutor.JobHandler;
|
||||
import org.activiti.engine.impl.persistence.entity.ExecutionEntity;
|
||||
import org.activiti.engine.impl.persistence.entity.JobEntity;
|
||||
import org.alfresco.model.ContentModel;
|
||||
import org.alfresco.repo.security.authentication.AuthenticationUtil;
|
||||
import org.alfresco.repo.security.authentication.AuthenticationUtil.RunAsWork;
|
||||
@@ -50,7 +51,7 @@ public class AuthenticatedAsyncJobHandler implements JobHandler
|
||||
}
|
||||
|
||||
@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)
|
||||
{
|
||||
// Get initiator
|
||||
@@ -80,7 +81,7 @@ public class AuthenticatedAsyncJobHandler implements JobHandler
|
||||
@SuppressWarnings("synthetic-access")
|
||||
public Void doWork() throws Exception
|
||||
{
|
||||
wrappedHandler.execute(configuration, execution, commandContext);
|
||||
wrappedHandler.execute(job, configuration, execution, commandContext);
|
||||
return null;
|
||||
}
|
||||
}, userName);
|
||||
|
@@ -23,6 +23,7 @@ import org.activiti.engine.impl.TaskQueryImpl;
|
||||
import org.activiti.engine.impl.interceptor.CommandContext;
|
||||
import org.activiti.engine.impl.jobexecutor.JobHandler;
|
||||
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.task.Task;
|
||||
import org.alfresco.repo.security.authentication.AuthenticationUtil;
|
||||
@@ -53,7 +54,7 @@ public class AuthenticatedTimerJobHandler implements JobHandler
|
||||
}
|
||||
|
||||
@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)
|
||||
{
|
||||
String userName = null;
|
||||
@@ -88,7 +89,7 @@ public class AuthenticatedTimerJobHandler implements JobHandler
|
||||
@SuppressWarnings("synthetic-access")
|
||||
public Void doWork() throws Exception
|
||||
{
|
||||
wrappedHandler.execute(configuration, execution, commandContext);
|
||||
wrappedHandler.execute(job, configuration, execution, commandContext);
|
||||
return null;
|
||||
}
|
||||
}, userName);
|
||||
|
Reference in New Issue
Block a user