当前位置: 首页>>代码示例>>Java>>正文


Java CommandContext.enableUserOperationLog方法代码示例

本文整理汇总了Java中org.camunda.bpm.engine.impl.interceptor.CommandContext.enableUserOperationLog方法的典型用法代码示例。如果您正苦于以下问题:Java CommandContext.enableUserOperationLog方法的具体用法?Java CommandContext.enableUserOperationLog怎么用?Java CommandContext.enableUserOperationLog使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.camunda.bpm.engine.impl.interceptor.CommandContext的用法示例。


在下文中一共展示了CommandContext.enableUserOperationLog方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: execute

import org.camunda.bpm.engine.impl.interceptor.CommandContext; //导入方法依赖的package包/类
@Override
public void execute(BatchJobConfiguration configuration, ExecutionEntity execution, CommandContext commandContext, String tenantId) {
  ByteArrayEntity configurationEntity = commandContext
      .getDbEntityManager()
      .selectById(ByteArrayEntity.class, configuration.getConfigurationByteArrayId());

  SetRetriesBatchConfiguration batchConfiguration = readConfiguration(configurationEntity.getBytes());

  boolean initialLegacyRestrictions = commandContext.isRestrictUserOperationLogToAuthenticatedUsers();
  commandContext.disableUserOperationLog();
  commandContext.setRestrictUserOperationLogToAuthenticatedUsers(true);
  try {
    commandContext.getProcessEngineConfiguration()
        .getManagementService()
        .setJobRetries(batchConfiguration.getIds(), batchConfiguration.getRetries());
  } finally {
    commandContext.enableUserOperationLog();
    commandContext.setRestrictUserOperationLogToAuthenticatedUsers(initialLegacyRestrictions);
  }

  commandContext.getByteArrayManager().delete(configurationEntity);
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:23,代码来源:SetJobRetriesJobHandler.java

示例2: execute

import org.camunda.bpm.engine.impl.interceptor.CommandContext; //导入方法依赖的package包/类
@Override
public void execute(BatchJobConfiguration configuration, ExecutionEntity execution, CommandContext commandContext, String tenantId) {
  ByteArrayEntity configurationEntity = commandContext
    .getDbEntityManager()
    .selectById(ByteArrayEntity.class, configuration.getConfigurationByteArrayId());

  UpdateProcessInstancesSuspendStateBatchConfiguration batchConfiguration = readConfiguration(configurationEntity.getBytes());

  boolean initialLegacyRestrictions = commandContext.isRestrictUserOperationLogToAuthenticatedUsers();
  commandContext.disableUserOperationLog();
  commandContext.setRestrictUserOperationLogToAuthenticatedUsers(true);
  try {
    if(batchConfiguration.getSuspended()) {
      commandContext.getProcessEngineConfiguration()
        .getRuntimeService()
        .updateProcessInstanceSuspensionState().byProcessInstanceIds(batchConfiguration.getIds()).suspend();
    } else {
       commandContext.getProcessEngineConfiguration()
         .getRuntimeService()
         .updateProcessInstanceSuspensionState().byProcessInstanceIds(batchConfiguration.getIds()).activate();
    }
  } finally {
    commandContext.enableUserOperationLog();
    commandContext.setRestrictUserOperationLogToAuthenticatedUsers(initialLegacyRestrictions);
  }
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:27,代码来源:UpdateProcessInstancesSuspendStateJobHandler.java

示例3: execute

import org.camunda.bpm.engine.impl.interceptor.CommandContext; //导入方法依赖的package包/类
@Override
public void execute(BatchJobConfiguration configuration, ExecutionEntity execution, CommandContext commandContext, String tenantId) {
  ByteArrayEntity configurationEntity = commandContext
      .getDbEntityManager()
      .selectById(ByteArrayEntity.class, configuration.getConfigurationByteArrayId());

  SetRetriesBatchConfiguration batchConfiguration = readConfiguration(configurationEntity.getBytes());

  boolean initialLegacyRestrictions = commandContext.isRestrictUserOperationLogToAuthenticatedUsers();
  commandContext.disableUserOperationLog();
  commandContext.setRestrictUserOperationLogToAuthenticatedUsers(true);
  try {
    commandContext.getProcessEngineConfiguration()
        .getExternalTaskService()
        .setRetries(batchConfiguration.getIds(), batchConfiguration.getRetries());
  } finally {
    commandContext.enableUserOperationLog();
    commandContext.setRestrictUserOperationLogToAuthenticatedUsers(initialLegacyRestrictions);
  }

  commandContext.getByteArrayManager().delete(configurationEntity);
  
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:24,代码来源:SetExternalTaskRetriesJobHandler.java

示例4: execute

import org.camunda.bpm.engine.impl.interceptor.CommandContext; //导入方法依赖的package包/类
@Override
public void execute(BatchJobConfiguration configuration, ExecutionEntity execution, CommandContext commandContext, String tenantId) {
  ByteArrayEntity configurationEntity = commandContext
      .getDbEntityManager()
      .selectById(ByteArrayEntity.class, configuration.getConfigurationByteArrayId());

  DeleteProcessInstanceBatchConfiguration batchConfiguration = readConfiguration(configurationEntity.getBytes());

  boolean initialLegacyRestrictions = commandContext.isRestrictUserOperationLogToAuthenticatedUsers();
  commandContext.disableUserOperationLog();
  commandContext.setRestrictUserOperationLogToAuthenticatedUsers(true);
  try {
    commandContext.getProcessEngineConfiguration()
        .getRuntimeService()
        .deleteProcessInstances(batchConfiguration.getIds(), batchConfiguration.deleteReason, batchConfiguration.isSkipCustomListeners(), true, batchConfiguration.isSkipSubprocesses());
  } finally {
    commandContext.enableUserOperationLog();
    commandContext.setRestrictUserOperationLogToAuthenticatedUsers(initialLegacyRestrictions);
  }

  commandContext.getByteArrayManager().delete(configurationEntity);
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:23,代码来源:DeleteProcessInstancesJobHandler.java

示例5: execute

import org.camunda.bpm.engine.impl.interceptor.CommandContext; //导入方法依赖的package包/类
@Override
public void execute(BatchJobConfiguration configuration, ExecutionEntity execution, CommandContext commandContext, String tenantId) {
  ByteArrayEntity configurationEntity = commandContext
      .getDbEntityManager()
      .selectById(ByteArrayEntity.class, configuration.getConfigurationByteArrayId());

  BatchConfiguration batchConfiguration = readConfiguration(configurationEntity.getBytes());

  boolean initialLegacyRestrictions = commandContext.isRestrictUserOperationLogToAuthenticatedUsers();
  commandContext.disableUserOperationLog();
  commandContext.setRestrictUserOperationLogToAuthenticatedUsers(true);
  try {
    commandContext.getProcessEngineConfiguration()
        .getHistoryService()
        .deleteHistoricProcessInstances(batchConfiguration.getIds());
  } finally {
    commandContext.enableUserOperationLog();
    commandContext.setRestrictUserOperationLogToAuthenticatedUsers(initialLegacyRestrictions);
  }

  commandContext.getByteArrayManager().delete(configurationEntity);
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:23,代码来源:DeleteHistoricProcessInstancesJobHandler.java

示例6: execute

import org.camunda.bpm.engine.impl.interceptor.CommandContext; //导入方法依赖的package包/类
@Override
public void execute(BatchJobConfiguration configuration, ExecutionEntity execution, CommandContext commandContext, String tenantId) {
  ByteArrayEntity configurationEntity = commandContext
      .getDbEntityManager()
      .selectById(ByteArrayEntity.class, configuration.getConfigurationByteArrayId());

  BatchConfiguration batchConfiguration = readConfiguration(configurationEntity.getBytes());

  boolean initialLegacyRestrictions = commandContext.isRestrictUserOperationLogToAuthenticatedUsers();
  commandContext.disableUserOperationLog();
  commandContext.setRestrictUserOperationLogToAuthenticatedUsers(true);
  try {
    commandContext.getProcessEngineConfiguration()
        .getHistoryService()
        .deleteHistoricDecisionInstancesBulk(batchConfiguration.getIds());
  } finally {
    commandContext.enableUserOperationLog();
    commandContext.setRestrictUserOperationLogToAuthenticatedUsers(initialLegacyRestrictions);
  }

  commandContext.getByteArrayManager().delete(configurationEntity);
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:23,代码来源:DeleteHistoricDecisionInstancesJobHandler.java

示例7: execute

import org.camunda.bpm.engine.impl.interceptor.CommandContext; //导入方法依赖的package包/类
@Override
public void execute(BatchJobConfiguration configuration, ExecutionEntity execution, CommandContext commandContext, String tenantId) {
  ByteArrayEntity configurationEntity = commandContext
      .getDbEntityManager()
      .selectById(ByteArrayEntity.class, configuration.getConfigurationByteArrayId());

  RestartProcessInstancesBatchConfiguration batchConfiguration = readConfiguration(configurationEntity.getBytes());

  boolean initialLegacyRestrictions = commandContext.isRestrictUserOperationLogToAuthenticatedUsers();
  commandContext.disableUserOperationLog();
  commandContext.setRestrictUserOperationLogToAuthenticatedUsers(true);
  try {

    RestartProcessInstanceBuilderImpl builder = (RestartProcessInstanceBuilderImpl) commandContext.getProcessEngineConfiguration()
        .getRuntimeService()
        .restartProcessInstances(batchConfiguration.getProcessDefinitionId())
        .processInstanceIds(batchConfiguration.getIds());

    builder.setInstructions(batchConfiguration.getInstructions());

    if (batchConfiguration.isInitialVariables()) {
      builder.initialSetOfVariables();
    }

    if (batchConfiguration.isSkipCustomListeners()) {
      builder.skipCustomListeners();
    }

    if (batchConfiguration.isWithoutBusinessKey()) {
      builder.withoutBusinessKey();
    }

    if (batchConfiguration.isSkipIoMappings()) {
      builder.skipIoMappings();
    }

    builder.execute(false);

  } finally {
    commandContext.enableUserOperationLog();
    commandContext.setRestrictUserOperationLogToAuthenticatedUsers(initialLegacyRestrictions);
  }

  commandContext.getByteArrayManager().delete(configurationEntity);

}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:47,代码来源:RestartProcessInstancesJobHandler.java

示例8: handleInvocationInContext

import org.camunda.bpm.engine.impl.interceptor.CommandContext; //导入方法依赖的package包/类
protected void handleInvocationInContext(final DelegateInvocation invocation) throws Exception {
  CommandContext commandContext = Context.getCommandContext();
  boolean oldValue = commandContext.isAuthorizationCheckEnabled();
  BaseDelegateExecution contextExecution = invocation.getContextExecution();

  ProcessEngineConfigurationImpl configuration = Context.getProcessEngineConfiguration();

  boolean popExecutionContext = false;

  try {
    if (!configuration.isAuthorizationEnabledForCustomCode()) {
      // the custom code should be executed without authorization
      commandContext.disableAuthorizationCheck();
    }

    try {
      commandContext.disableUserOperationLog();

      try {
        if (contextExecution != null && !isCurrentContextExecution(contextExecution)) {
          popExecutionContext = setExecutionContext(contextExecution);
        }

        invocation.proceed();
      }
      finally {
        if (popExecutionContext) {
          Context.removeExecutionContext();
        }
      }
    }
    finally {
      commandContext.enableUserOperationLog();
    }
  }
  finally {
    if (oldValue) {
      commandContext.enableAuthorizationCheck();
    }
  }

}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:43,代码来源:DefaultDelegateInterceptor.java


注:本文中的org.camunda.bpm.engine.impl.interceptor.CommandContext.enableUserOperationLog方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。