mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-10-08 14:51:49 +00:00
Merged 5.0.N (5.0.3) to HEAD (5.1)
111249: Merged V4.2-BUG-FIX (4.2.6) to 5.0.N (5.0.3) 111099: Merged V4.2.5 (4.2.5) to V4.2-BUG-FIX (4.2.6) 110999: Merged DEV to V4.2.5 (4.2.5) MNT-10537 : BPM Models are filtered for CMIS getTypeDefinition - As for DictionaryModelType we should destroy dictionary when new model is deployed from classpath. - Unit test added. git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@111331 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -40,6 +40,7 @@ import org.alfresco.repo.transaction.AlfrescoTransactionSupport;
|
||||
import org.alfresco.repo.transaction.AlfrescoTransactionSupport.TxnReadState;
|
||||
import org.alfresco.repo.transaction.RetryingTransactionHelper;
|
||||
import org.alfresco.repo.transaction.RetryingTransactionHelper.RetryingTransactionCallback;
|
||||
import org.alfresco.repo.transaction.TransactionListenerAdapter;
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
import org.alfresco.service.cmr.repository.NodeService;
|
||||
import org.alfresco.service.cmr.repository.StoreRef;
|
||||
@@ -94,6 +95,8 @@ public class WorkflowDeployer extends AbstractLifecycleBean
|
||||
private SearchService searchService;
|
||||
private RepositoryLocation repoWorkflowDefsLocation;
|
||||
|
||||
private WorkflowDeployerTransactionListener workflowDeployerTransactionListener = new WorkflowDeployerTransactionListener();
|
||||
|
||||
public final static String CRITERIA_ALL = "/*"; // immediate children only
|
||||
public final static String defaultSubtypeOfWorkflowDefinitionType = "subtypeOf('bpm:workflowDefinition')";
|
||||
|
||||
@@ -261,6 +264,9 @@ public class WorkflowDeployer extends AbstractLifecycleBean
|
||||
dictionaryBootstrap.setModels(models);
|
||||
dictionaryBootstrap.setLabels(resourceBundles);
|
||||
dictionaryBootstrap.bootstrap(); // also registers with dictionary
|
||||
|
||||
// MNT-10537 fix, since new model was deployed we need to destroy dictionary to force lazy re-init
|
||||
AlfrescoTransactionSupport.bindListener(this.workflowDeployerTransactionListener);
|
||||
}
|
||||
|
||||
// bootstrap the workflow definitions (from classpath)
|
||||
@@ -520,4 +526,40 @@ public class WorkflowDeployer extends AbstractLifecycleBean
|
||||
// NOOP
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Workflow deployer transaction listener class.
|
||||
*/
|
||||
public class WorkflowDeployerTransactionListener extends TransactionListenerAdapter
|
||||
{
|
||||
@Override
|
||||
public void afterCommit()
|
||||
{
|
||||
RetryingTransactionCallback<Void> work = new RetryingTransactionCallback<Void>()
|
||||
{
|
||||
public Void execute() throws Throwable
|
||||
{
|
||||
AuthenticationUtil.runAs(new RunAsWork<Object>()
|
||||
{
|
||||
public Object doWork()
|
||||
{
|
||||
// invalidate - to force lazy re-init
|
||||
dictionaryDAO.destroy();
|
||||
|
||||
if (logger.isTraceEnabled())
|
||||
{
|
||||
logger.trace("Workflow deployer afterCommit: Dictionary destroyed ["+AlfrescoTransactionSupport.getTransactionId()+"]");
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}, AuthenticationUtil.getSystemUserName());
|
||||
|
||||
return null;
|
||||
}
|
||||
};
|
||||
|
||||
transactionService.getRetryingTransactionHelper().doInTransaction(work, true, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user