org.activiti.engine.impl.persistence.entity.IdentityLinkEntityManager Java Examples

The following examples show how to use org.activiti.engine.impl.persistence.entity.IdentityLinkEntityManager. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: AddIdentityLinkForProcessInstanceCmd.java    From activiti6-boot2 with Apache License 2.0 6 votes vote down vote up
public Void execute(CommandContext commandContext) {

    ExecutionEntityManager executionEntityManager = commandContext.getExecutionEntityManager();
    ExecutionEntity processInstance = executionEntityManager.findById(processInstanceId);

    if (processInstance == null) {
      throw new ActivitiObjectNotFoundException("Cannot find process instance with id " + processInstanceId, ExecutionEntity.class);
    }
    
    if (Activiti5Util.isActiviti5ProcessDefinitionId(commandContext, processInstance.getProcessDefinitionId())) {
      Activiti5CompatibilityHandler activiti5CompatibilityHandler = Activiti5Util.getActiviti5CompatibilityHandler(); 
      activiti5CompatibilityHandler.addIdentityLinkForProcessInstance(processInstanceId, userId, groupId, type);
      return null;
    }

    IdentityLinkEntityManager identityLinkEntityManager = commandContext.getIdentityLinkEntityManager();
    identityLinkEntityManager.addIdentityLink(processInstance, userId, groupId, type);
    commandContext.getHistoryManager().createProcessInstanceIdentityLinkComment(processInstanceId, userId, groupId, type, true);

    return null;

  }
 
Example #2
Source File: AbstractManager.java    From activiti6-boot2 with Apache License 2.0 4 votes vote down vote up
protected IdentityLinkEntityManager getIdentityLinkEntityManager() {
  return getProcessEngineConfiguration().getIdentityLinkEntityManager();
}
 
Example #3
Source File: ProcessEngineConfigurationImpl.java    From flowable-engine with Apache License 2.0 4 votes vote down vote up
protected void initSessionFactories() {
    if (sessionFactories == null) {
        sessionFactories = new HashMap<>();

        if (dbSqlSessionFactory == null) {
            dbSqlSessionFactory = new DbSqlSessionFactory();
        }
        dbSqlSessionFactory.setDatabaseType(databaseType);
        dbSqlSessionFactory.setIdGenerator(idGenerator);
        dbSqlSessionFactory.setSqlSessionFactory(sqlSessionFactory);
        dbSqlSessionFactory.setDbHistoryUsed(isDbHistoryUsed);
        dbSqlSessionFactory.setDatabaseTablePrefix(databaseTablePrefix);
        dbSqlSessionFactory.setTablePrefixIsSchema(tablePrefixIsSchema);
        dbSqlSessionFactory.setDatabaseCatalog(databaseCatalog);
        dbSqlSessionFactory.setDatabaseSchema(databaseSchema);
        dbSqlSessionFactory.setBulkInsertEnabled(isBulkInsertEnabled, databaseType);
        dbSqlSessionFactory.setMaxNrOfStatementsInBulkInsert(maxNrOfStatementsInBulkInsert);
        addSessionFactory(dbSqlSessionFactory);

        addSessionFactory(new GenericManagerFactory(AttachmentEntityManager.class));
        addSessionFactory(new GenericManagerFactory(CommentEntityManager.class));
        addSessionFactory(new GenericManagerFactory(DeadLetterJobEntityManager.class));
        addSessionFactory(new GenericManagerFactory(DeploymentEntityManager.class));
        addSessionFactory(new GenericManagerFactory(ModelEntityManager.class));
        addSessionFactory(new GenericManagerFactory(ExecutionEntityManager.class));
        addSessionFactory(new GenericManagerFactory(HistoricActivityInstanceEntityManager.class));
        addSessionFactory(new GenericManagerFactory(HistoricDetailEntityManager.class));
        addSessionFactory(new GenericManagerFactory(HistoricProcessInstanceEntityManager.class));
        addSessionFactory(new GenericManagerFactory(HistoricVariableInstanceEntityManager.class));
        addSessionFactory(new GenericManagerFactory(HistoricTaskInstanceEntityManager.class));
        addSessionFactory(new GenericManagerFactory(HistoricIdentityLinkEntityManager.class));
        addSessionFactory(new GenericManagerFactory(IdentityLinkEntityManager.class));
        addSessionFactory(new GenericManagerFactory(JobEntityManager.class));
        addSessionFactory(new GenericManagerFactory(ProcessDefinitionEntityManager.class));
        addSessionFactory(new GenericManagerFactory(ProcessDefinitionInfoEntityManager.class));
        addSessionFactory(new GenericManagerFactory(PropertyEntityManager.class));
        addSessionFactory(new GenericManagerFactory(ResourceEntityManager.class));
        addSessionFactory(new GenericManagerFactory(ByteArrayEntityManager.class));
        addSessionFactory(new GenericManagerFactory(SuspendedJobEntityManager.class));
        addSessionFactory(new GenericManagerFactory(TableDataManager.class));
        addSessionFactory(new GenericManagerFactory(TaskEntityManager.class));
        addSessionFactory(new GenericManagerFactory(TimerJobEntityManager.class));
        addSessionFactory(new GenericManagerFactory(VariableInstanceEntityManager.class));
        addSessionFactory(new GenericManagerFactory(EventSubscriptionEntityManager.class));
        addSessionFactory(new GenericManagerFactory(EventLogEntryEntityManager.class));

        addSessionFactory(new DefaultHistoryManagerSessionFactory());
    }

    if (customSessionFactories != null) {
        for (SessionFactory sessionFactory : customSessionFactories) {
            addSessionFactory(sessionFactory);
        }
    }
}
 
Example #4
Source File: CommandContext.java    From flowable-engine with Apache License 2.0 4 votes vote down vote up
public IdentityLinkEntityManager getIdentityLinkEntityManager() {
    return getSession(IdentityLinkEntityManager.class);
}
 
Example #5
Source File: AbstractManager.java    From flowable-engine with Apache License 2.0 4 votes vote down vote up
protected IdentityLinkEntityManager getIdentityLinkManager() {
    return getSession(IdentityLinkEntityManager.class);
}