• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java HistoryService类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.camunda.bpm.engine.HistoryService的典型用法代码示例。如果您正苦于以下问题:Java HistoryService类的具体用法?Java HistoryService怎么用?Java HistoryService使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



HistoryService类属于org.camunda.bpm.engine包,在下文中一共展示了HistoryService类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: collectInitialVariables

import org.camunda.bpm.engine.HistoryService; //导入依赖的package包/类
protected VariableMap collectInitialVariables(CommandContext commandContext, HistoricProcessInstance processInstance) {
  HistoryService historyService = commandContext.getProcessEngineConfiguration().getHistoryService();

  HistoricActivityInstance startActivityInstance = resolveStartActivityInstance(processInstance);

  HistoricDetailQueryImpl query = (HistoricDetailQueryImpl) historyService.createHistoricDetailQuery()
      .variableUpdates()
      .executionId(processInstance.getId())
      .activityInstanceId(startActivityInstance.getId());

  List<HistoricDetail> historicDetails = query
      .sequenceCounter(1)
      .list();

  VariableMap variables = new VariableMapImpl();
  for (HistoricDetail detail : historicDetails) {
    HistoricVariableUpdate variableUpdate = (HistoricVariableUpdate) detail;
    variables.putValueTyped(variableUpdate.getVariableName(), variableUpdate.getTypedValue());
  }

  return variables;
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:23,代码来源:RestartProcessInstancesCmd.java


示例2: resolveStartActivityInstance

import org.camunda.bpm.engine.HistoryService; //导入依赖的package包/类
protected HistoricActivityInstance resolveStartActivityInstance(HistoricProcessInstance processInstance) {
  HistoryService historyService = Context.getProcessEngineConfiguration().getHistoryService();

  String processInstanceId = processInstance.getId();
  String startActivityId = processInstance.getStartActivityId();

  ensureNotNull("startActivityId", startActivityId);

  List<HistoricActivityInstance> historicActivityInstances = historyService
      .createHistoricActivityInstanceQuery()
      .processInstanceId(processInstanceId)
      .activityId(startActivityId)
      .orderPartiallyByOccurrence()
      .asc()
      .list();

  ensureNotEmpty("historicActivityInstances", historicActivityInstances);

  HistoricActivityInstance startActivityInstance = historicActivityInstances.get(0);
  return startActivityInstance;
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:22,代码来源:RestartProcessInstancesCmd.java


示例3: getHistoricDecisionInstance

import org.camunda.bpm.engine.HistoryService; //导入依赖的package包/类
public HistoricDecisionInstanceDto getHistoricDecisionInstance(Boolean includeInputs, Boolean includeOutputs, Boolean disableBinaryFetching, Boolean disableCustomObjectDeserialization) {
  HistoryService historyService = engine.getHistoryService();

  HistoricDecisionInstanceQuery query = historyService.createHistoricDecisionInstanceQuery().decisionInstanceId(decisionInstanceId);
  if (includeInputs != null && includeInputs) {
    query.includeInputs();
  }
  if (includeOutputs != null && includeOutputs) {
    query.includeOutputs();
  }
  if (disableBinaryFetching != null && disableBinaryFetching) {
    query.disableBinaryFetching();
  }
  if (disableCustomObjectDeserialization != null && disableCustomObjectDeserialization) {
    query.disableCustomObjectDeserialization();
  }

  HistoricDecisionInstance instance = query.singleResult();

  if (instance == null) {
    throw new InvalidRequestException(Status.NOT_FOUND, "Historic decision instance with id '" + decisionInstanceId + "' does not exist");
  }

  return HistoricDecisionInstanceDto.fromHistoricDecisionInstance(instance);
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:26,代码来源:HistoricDecisionInstanceResourceImpl.java


示例4: deleteAsync

import org.camunda.bpm.engine.HistoryService; //导入依赖的package包/类
@Override
public BatchDto deleteAsync(DeleteHistoricProcessInstancesDto dto) {
  HistoryService historyService = processEngine.getHistoryService();

  HistoricProcessInstanceQuery historicProcessInstanceQuery = null;
  if (dto.getHistoricProcessInstanceQuery() != null) {
    historicProcessInstanceQuery = dto.getHistoricProcessInstanceQuery().toQuery(processEngine);
  }

  try {
    Batch batch = historyService.deleteHistoricProcessInstancesAsync(
        dto.getHistoricProcessInstanceIds(),
        historicProcessInstanceQuery,
        dto.getDeleteReason());
    return BatchDto.fromBatch(batch);

  } catch (BadUserRequestException e) {
    throw new InvalidRequestException(Status.BAD_REQUEST, e.getMessage());
  }
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:21,代码来源:HistoricProcessInstanceRestServiceImpl.java


示例5: setUpRuntimeData

import org.camunda.bpm.engine.HistoryService; //导入依赖的package包/类
@Before
public void setUpRuntimeData() {
  runtimeServiceMock = mock(RuntimeService.class);
  when(processEngine.getRuntimeService()).thenReturn(runtimeServiceMock);
  
  historyServiceMock = mock(HistoryService.class);
  when(processEngine.getHistoryService()).thenReturn(historyServiceMock);

  builderMock = mock(RestartProcessInstanceBuilder.class);
  when(builderMock.startAfterActivity(anyString())).thenReturn(builderMock);
  when(builderMock.startBeforeActivity(anyString())).thenReturn(builderMock);
  when(builderMock.startTransition(anyString())).thenReturn(builderMock);
  when(builderMock.processInstanceIds(anyListOf(String.class))).thenReturn(builderMock);
  when(builderMock.historicProcessInstanceQuery(any(HistoricProcessInstanceQuery.class))).thenReturn(builderMock);
  when(builderMock.skipCustomListeners()).thenReturn(builderMock);
  when(builderMock.skipIoMappings()).thenReturn(builderMock);
  when(builderMock.initialSetOfVariables()).thenReturn(builderMock);
  when(builderMock.withoutBusinessKey()).thenReturn(builderMock);

  Batch batchMock = createMockBatch();
  when(builderMock.executeAsync()).thenReturn(batchMock);

  when(runtimeServiceMock.restartProcessInstances(anyString())).thenReturn(builderMock);
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:25,代码来源:RestartProcessInstanceRestServiceTest.java


示例6: mockServices

import org.camunda.bpm.engine.HistoryService; //导入依赖的package包/类
private void mockServices(ProcessEngine engine) {
  RepositoryService repoService = mock(RepositoryService.class);
  IdentityService identityService = mock(IdentityService.class);
  TaskService taskService = mock(TaskService.class);
  RuntimeService runtimeService = mock(RuntimeService.class);
  FormService formService = mock(FormService.class);
  HistoryService historyService = mock(HistoryService.class);
  ManagementService managementService = mock(ManagementService.class);
  CaseService caseService = mock(CaseService.class);
  FilterService filterService = mock(FilterService.class);
  ExternalTaskService externalTaskService = mock(ExternalTaskService.class);

  when(engine.getRepositoryService()).thenReturn(repoService);
  when(engine.getIdentityService()).thenReturn(identityService);
  when(engine.getTaskService()).thenReturn(taskService);
  when(engine.getRuntimeService()).thenReturn(runtimeService);
  when(engine.getFormService()).thenReturn(formService);
  when(engine.getHistoryService()).thenReturn(historyService);
  when(engine.getManagementService()).thenReturn(managementService);
  when(engine.getCaseService()).thenReturn(caseService);
  when(engine.getFilterService()).thenReturn(filterService);
  when(engine.getExternalTaskService()).thenReturn(externalTaskService);
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:24,代码来源:MockedProcessEngineProvider.java


示例7: logActivityResults

import org.camunda.bpm.engine.HistoryService; //导入依赖的package包/类
protected void logActivityResults(PerfTestPass pass, PerfTestRun run, HistoryService historyService) {
  String processInstanceId = run.getVariable(PerfTestConstants.PROCESS_INSTANCE_ID);
  List<ActivityPerfTestResult> activityResults = new ArrayList<ActivityPerfTestResult>();

  HistoricProcessInstance processInstance = historyService.createHistoricProcessInstanceQuery().processInstanceId(processInstanceId).singleResult();
  Date startTime = processInstance.getStartTime();

  List<HistoricActivityInstance> activityInstances = historyService.createHistoricActivityInstanceQuery()
    .processInstanceId(processInstanceId)
    .orderByHistoricActivityInstanceStartTime()
    .asc()
    .list();

  for (HistoricActivityInstance activityInstance : activityInstances) {
    if (watchAllActivities || activityIds.contains(activityInstance.getActivityId())) {
      ActivityPerfTestResult result = new ActivityPerfTestResult(activityInstance);
      if (activityInstance.getActivityType().equals("startEvent")) {
        result.setStartTime(startTime);
      }
      activityResults.add(result);
    }
  }

  pass.logActivityResult(processInstanceId, activityResults);
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:26,代码来源:ActivityPerfTestWatcher.java


示例8: clearUserOperationLog

import org.camunda.bpm.engine.HistoryService; //导入依赖的package包/类
public static void clearUserOperationLog(ProcessEngineConfigurationImpl processEngineConfiguration) {
  if (processEngineConfiguration.getHistoryLevel().equals(HistoryLevel.HISTORY_LEVEL_FULL)) {
    HistoryService historyService = processEngineConfiguration.getHistoryService();
    List<UserOperationLogEntry> logs = historyService.createUserOperationLogQuery().list();
    for (UserOperationLogEntry log : logs) {
      historyService.deleteUserOperationLogEntry(log.getId());
    }
  }
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:10,代码来源:TestHelper.java


示例9: collectLastVariables

import org.camunda.bpm.engine.HistoryService; //导入依赖的package包/类
protected VariableMap collectLastVariables(CommandContext commandContext, HistoricProcessInstance processInstance) {
  HistoryService historyService = commandContext.getProcessEngineConfiguration().getHistoryService();

  List<HistoricVariableInstance> historicVariables = historyService.createHistoricVariableInstanceQuery()
      .executionIdIn(processInstance.getId())
      .list();

  VariableMap variables = new VariableMapImpl();
  for (HistoricVariableInstance variable : historicVariables) {
    variables.putValueTyped(variable.getName(), variable.getTypedValue());
  }

  return variables;
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:15,代码来源:RestartProcessInstancesCmd.java


示例10: removeAllRunningAndHistoricBatches

import org.camunda.bpm.engine.HistoryService; //导入依赖的package包/类
private void removeAllRunningAndHistoricBatches() {
  HistoryService historyService = engineRule.getHistoryService();
  ManagementService managementService = engineRule.getManagementService();

  for (Batch batch : managementService.createBatchQuery().list()) {
    managementService.deleteBatch(batch.getId(), true);
  }

  // remove history of completed batches
  for (HistoricBatch historicBatch : historyService.createHistoricBatchQuery().list()) {
    historyService.deleteHistoricBatch(historicBatch.getId());
  }
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:14,代码来源:HistoricBatchQueryAuthorizationTest.java


示例11: removeAllRunningAndHistoricBatches

import org.camunda.bpm.engine.HistoryService; //导入依赖的package包/类
@After
public void removeAllRunningAndHistoricBatches() {
  HistoryService historyService = rule.getHistoryService();
  ManagementService managementService = rule.getManagementService();
  for (Batch batch : managementService.createBatchQuery().list()) {
    managementService.deleteBatch(batch.getId(), true);
  }
  // remove history of completed batches
  for (HistoricBatch historicBatch : historyService.createHistoricBatchQuery().list()) {
    historyService.deleteHistoricBatch(historicBatch.getId());
  }
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:13,代码来源:SetExternalTaskRetriesUserOperationLogTest.java


示例12: removeAllRunningAndHistoricBatches

import org.camunda.bpm.engine.HistoryService; //导入依赖的package包/类
/**
 * Remove all batches and historic batches. Usually called in {@link org.junit.After} method.
 */
public void removeAllRunningAndHistoricBatches() {
  HistoryService historyService = getHistoryService();
  ManagementService managementService = getManagementService();

  for (Batch batch : managementService.createBatchQuery().list()) {
    managementService.deleteBatch(batch.getId(), true);
  }

  // remove history of completed batches
  for (HistoricBatch historicBatch : historyService.createHistoricBatchQuery().list()) {
    historyService.deleteHistoricBatch(historicBatch.getId());
  }

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


示例13: getHistoryService

import org.camunda.bpm.engine.HistoryService; //导入依赖的package包/类
protected HistoryService getHistoryService() {
  if (engineRule != null) {
    return engineRule.getHistoryService();
  }
  else {
    return testCase.getProcessEngine().getHistoryService();
  }
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:9,代码来源:BatchHelper.java


示例14: execute

import org.camunda.bpm.engine.HistoryService; //导入依赖的package包/类
public void execute(DelegateExecution execution) throws Exception {
  HistoryService historyService = execution.getProcessEngineServices().getHistoryService();

  HistoricVariableInstance variableInstance = historyService
      .createHistoricVariableInstanceQuery()
      .variableName("listVar")
      .singleResult();

  List<String> list = (List<String>) variableInstance.getValue();

  // implicit update of the list, should not trigger an update
  // of the value since we deal with historic variables
  list.add(NEW_ELEMENT);
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:15,代码来源:UpdateHistoricValueDelegate.java


示例15: getHistoricActivityInstance

import org.camunda.bpm.engine.HistoryService; //导入依赖的package包/类
public HistoricActivityInstanceDto getHistoricActivityInstance() {
  HistoryService historyService = engine.getHistoryService();
  HistoricActivityInstance instance = historyService.createHistoricActivityInstanceQuery()
    .activityInstanceId(activityInstanceId).singleResult();

  if (instance == null) {
    throw new InvalidRequestException(Status.NOT_FOUND, "Historic activity instance with id '" + activityInstanceId + "' does not exist");
  }

  return HistoricActivityInstanceDto.fromHistoricActivityInstance(instance);
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:12,代码来源:HistoricActivityInstanceResourceImpl.java


示例16: getHistoricCaseInstance

import org.camunda.bpm.engine.HistoryService; //导入依赖的package包/类
public HistoricCaseInstanceDto getHistoricCaseInstance() {
  HistoryService historyService = engine.getHistoryService();
  HistoricCaseInstance instance = historyService.createHistoricCaseInstanceQuery().caseInstanceId(caseInstanceId).singleResult();

  if (instance == null) {
    throw new InvalidRequestException(Status.NOT_FOUND, "Historic case instance with id '" + caseInstanceId + "' does not exist");
  }

  return HistoricCaseInstanceDto.fromHistoricCaseInstance(instance);
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:11,代码来源:HistoricCaseInstanceResourceImpl.java


示例17: getHistoricProcessInstance

import org.camunda.bpm.engine.HistoryService; //导入依赖的package包/类
@Override
public HistoricProcessInstanceDto getHistoricProcessInstance() {
  HistoryService historyService = engine.getHistoryService();
  HistoricProcessInstance instance = historyService.createHistoricProcessInstanceQuery().processInstanceId(processInstanceId).singleResult();

  if (instance == null) {
    throw new InvalidRequestException(Status.NOT_FOUND, "Historic process instance with id " + processInstanceId + " does not exist");
  }

  return HistoricProcessInstanceDto.fromHistoricProcessInstance(instance);
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:12,代码来源:HistoricProcessInstanceResourceImpl.java


示例18: getHistoricExternalTaskLog

import org.camunda.bpm.engine.HistoryService; //导入依赖的package包/类
@Override
public HistoricExternalTaskLogDto getHistoricExternalTaskLog() {
  HistoryService historyService = engine.getHistoryService();
  HistoricExternalTaskLog historicExternalTaskLog = historyService
    .createHistoricExternalTaskLogQuery()
    .logId(id)
    .singleResult();

  if (historicExternalTaskLog == null) {
    throw new InvalidRequestException(Status.NOT_FOUND, "Historic external task log with id " + id + " does not exist");
  }

  return HistoricExternalTaskLogDto.fromHistoricExternalTaskLog(historicExternalTaskLog);
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:15,代码来源:HistoricExternalTaskLogResourceImpl.java


示例19: getHistoricCaseActivityInstance

import org.camunda.bpm.engine.HistoryService; //导入依赖的package包/类
public HistoricCaseActivityInstanceDto getHistoricCaseActivityInstance() {
  HistoryService historyService = engine.getHistoryService();
  HistoricCaseActivityInstance instance = historyService.createHistoricCaseActivityInstanceQuery()
    .caseActivityInstanceId(caseActivityInstanceId).singleResult();

  if (instance == null) {
    throw new InvalidRequestException(Status.NOT_FOUND, "Historic case activity instance with id '" + caseActivityInstanceId + "' does not exist");
  }

  return HistoricCaseActivityInstanceDto.fromHistoricCaseActivityInstance(instance);
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:12,代码来源:HistoricCaseActivityInstanceResourceImpl.java


示例20: getHistoricJobLog

import org.camunda.bpm.engine.HistoryService; //导入依赖的package包/类
public HistoricJobLogDto getHistoricJobLog() {
  HistoryService historyService = engine.getHistoryService();
  HistoricJobLog historicJobLog = historyService
      .createHistoricJobLogQuery()
      .logId(id)
      .singleResult();

  if (historicJobLog == null) {
    throw new InvalidRequestException(Status.NOT_FOUND, "Historic job log with id " + id + " does not exist");
  }

  return HistoricJobLogDto.fromHistoricJobLog(historicJobLog);
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:14,代码来源:HistoricJobLogResourceImpl.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java ComparableComparator类代码示例发布时间:2022-05-22
下一篇:
Java Iter类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap