mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-24 17:32:48 +00:00
Merged V2.1 to HEAD
6368: Change home folder provider to use User Homes and not company home 6370: Fixed BDE-50: Empty line in the clean_tomcat.sh script file 6373: Working copy nodes don't get sys:temporary aspect applied. Node archival ignores working copy nodes. 6375: Fixed AR-1154: Benchmark override sample 6377: Documentation updates. 6379: Moved old installer files. 6381: Fixed AR-782: Early detection of property conversion issues 6382: Fixed AR-1414: Serializable property values are immediately disconnected from the client's instance. 6384: Fix AR-1642 : Pooled task is not auto-assigned when task is completed by user, but user has not first 'taken ownership' 6385: AR-1621 Workflow bootstrap is not sensitive to system read-only mode Resolved conflicted state of 'root\projects\repository\source\java\org\alfresco\repo\workflow\WorkflowInterpreter.java' git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@6726 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -63,6 +63,7 @@ public class WorkflowDeployer extends AbstractLifecycleBean
|
||||
public static final String REDEPLOY = "redeploy";
|
||||
|
||||
// Dependencies
|
||||
private boolean allowWrite = true;
|
||||
private TransactionService transactionService;
|
||||
private WorkflowService workflowService;
|
||||
private AuthenticationComponent authenticationComponent;
|
||||
@@ -72,6 +73,16 @@ public class WorkflowDeployer extends AbstractLifecycleBean
|
||||
private List<String> resourceBundles = new ArrayList<String>();
|
||||
|
||||
|
||||
/**
|
||||
* Set whether we write or not
|
||||
*
|
||||
* @param write true (default) if the import must go ahead, otherwise no import will occur
|
||||
*/
|
||||
public void setAllowWrite(boolean write)
|
||||
{
|
||||
this.allowWrite = write;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the Transaction Service
|
||||
*
|
||||
@@ -159,7 +170,7 @@ public class WorkflowDeployer extends AbstractLifecycleBean
|
||||
{
|
||||
throw new ImporterException("Workflow Service must be provided");
|
||||
}
|
||||
|
||||
|
||||
UserTransaction userTransaction = transactionService.getUserTransaction();
|
||||
authenticationComponent.setSystemUserAsCurrentUser();
|
||||
|
||||
@@ -200,16 +211,24 @@ public class WorkflowDeployer extends AbstractLifecycleBean
|
||||
ClassPathResource workflowResource = new ClassPathResource(location);
|
||||
|
||||
// deploy workflow definition
|
||||
if (!redeploy && workflowService.isDefinitionDeployed(engineId, workflowResource.getInputStream(), mimetype))
|
||||
if (!allowWrite)
|
||||
{
|
||||
if (logger.isDebugEnabled())
|
||||
logger.debug("Workflow deployer: Definition '" + location + "' already deployed");
|
||||
// we're in read-only node
|
||||
logger.warn("Repository is in read-only mode; not deploying workflow " + location);
|
||||
}
|
||||
else
|
||||
{
|
||||
WorkflowDeployment deployment = workflowService.deployDefinition(engineId, workflowResource.getInputStream(), mimetype);
|
||||
if (logger.isInfoEnabled())
|
||||
logger.info("Workflow deployer: Deployed process definition '" + deployment.definition.title + "' (version " + deployment.definition.version + ") from '" + location + "' with " + deployment.problems.length + " problems");
|
||||
if (!redeploy && workflowService.isDefinitionDeployed(engineId, workflowResource.getInputStream(), mimetype))
|
||||
{
|
||||
if (logger.isDebugEnabled())
|
||||
logger.debug("Workflow deployer: Definition '" + location + "' already deployed");
|
||||
}
|
||||
else
|
||||
{
|
||||
WorkflowDeployment deployment = workflowService.deployDefinition(engineId, workflowResource.getInputStream(), mimetype);
|
||||
if (logger.isInfoEnabled())
|
||||
logger.info("Workflow deployer: Deployed process definition '" + deployment.definition.title + "' (version " + deployment.definition.version + ") from '" + location + "' with " + deployment.problems.length + " problems");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -114,8 +114,11 @@ public class WorkflowInterpreter extends BaseInterpreter
|
||||
{
|
||||
setCurrentUserName(BaseInterpreter.DEFAULT_ADMIN);
|
||||
|
||||
interpretCommand("var bpm:package package 1");
|
||||
interpretCommand("var bpm:assignee person admin");
|
||||
if (!transactionService.isReadOnly())
|
||||
{
|
||||
interpretCommand("var bpm:package package 1");
|
||||
interpretCommand("var bpm:assignee person admin");
|
||||
}
|
||||
|
||||
setCurrentUserName(null);
|
||||
}
|
||||
|
@@ -28,6 +28,7 @@ import java.io.Serializable;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import org.alfresco.repo.security.authentication.AuthenticationUtil;
|
||||
import org.alfresco.repo.workflow.WorkflowModel;
|
||||
import org.alfresco.service.cmr.workflow.WorkflowException;
|
||||
import org.alfresco.service.namespace.QName;
|
||||
@@ -110,6 +111,12 @@ public class WorkflowTaskInstance extends TaskInstance
|
||||
@Override
|
||||
public void end(Transition transition)
|
||||
{
|
||||
// Force assignment of task if transition is taken, but no owner has yet been assigned
|
||||
if (actorId == null)
|
||||
{
|
||||
actorId = AuthenticationUtil.getCurrentUserName();
|
||||
}
|
||||
|
||||
// Set task properties on completion of task
|
||||
// NOTE: Set properties first, so they're available during the submission of
|
||||
// task variables to the process context
|
||||
|
Reference in New Issue
Block a user