com.github.dynamicextensionsalfresco.workflow.WorkflowDefinitionRegistrar Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of alfresco-integration Show documentation
Show all versions of alfresco-integration Show documentation
Adds an OSGi container to alfresco repository supporting dynamic code reloading, classpath isolation and a bunch of other useful features
package com.github.dynamicextensionsalfresco.workflow;
import com.github.dynamicextensionsalfresco.resources.BootstrapService;
import com.github.dynamicextensionsalfresco.resources.ContentCompareStrategy;
import com.github.dynamicextensionsalfresco.resources.ResourceHelper;
import com.google.common.collect.ImmutableMap;
import org.alfresco.model.ContentModel;
import org.alfresco.repo.content.MimetypeMap;
import org.alfresco.repo.dictionary.RepositoryLocation;
import org.alfresco.repo.security.authentication.AuthenticationUtil;
import org.alfresco.repo.transaction.RetryingTransactionHelper;
import org.alfresco.repo.workflow.WorkflowModel;
import org.alfresco.service.cmr.repository.NodeRef;
import org.alfresco.service.cmr.repository.NodeService;
import org.alfresco.service.namespace.QName;
import org.alfresco.service.transaction.TransactionService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.io.Resource;
import java.io.Serializable;
import java.util.Map;
import static org.alfresco.repo.security.authentication.AuthenticationUtil.runAs;
/**
* Service that inspect the {@link WorkflowDefinitionRegistrar#workflowLocationPattern} to find workflow definitions and
* stores them in the Data Dictionary to enable update detection.
*
* Know issue: Alfresco has policies in place to deploy workflow definitions from the Data Dictionary / Workflow Definitions
* folder. However these show up as (Nameless deployment) in the Activiti admin console.
*
* @author Laurent Van der Linden
*/
public class WorkflowDefinitionRegistrar implements InitializingBean {
private static final String workflowLocationPattern = "osgibundle:/META-INF/alfresco/workflows/*.bpmn20.xml";
private final static Logger logger = LoggerFactory.getLogger(WorkflowDefinitionRegistrar.class);
@Autowired
protected RepositoryLocation customWorkflowDefsRepositoryLocation;
@Autowired
protected ResourceHelper resourceHelper;
@Autowired
protected BootstrapService bootstrapService;
@Autowired
protected NodeService nodeService;
@Autowired
protected TransactionService transactionService;
@Override
public void afterPropertiesSet() throws Exception {
runAs(new AuthenticationUtil.RunAsWork
© 2015 - 2025 Weber Informatics LLC | Privacy Policy