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

Java HistoricProcessInstance类代码示例

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

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



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

示例1: testIsoTimeAndConstantDistribution

import org.camunda.bpm.engine.history.HistoricProcessInstance; //导入依赖的package包/类
@Test
@Deployment(resources = "isoTimeAndConstantDistribution.bpmn")
public void testIsoTimeAndConstantDistribution() {
  TimeAwareDemoGenerator generator = new TimeAwareDemoGenerator(processEngine()) //
      .processDefinitionKey("isoTimeAndConstantDistribution") //
      .numberOfDaysInPast(1) //
      .startTimeBusinessDay("00:00") //
      .endTimeBusinessDay("23:59") //
      .includeWeekend(true) //
      .timeBetweenStartsBusinessDays(3600.0, 0.0);
  generator.generateData();

  long epsilon = 1;

  List<HistoricProcessInstance> finished = processEngine().getHistoryService().createHistoricProcessInstanceQuery().finished()
      .processDefinitionKey("isoTimeAndConstantDistribution").list();

  assertEquals(25, finished.size());
  assert (finished.stream().map(HistoricProcessInstance::getDurationInMillis)
      .allMatch(duration -> duration - epsilon < 5400000 && duration + epsilon > 5400000));
}
 
开发者ID:camunda-consulting,项目名称:camunda-util-demo-data-generator,代码行数:22,代码来源:DemoDataGeneratorTest.java


示例2: getSubprocesses

import org.camunda.bpm.engine.history.HistoricProcessInstance; //导入依赖的package包/类
private Set<String> getSubprocesses(String instanceId) {
    Set<String> children = historyService.createHistoricProcessInstanceQuery()
                                         .superProcessInstanceId(instanceId)
                                         .list()
                                         .stream()
                                         .map(HistoricProcessInstance::getId)
                                         .collect(Collectors.toSet());

    Set<String> nested = children.stream()
                                  .map(this::getSubprocesses)
                                  .flatMap(Collection::stream)
                                  .collect(Collectors.toSet());

    Set<String> all = new HashSet<>();
    all.addAll(children);
    all.addAll(nested);

    return all;
}
 
开发者ID:LIBCAS,项目名称:ARCLib,代码行数:20,代码来源:ProcessList.java


示例3: executeQuery

import org.camunda.bpm.engine.history.HistoricProcessInstance; //导入依赖的package包/类
private Result<ProcessDto> executeQuery(HistoricProcessInstanceQuery query, Params params) {
    int first = params.getPage() * params.getPageSize();

    List<HistoricProcessInstance> processes = query.listPage(first, params.getPageSize());
    long count = query.count();

    List<ProcessDto> dtos = processes.stream()
            .map(process -> new ProcessDto(
                    process.getId(),
                    process.getProcessDefinitionName(),
                    toInstant(process.getStartTime()),
                    toInstant(process.getEndTime()),
                    process.getBusinessKey(),
                    null
            ))
            .collect(Collectors.toList());

    Result<ProcessDto> result = new Result<>();
    result.setCount(count);
    result.setItems(dtos);

    return result;
}
 
开发者ID:LIBCAS,项目名称:ARCLib,代码行数:24,代码来源:ProcessList.java


示例4: queryHistoricProcessInstances

import org.camunda.bpm.engine.history.HistoricProcessInstance; //导入依赖的package包/类
@Override
public List<HistoricProcessInstanceDto> queryHistoricProcessInstances(HistoricProcessInstanceQueryDto queryDto, Integer firstResult, Integer maxResults) {
  queryDto.setObjectMapper(objectMapper);
  HistoricProcessInstanceQuery query = queryDto.toQuery(processEngine);

  List<HistoricProcessInstance> matchingHistoricProcessInstances;
  if (firstResult != null || maxResults != null) {
    matchingHistoricProcessInstances = executePaginatedQuery(query, firstResult, maxResults);
  } else {
    matchingHistoricProcessInstances = query.list();
  }

  List<HistoricProcessInstanceDto> historicProcessInstanceDtoResults = new ArrayList<HistoricProcessInstanceDto>();
  for (HistoricProcessInstance historicProcessInstance : matchingHistoricProcessInstances) {
    HistoricProcessInstanceDto resultHistoricProcessInstanceDto = HistoricProcessInstanceDto.fromHistoricProcessInstance(historicProcessInstance);
    historicProcessInstanceDtoResults.add(resultHistoricProcessInstanceDto);
  }
  return historicProcessInstanceDtoResults;
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:20,代码来源:HistoricProcessInstanceRestServiceImpl.java


示例5: doExecute

import org.camunda.bpm.engine.history.HistoricProcessInstance; //导入依赖的package包/类
@Override
protected Object doExecute() throws Exception {
  HistoricProcessInstance processInstance = engine.getHistoryService().createHistoricProcessInstanceQuery().processInstanceId(instanceId).singleResult();
  System.out.println("Process instance   : " + processInstance.getId());
  System.out.println("Process definition : " + processInstance.getProcessDefinitionId());
  System.out.println("");
  List<HistoricActivityInstance> activities = engine.getHistoryService().createHistoricActivityInstanceQuery().
      processInstanceId(instanceId).orderByHistoricActivityInstanceStartTime().asc().list();

  String[][] data = new String[activities.size()][HEADER.length];
  int i = 0;
  for (HistoricActivityInstance activity : activities) {
    data[i++] = new String[]{
        activity.getId(),
        activity.getDurationInMillis() + " ms",
        activity.getActivityId(),
        activity.getActivityName(),
        activity.getActivityType()
    };
  }
  ASCIITable.getInstance().printTable(HEADER, data);
  return null;
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform-osgi,代码行数:24,代码来源:ActivityList.java


示例6: testHistoricProcInstExecutedActivityAfter

import org.camunda.bpm.engine.history.HistoricProcessInstance; //导入依赖的package包/类
@Test
public void testHistoricProcInstExecutedActivityAfter() {
  // given
  Calendar now = Calendar.getInstance();
  ClockUtil.setCurrentTime(now.getTime());
  BpmnModelInstance model = Bpmn.createExecutableProcess("proc").startEvent().endEvent().done();
  deployment(model);

  Calendar hourFromNow = (Calendar) now.clone();
  hourFromNow.add(Calendar.HOUR_OF_DAY, 1);

  runtimeService.startProcessInstanceByKey("proc");

  //when query historic process instance which has executed an activity after the start time
  HistoricProcessInstance historicProcessInstance = historyService.createHistoricProcessInstanceQuery().executedActivityAfter(now.getTime()).singleResult();

  //then query returns result
  assertNotNull(historicProcessInstance);

  //when query historic proc inst with execute activity after a hour of the starting time
  historicProcessInstance = historyService.createHistoricProcessInstanceQuery().executedActivityAfter(hourFromNow.getTime()).singleResult();

  //then query returns no result
  assertNull(historicProcessInstance);
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:26,代码来源:HistoricProcessInstanceTest.java


示例7: triggerHistoryEvent

import org.camunda.bpm.engine.history.HistoricProcessInstance; //导入依赖的package包/类
@Override
protected void triggerHistoryEvent(CommandContext commandContext){
  HistoryLevel historyLevel = commandContext.getProcessEngineConfiguration().getHistoryLevel();
  List<ProcessInstance> updatedProcessInstances = obtainProcessInstances(commandContext);
  //suspension state is not updated synchronously
  if (getNewSuspensionState() != null && updatedProcessInstances != null) {
    for (final ProcessInstance processInstance: updatedProcessInstances) {

      if (historyLevel.isHistoryEventProduced(HistoryEventTypes.PROCESS_INSTANCE_UPDATE, processInstance)) {
        HistoryEventProcessor.processHistoryEvents(new HistoryEventProcessor.HistoryEventCreator() {
          @Override
          public HistoryEvent createHistoryEvent(HistoryEventProducer producer) {
            HistoricProcessInstanceEventEntity processInstanceUpdateEvt = (HistoricProcessInstanceEventEntity)
                producer.createProcessInstanceUpdateEvt((DelegateExecution) processInstance);
            if (SuspensionState.SUSPENDED.getStateCode() == getNewSuspensionState().getStateCode()) {
              processInstanceUpdateEvt.setState(HistoricProcessInstance.STATE_SUSPENDED);
            } else {
              processInstanceUpdateEvt.setState(HistoricProcessInstance.STATE_ACTIVE);
            }
            return processInstanceUpdateEvt;
          }
        });
      }
    }
  }
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:27,代码来源:AbstractSetProcessInstanceStateCmd.java


示例8: testProcessInstanceShouldBeActive

import org.camunda.bpm.engine.history.HistoricProcessInstance; //导入依赖的package包/类
@Deployment
public void testProcessInstanceShouldBeActive() {
  // given

  // when
  String processInstanceId = runtimeService.startProcessInstanceByKey("process").getId();

  // then
  HistoricProcessInstance historicProcessInstance = historyService
    .createHistoricProcessInstanceQuery()
    .processInstanceId(processInstanceId)
    .singleResult();

  assertNull(historicProcessInstance.getEndTime());
  assertNull(historicProcessInstance.getDurationInMillis());
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:17,代码来源:HistoricProcessInstanceTest.java


示例9: collectInitialVariables

import org.camunda.bpm.engine.history.HistoricProcessInstance; //导入依赖的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


示例10: createMockHistoricProcessInstance

import org.camunda.bpm.engine.history.HistoricProcessInstance; //导入依赖的package包/类
public static HistoricProcessInstance createMockHistoricProcessInstance(String tenantId) {
  HistoricProcessInstance mock = mock(HistoricProcessInstance.class);

  when(mock.getId()).thenReturn(EXAMPLE_PROCESS_INSTANCE_ID);
  when(mock.getBusinessKey()).thenReturn(EXAMPLE_PROCESS_INSTANCE_BUSINESS_KEY);
  when(mock.getProcessDefinitionKey()).thenReturn(EXAMPLE_PROCESS_DEFINITION_KEY);
  when(mock.getProcessDefinitionName()).thenReturn(EXAMPLE_PROCESS_DEFINITION_NAME);
  when(mock.getProcessDefinitionVersion()).thenReturn(EXAMPLE_PROCESS_DEFINITION_VERSION);
  when(mock.getProcessDefinitionId()).thenReturn(EXAMPLE_PROCESS_DEFINITION_ID);
  when(mock.getDeleteReason()).thenReturn(EXAMPLE_HISTORIC_PROCESS_INSTANCE_DELETE_REASON);
  when(mock.getEndTime()).thenReturn(DateTimeUtil.parseDate(EXAMPLE_HISTORIC_PROCESS_INSTANCE_END_TIME));
  when(mock.getStartTime()).thenReturn(DateTimeUtil.parseDate(EXAMPLE_HISTORIC_PROCESS_INSTANCE_START_TIME));
  when(mock.getDurationInMillis()).thenReturn(EXAMPLE_HISTORIC_PROCESS_INSTANCE_DURATION_MILLIS);
  when(mock.getStartUserId()).thenReturn(EXAMPLE_HISTORIC_PROCESS_INSTANCE_START_USER_ID);
  when(mock.getStartActivityId()).thenReturn(EXAMPLE_HISTORIC_PROCESS_INSTANCE_START_ACTIVITY_ID);
  when(mock.getSuperProcessInstanceId()).thenReturn(EXAMPLE_HISTORIC_PROCESS_INSTANCE_SUPER_PROCESS_INSTANCE_ID);
  when(mock.getSuperCaseInstanceId()).thenReturn(EXAMPLE_HISTORIC_PROCESS_INSTANCE_SUPER_CASE_INSTANCE_ID);
  when(mock.getCaseInstanceId()).thenReturn(EXAMPLE_HISTORIC_PROCESS_INSTANCE_CASE_INSTANCE_ID);
  when(mock.getTenantId()).thenReturn(tenantId);
  when(mock.getState()).thenReturn(EXAMPLE_HISTORIC_PROCESS_INSTANCE_STATE);

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


示例11: createProcessInstanceUpdateEvt

import org.camunda.bpm.engine.history.HistoricProcessInstance; //导入依赖的package包/类
public HistoryEvent createProcessInstanceUpdateEvt(DelegateExecution execution) {
  final ExecutionEntity executionEntity = (ExecutionEntity) execution;

  // create event instance
  HistoricProcessInstanceEventEntity evt = newProcessInstanceEventEntity(executionEntity);

  // initialize event
  initProcessInstanceEvent(evt, executionEntity, HistoryEventTypes.PROCESS_INSTANCE_UPDATE);

  if (executionEntity.isSuspended()) {
    evt.setState(HistoricProcessInstance.STATE_SUSPENDED);
  } else {
    evt.setState(HistoricProcessInstance.STATE_ACTIVE);
  }

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


示例12: tearDown

import org.camunda.bpm.engine.history.HistoricProcessInstance; //导入依赖的package包/类
@Override
protected void tearDown() throws Exception {

  // end interaction with Thread 2
  thread2.waitUntilDone();

  // end interaction with Thread 1
  thread1.waitUntilDone();

  processEngineConfiguration.getCommandExecutorTxRequired()
    .execute(new Command<Void>() {

      public Void execute(CommandContext commandContext) {
        List<HistoricProcessInstance> list = commandContext.getDbEntityManager().createHistoricProcessInstanceQuery().list();
        for (HistoricProcessInstance historicProcessInstance : list) {
          commandContext.getDbEntityManager().delete(HistoricProcessInstanceEventEntity.class, "deleteHistoricProcessInstance", historicProcessInstance.getId());
        }
        return null;
      }

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


示例13: setupAndExecuteHistoricProcessInstancesListTest

import org.camunda.bpm.engine.history.HistoricProcessInstance; //导入依赖的package包/类
protected void setupAndExecuteHistoricProcessInstancesListTest() {
  //given
  List<String> processInstanceIds = Arrays.asList(processInstance.getId(), processInstance2.getId());
  runtimeService.deleteProcessInstances(processInstanceIds, null, true, false);

  List<String> historicProcessInstances = new ArrayList<String>();
  for (HistoricProcessInstance hpi : historyService.createHistoricProcessInstanceQuery().list()) {
    historicProcessInstances.add(hpi.getId());
  }

  authRule
      .init(scenario)
      .withUser("userId")
      .bindResource("Process_1", sourceDefinition.getKey())
      .bindResource("Process_2", sourceDefinition2.getKey())
      .start();

  // when
  batch = historyService.deleteHistoricProcessInstancesAsync(
      historicProcessInstances, TEST_REASON);

  executeSeedAndBatchJobs();
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:24,代码来源:DeleteHistoricProcessInstancesBatchAuthorizationTest.java


示例14: testHistoricProcInstQueryWithActiveActivityIds

import org.camunda.bpm.engine.history.HistoricProcessInstance; //导入依赖的package包/类
@Test
@RequiredHistoryLevel(ProcessEngineConfiguration.HISTORY_FULL)
public void testHistoricProcInstQueryWithActiveActivityIds() {
  // given
  deployment(ProcessModels.TWO_TASKS_PROCESS);
  ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("Process");

  // assume
  HistoricActivityInstance historicActivityInstance = historyService
      .createHistoricActivityInstanceQuery()
      .activityId("userTask1")
      .singleResult();
  assertNotNull(historicActivityInstance);

  // when
  List<HistoricProcessInstance> result = historyService
      .createHistoricProcessInstanceQuery()
      .activeActivityIdIn(historicActivityInstance.getActivityId())
      .list();

  // then
  assertNotNull(result);
  assertEquals(1, result.size());
  assertEquals(result.get(0).getId(), processInstance.getId());
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:26,代码来源:HistoricProcessInstanceTest.java


示例15: testQueryBySuperCaseInstanceId

import org.camunda.bpm.engine.history.HistoricProcessInstance; //导入依赖的package包/类
@Deployment(resources = {
    "org/camunda/bpm/engine/test/api/cmmn/oneProcessTaskCase.cmmn",
    "org/camunda/bpm/engine/test/api/runtime/oneTaskProcess.bpmn20.xml"
})
public void testQueryBySuperCaseInstanceId() {
  String superCaseInstanceId = caseService.createCaseInstanceByKey("oneProcessTaskCase").getId();

  HistoricProcessInstanceQuery query = historyService
      .createHistoricProcessInstanceQuery()
      .superCaseInstanceId(superCaseInstanceId);

  assertEquals(1, query.list().size());
  assertEquals(1, query.count());

  HistoricProcessInstance subProcessInstance = query.singleResult();
  assertNotNull(subProcessInstance);
  assertEquals(superCaseInstanceId, subProcessInstance.getSuperCaseInstanceId());
  assertNull(subProcessInstance.getSuperProcessInstanceId());
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:20,代码来源:HistoricProcessInstanceTest.java


示例16: testQueryAfterDeletingDeployment

import org.camunda.bpm.engine.history.HistoricProcessInstance; //导入依赖的package包/类
public void testQueryAfterDeletingDeployment() {
  // given
  startProcessInstanceByKey(ONE_TASK_PROCESS_KEY);
  String taskId = selectSingleTask().getId();
  setAssignee(taskId, "demo");
  createGrantAuthorization(PROCESS_DEFINITION, ONE_TASK_PROCESS_KEY, userId, READ_HISTORY);

  disableAuthorization();
  taskService.complete(taskId);
  enableAuthorization();

  deleteDeployment(deploymentId, false);

  // when
  UserOperationLogQuery query = historyService.createUserOperationLogQuery();

  // then
  verifyQueryResults(query, 2);

  disableAuthorization();
  List<HistoricProcessInstance> instances = historyService.createHistoricProcessInstanceQuery().list();
  for (HistoricProcessInstance instance : instances) {
    historyService.deleteHistoricProcessInstance(instance.getId());
  }
  enableAuthorization();
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:27,代码来源:UserOperationLogAuthorizationTest.java


示例17: testHistoricProcessInstanceForSingleActivityInstantiation

import org.camunda.bpm.engine.history.HistoricProcessInstance; //导入依赖的package包/类
@Deployment(resources = EXCLUSIVE_GATEWAY_PROCESS)
public void testHistoricProcessInstanceForSingleActivityInstantiation() {
  // when
  ProcessInstance instance = runtimeService
    .createProcessInstanceByKey("exclusiveGateway")
    .startBeforeActivity("task1")
    .execute();

  // then
  HistoricProcessInstance historicInstance = historyService.createHistoricProcessInstanceQuery().singleResult();
  assertNotNull(historicInstance);
  assertEquals(instance.getId(), historicInstance.getId());
  assertNotNull(historicInstance.getStartTime());
  assertNull(historicInstance.getEndTime());

  // should be the first activity started
  assertEquals("task1", historicInstance.getStartActivityId());

  HistoricActivityInstance historicActivityInstance = historyService.createHistoricActivityInstanceQuery().singleResult();
  assertNotNull(historicActivityInstance);
  assertEquals("task1", historicActivityInstance.getActivityId());
  assertNotNull(historicActivityInstance.getId());
  assertFalse(instance.getId().equals(historicActivityInstance.getId()));
  assertNotNull(historicActivityInstance.getStartTime());
  assertNull(historicActivityInstance.getEndTime());
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:27,代码来源:ProcessInstantiationAtActivitiesHistoryTest.java


示例18: testHistoricProcessInstanceForSynchronousCompletion

import org.camunda.bpm.engine.history.HistoricProcessInstance; //导入依赖的package包/类
@Deployment(resources = EXCLUSIVE_GATEWAY_PROCESS)
public void testHistoricProcessInstanceForSynchronousCompletion() {
  // when the process instance ends immediately
  ProcessInstance instance = runtimeService
    .createProcessInstanceByKey("exclusiveGateway")
    .startAfterActivity("task1")
    .execute();

  // then
  HistoricProcessInstance historicInstance = historyService.createHistoricProcessInstanceQuery().singleResult();
  assertNotNull(historicInstance);
  assertEquals(instance.getId(), historicInstance.getId());
  assertNotNull(historicInstance.getStartTime());
  assertNotNull(historicInstance.getEndTime());

  assertEquals("join", historicInstance.getStartActivityId());
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:18,代码来源:ProcessInstantiationAtActivitiesHistoryTest.java


示例19: testHistoricProcessInstanceUserIdAndActivityId

import org.camunda.bpm.engine.history.HistoricProcessInstance; //导入依赖的package包/类
@SuppressWarnings("deprecation") // deprecated method is tested here
@Deployment(resources = {"org/camunda/bpm/engine/test/api/oneTaskProcess.bpmn20.xml"})
public void testHistoricProcessInstanceUserIdAndActivityId() {
  identityService.setAuthenticatedUserId("johndoe");
  ProcessInstance processInstance = runtimeService.startProcessInstanceByKey(ONE_TASK_PROCESS);
  HistoricProcessInstance historicProcessInstance = historyService.createHistoricProcessInstanceQuery().singleResult();
  assertEquals("johndoe", historicProcessInstance.getStartUserId());
  assertEquals("theStart", historicProcessInstance.getStartActivityId());

  List<Task> tasks = taskService.createTaskQuery().processInstanceId(processInstance.getId()).list();
  assertEquals(1, tasks.size());
  taskService.complete(tasks.get(0).getId());

  historicProcessInstance = historyService.createHistoricProcessInstanceQuery().singleResult();
  assertEquals("theEnd", historicProcessInstance.getEndActivityId());
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:17,代码来源:HistoryServiceTest.java


示例20: testOrderProcessWithCallActivity

import org.camunda.bpm.engine.history.HistoricProcessInstance; //导入依赖的package包/类
@Deployment(resources = {"org/camunda/bpm/engine/test/api/history/orderProcess.bpmn20.xml",
    "org/camunda/bpm/engine/test/api/history/checkCreditProcess.bpmn20.xml"})
public void testOrderProcessWithCallActivity() {
  // After the process has started, the 'verify credit history' task should be
  // active
  ProcessInstance pi = runtimeService.startProcessInstanceByKey("orderProcess");
  TaskQuery taskQuery = taskService.createTaskQuery();
  Task verifyCreditTask = taskQuery.singleResult();

  // Completing the task with approval, will end the subprocess and continue
  // the original process
  taskService.complete(verifyCreditTask.getId(), CollectionUtil.singletonMap("creditApproved", true));
  Task prepareAndShipTask = taskQuery.singleResult();
  assertEquals("Prepare and Ship", prepareAndShipTask.getName());

  // verify
  HistoricProcessInstance historicProcessInstance = historyService.createHistoricProcessInstanceQuery().superProcessInstanceId(pi.getId()).singleResult();
  assertNotNull(historicProcessInstance);
  assertTrue(historicProcessInstance.getProcessDefinitionId().contains("checkCreditProcess"));
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:21,代码来源:HistoryServiceTest.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Java EntityHorse类代码示例发布时间:2022-05-22
下一篇:
Java Syntax类代码示例发布时间: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