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


Java ProcessEngineConfiguration.HISTORY_FULL属性代码示例

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


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

示例1: testTaskInvolvedUser

@RequiredHistoryLevel(ProcessEngineConfiguration.HISTORY_FULL)
@Deployment(resources = { "org/camunda/bpm/engine/test/api/runtime/oneTaskProcess.bpmn20.xml" })
public void testTaskInvolvedUser() {
  // given
  runtimeService.startProcessInstanceByKey("oneTaskProcess");
  String taskId = taskService.createTaskQuery().singleResult().getId();
  // if
  identityService.setAuthenticatedUserId("aAssignerId");
  taskService.addCandidateUser(taskId, "aUserId");
  taskService.addCandidateUser(taskId, "bUserId");
  taskService.deleteCandidateUser(taskId, "aUserId");
  taskService.deleteCandidateUser(taskId, "bUserId");
  Task taskAssignee = taskService.newTask("newTask");
  taskAssignee.setAssignee("aUserId");
  taskService.saveTask(taskAssignee);
  // query test
  assertEquals(2, historyService.createHistoricTaskInstanceQuery().taskInvolvedUser("aUserId").count());
  assertEquals(1, historyService.createHistoricTaskInstanceQuery().taskInvolvedUser("bUserId").count());
  assertEquals(0, historyService.createHistoricTaskInstanceQuery().taskInvolvedUser("invalidUserId").count());
  taskService.deleteTask("newTask",true);
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:21,代码来源:HistoricTaskInstanceQueryTest.java

示例2: testRestartProcessInstanceSyncWithTenantId

@RequiredHistoryLevel(ProcessEngineConfiguration.HISTORY_FULL)
public void testRestartProcessInstanceSyncWithTenantId() {
  // given
  ProcessInstance processInstance = startAndDeleteProcessInstance(TENANT_ONE, PROCESS);

  identityService.setAuthentication("user", null, Collections.singletonList(TENANT_ONE));

  // when
  runtimeService.restartProcessInstances(processInstance.getProcessDefinitionId())
    .startBeforeActivity("userTask")
    .processInstanceIds(processInstance.getId())
    .execute();

  // then
  ProcessInstance restartedInstance = runtimeService.createProcessInstanceQuery().active()
      .processDefinitionId(processInstance.getProcessDefinitionId()).singleResult();

  assertNotNull(restartedInstance);
  assertEquals(restartedInstance.getTenantId(), TENANT_ONE);
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:20,代码来源:MultiTenancyProcessInstantiationTest.java

示例3: testTaskHadCandidateUser

@RequiredHistoryLevel(ProcessEngineConfiguration.HISTORY_FULL)
@Deployment(resources = { "org/camunda/bpm/engine/test/api/runtime/oneTaskProcess.bpmn20.xml" })
public void testTaskHadCandidateUser() {
  // given
  runtimeService.startProcessInstanceByKey("oneTaskProcess");
  String taskId = taskService.createTaskQuery().singleResult().getId();
  // if
  identityService.setAuthenticatedUserId("aAssignerId");
  taskService.addCandidateUser(taskId, "aUserId");
  taskService.addCandidateUser(taskId, "bUserId");
  taskService.deleteCandidateUser(taskId, "bUserId");
  Task taskAssignee = taskService.newTask("newTask");
  taskAssignee.setAssignee("aUserId");
  taskService.saveTask(taskAssignee);
  // query test
  assertEquals(1, historyService.createHistoricTaskInstanceQuery().taskHadCandidateUser("aUserId").count());
  assertEquals(1, historyService.createHistoricTaskInstanceQuery().taskHadCandidateUser("bUserId").count());
  assertEquals(0, historyService.createHistoricTaskInstanceQuery().taskHadCandidateUser("invalidUserId").count());
  // delete test
  taskService.deleteTask("newTask",true);
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:21,代码来源:HistoricTaskInstanceQueryTest.java

示例4: testFailToRestartProcessInstanceSyncWithOtherTenantId

@RequiredHistoryLevel(ProcessEngineConfiguration.HISTORY_FULL)
public void testFailToRestartProcessInstanceSyncWithOtherTenantId() {
  // given
  ProcessInstance processInstance = startAndDeleteProcessInstance(TENANT_ONE, PROCESS);

  identityService.setAuthentication("user", null, Collections.singletonList(TENANT_TWO));

  try {
    // when
    runtimeService.restartProcessInstances(processInstance.getProcessDefinitionId())
      .startBeforeActivity("userTask")
      .processInstanceIds(processInstance.getId())
      .execute();

    fail("expected exception");
  } catch (BadUserRequestException e) {
    // then
    assertThat(e.getMessage(), containsString("Historic process instance cannot be found: historicProcessInstanceId is null"));
  }
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:20,代码来源:MultiTenancyProcessInstantiationTest.java

示例5: testDeleteProcessInstanceWithSubprocessInstances

@RequiredHistoryLevel(ProcessEngineConfiguration.HISTORY_FULL)
@Test
public void testDeleteProcessInstanceWithSubprocessInstances() {
  // given a process instance with subprocesses
  BpmnModelInstance calling = prepareComplexProcess("A", "B", "A");

  BpmnModelInstance calledA = prepareSimpleProcess("A");
  BpmnModelInstance calledB = prepareSimpleProcess("B");

  testRule.deploy(calling, calledA, calledB);

  ProcessInstance instance = runtimeService.startProcessInstanceByKey("calling");
  List<ProcessInstance> subInstances = runtimeService.createProcessInstanceQuery().superProcessInstanceId(instance.getId()).list();

  // when the process instance is deleted and we do not skip sub processes
  String id = instance.getId();
  runtimeService.deleteProcessInstance(id, "test_purposes", false, true, false, false);

  // then
  testRule.assertProcessEnded(id);

  for (ProcessInstance subInstance : subInstances) {
    testRule.assertProcessEnded(subInstance.getId());
  }
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:25,代码来源:RuntimeServiceTest.java

示例6: testRestartProcessInstanceSyncWithTenantIdByHistoricProcessInstanceQuery

@RequiredHistoryLevel(ProcessEngineConfiguration.HISTORY_FULL)
public void testRestartProcessInstanceSyncWithTenantIdByHistoricProcessInstanceQuery() {
  // given
  ProcessInstance processInstance = startAndDeleteProcessInstance(TENANT_ONE, PROCESS);
  HistoricProcessInstanceQuery query = historyService.createHistoricProcessInstanceQuery().processDefinitionId(processInstance.getProcessDefinitionId());

  identityService.setAuthentication("user", null, Collections.singletonList(TENANT_ONE));

  // when
  runtimeService.restartProcessInstances(processInstance.getProcessDefinitionId())
    .startBeforeActivity("userTask")
    .historicProcessInstanceQuery(query)
    .execute();

  // then
  ProcessInstance restartedInstance = runtimeService.createProcessInstanceQuery().active()
    .processDefinitionId(processInstance.getProcessDefinitionId()).singleResult();

  assertNotNull(restartedInstance);
  assertEquals(restartedInstance.getTenantId(), TENANT_ONE);
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:21,代码来源:MultiTenancyProcessInstantiationTest.java

示例7: testRestartProcessInstanceAsyncWithTenantIdByHistoricProcessInstanceQuery

@RequiredHistoryLevel(ProcessEngineConfiguration.HISTORY_FULL)
public void testRestartProcessInstanceAsyncWithTenantIdByHistoricProcessInstanceQuery() {
  // given
  ProcessInstance processInstance = startAndDeleteProcessInstance(TENANT_ONE, PROCESS);
  HistoricProcessInstanceQuery query = historyService.createHistoricProcessInstanceQuery().processDefinitionId(processInstance.getProcessDefinitionId());

  identityService.setAuthentication("user", null, Collections.singletonList(TENANT_ONE));

  // when
  Batch batch = runtimeService.restartProcessInstances(processInstance.getProcessDefinitionId())
    .startBeforeActivity("userTask")
    .historicProcessInstanceQuery(query)
    .executeAsync();

  batchHelper.completeBatch(batch);

  // then
  ProcessInstance restartedInstance = runtimeService.createProcessInstanceQuery().active()
    .processDefinitionId(processInstance.getProcessDefinitionId()).singleResult();

  assertNotNull(restartedInstance);
  assertEquals(restartedInstance.getTenantId(), TENANT_ONE);
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:23,代码来源:MultiTenancyProcessInstantiationTest.java

示例8: testHistoricProcessInstanceQueryIncidentStatusOpenWithTwoProcesses

@Deployment(resources = {"org/camunda/bpm/engine/test/api/mgmt/IncidentTest.testShouldDeleteIncidentAfterJobWasSuccessfully.bpmn"})
@RequiredHistoryLevel(ProcessEngineConfiguration.HISTORY_FULL)
public void testHistoricProcessInstanceQueryIncidentStatusOpenWithTwoProcesses() {
  //given two processes, which will fail, are started
  Map<String, Object> parameters = new HashMap<String, Object>();
  parameters.put("fail", true);
  ProcessInstance pi1 = runtimeService.startProcessInstanceByKey("failingProcessWithUserTask", parameters);
  runtimeService.startProcessInstanceByKey("failingProcessWithUserTask", parameters);
  executeAvailableJobs();
  assertEquals(2, historyService.createHistoricProcessInstanceQuery().incidentStatus("open").count());

  //when 'fail' variable is set to false, job retry count is set to one
  //and available jobs are executed
  runtimeService.setVariable(pi1.getId(), "fail", false);
  Job jobToResolve = managementService.createJobQuery().processInstanceId(pi1.getId()).singleResult();
  managementService.setJobRetries(jobToResolve.getId(), 1);
  executeAvailableJobs();

  //then query with open and with resolved incidents returns one
  assertEquals(1, historyService.createHistoricProcessInstanceQuery().incidentStatus("open").count());
  assertEquals(1, historyService.createHistoricProcessInstanceQuery().incidentStatus("resolved").count());
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:22,代码来源:HistoricProcessInstanceTest.java

示例9: testFailToRestartProcessInstanceAsyncWithOtherTenantIdByHistoricProcessInstanceQuery

@RequiredHistoryLevel(ProcessEngineConfiguration.HISTORY_FULL)
public void testFailToRestartProcessInstanceAsyncWithOtherTenantIdByHistoricProcessInstanceQuery() {
  // given
  ProcessInstance processInstance = startAndDeleteProcessInstance(TENANT_ONE, PROCESS);
  HistoricProcessInstanceQuery query = historyService.createHistoricProcessInstanceQuery().processDefinitionId(processInstance.getProcessDefinitionId());

  identityService.setAuthentication("user", null, Collections.singletonList(TENANT_TWO));

  try {
    // when
    runtimeService.restartProcessInstances(processInstance.getProcessDefinitionId())
      .startBeforeActivity("userTask")
      .historicProcessInstanceQuery(query)
      .executeAsync();
  }
  catch (ProcessEngineException e) {
    assertThat(e.getMessage(), containsString("processInstanceIds is empty"));
  }

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

示例10: shouldCreateUserOperationLogForBatchActivation

@Test
@RequiredHistoryLevel(ProcessEngineConfiguration.HISTORY_FULL)
public void shouldCreateUserOperationLogForBatchActivation() {
  // given
  Batch batch = helper.migrateProcessInstancesAsync(1);
  managementService.suspendBatchById(batch.getId());

  // when
  identityService.setAuthenticatedUserId(USER_ID);
  managementService.activateBatchById(batch.getId());
  identityService.clearAuthentication();

  // then
  UserOperationLogEntry entry = historyService.createUserOperationLogQuery()
    .singleResult();

  assertNotNull(entry);
  assertEquals(batch.getId(), entry.getBatchId());
  assertEquals(AbstractSetBatchStateCmd.SUSPENSION_STATE_PROPERTY, entry.getProperty());
  assertNull(entry.getOrgValue());
  assertEquals(SuspensionState.ACTIVE.getName(), entry.getNewValue());
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:22,代码来源:BatchSuspensionTest.java

示例11: testHistoricProcessInstanceQueryIncidentStatusResolved

@Deployment(resources = {"org/camunda/bpm/engine/test/api/mgmt/IncidentTest.testShouldDeleteIncidentAfterJobWasSuccessfully.bpmn"})
@RequiredHistoryLevel(ProcessEngineConfiguration.HISTORY_FULL)
public void testHistoricProcessInstanceQueryIncidentStatusResolved() {
  //given a incident processes instance
  Map<String, Object> parameters = new HashMap<String, Object>();
  parameters.put("fail", true);
  ProcessInstance pi1 = runtimeService.startProcessInstanceByKey("failingProcessWithUserTask", parameters);
  executeAvailableJobs();

  //when `fail` variable is set to true and job retry count is set to one and executed again
  runtimeService.setVariable(pi1.getId(), "fail", false);
  Job jobToResolve = managementService.createJobQuery().processInstanceId(pi1.getId()).singleResult();
  managementService.setJobRetries(jobToResolve.getId(), 1);
  executeAvailableJobs();

  //then query for historic process instance with resolved incidents will return one
  assertEquals(1, historyService.createHistoricProcessInstanceQuery().incidentStatus("resolved").count());
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:18,代码来源:HistoricProcessInstanceTest.java

示例12: testQueryWithRootIncidents

@Test
@RequiredHistoryLevel(ProcessEngineConfiguration.HISTORY_FULL)
public void testQueryWithRootIncidents() {
  // given
  deployment("org/camunda/bpm/engine/test/history/HistoricProcessInstanceTest.testQueryWithRootIncidents.bpmn20.xml");
  deployment(CallActivityModels.oneBpmnCallActivityProcess("Process_1"));

  runtimeService.startProcessInstanceByKey("Process");
  ProcessInstance calledProcessInstance = runtimeService.createProcessInstanceQuery().processDefinitionKey("Process_1").singleResult();
  executeAvailableJobs();

  // when
  List<HistoricProcessInstance> historicProcInstances = historyService.createHistoricProcessInstanceQuery().withRootIncidents().list();

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

示例13: testImplicitVariableUpdateAndScopeDestroyedInOneTransaction

@RequiredHistoryLevel(ProcessEngineConfiguration.HISTORY_FULL)
public void testImplicitVariableUpdateAndScopeDestroyedInOneTransaction() {
  deployment(Bpmn.createExecutableProcess("process1")
    .startEvent("start")
    .serviceTask("task1").camundaExpression("${var.setValue(\"newValue\")}")
    .endEvent("end")
    .done());

  processEngine.getRuntimeService().startProcessInstanceByKey("process1", Variables.createVariables().putValue("var", new CustomVar("initialValue")));

  final HistoricVariableInstance historicVariableInstance = processEngine.getHistoryService().createHistoricVariableInstanceQuery().list().get(0);
  CustomVar var = (CustomVar) historicVariableInstance.getTypedValue().getValue();

  assertEquals("newValue", var.getValue());

  final List<HistoricDetail> historicDetails = processEngine.getHistoryService().createHistoricDetailQuery().orderPartiallyByOccurrence().desc().list();
  HistoricDetail historicDetail = historicDetails.get(0);
  final CustomVar typedValue = (CustomVar) ((HistoricVariableUpdate) historicDetail).getTypedValue().getValue();
  assertEquals("newValue", typedValue.getValue());
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:20,代码来源:HistoricVariableInstanceTest.java

示例14: testDeleteProcessInstanceWithoutSkipIoMappings

@Deployment(resources = {
    "org/camunda/bpm/engine/test/api/oneTaskProcessWithIoMappings.bpmn20.xml" })
@RequiredHistoryLevel(ProcessEngineConfiguration.HISTORY_FULL)
@Test
public void testDeleteProcessInstanceWithoutSkipIoMappings() {

  // given a process instance
  ProcessInstance instance = runtimeService.startProcessInstanceByKey("ioMappingProcess");

  // when the process instance is deleted and we do not skip the io mappings
  runtimeService.deleteProcessInstance(instance.getId(), null, false, true, false);

  // then
  testRule.assertProcessEnded(instance.getId());
  assertEquals(2, historyService.createHistoricVariableInstanceQuery().processInstanceId(instance.getId()).list().size());
  assertEquals(1, historyService.createHistoricVariableInstanceQuery().variableName("inputMappingExecuted").count());
  assertEquals(1, historyService.createHistoricVariableInstanceQuery().variableName("outputMappingExecuted").count());
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:18,代码来源:RuntimeServiceTest.java

示例15: testNoCreationOnSyncBatchJobExecution

@Test
@Deployment(resources = {"org/camunda/bpm/engine/test/api/externaltask/oneExternalTaskProcess.bpmn20.xml",
  "org/camunda/bpm/engine/test/api/externaltask/twoExternalTaskProcess.bpmn20.xml"})
@RequiredHistoryLevel(ProcessEngineConfiguration.HISTORY_FULL)
public void testNoCreationOnSyncBatchJobExecution() {
  // given
  ProcessInstance processInstance1 = runtimeService.startProcessInstanceByKey("oneExternalTaskProcess");
  ProcessInstance processInstance2 = runtimeService.startProcessInstanceByKey("twoExternalTaskProcess");


  // when
  Batch suspendprocess = runtimeService.updateProcessInstanceSuspensionState().byProcessInstanceIds(Arrays.asList(processInstance1.getId(), processInstance2.getId())).suspendAsync();
  helper.executeSeedJob(suspendprocess);

  // when
  rule.getIdentityService().setAuthenticatedUserId("userId");
  helper.executeJobs(suspendprocess);
  rule.getIdentityService().clearAuthentication();

  // then
  assertEquals(0, rule.getHistoryService().createUserOperationLogQuery().count());
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:22,代码来源:UpdateSuspendStateUserOperationLogTest.java


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