本文整理汇总了Java中org.camunda.bpm.engine.ProcessEngineConfiguration.HISTORY_ACTIVITY属性的典型用法代码示例。如果您正苦于以下问题:Java ProcessEngineConfiguration.HISTORY_ACTIVITY属性的具体用法?Java ProcessEngineConfiguration.HISTORY_ACTIVITY怎么用?Java ProcessEngineConfiguration.HISTORY_ACTIVITY使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.camunda.bpm.engine.ProcessEngineConfiguration
的用法示例。
在下文中一共展示了ProcessEngineConfiguration.HISTORY_ACTIVITY属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testBatchSuspensionByHistoricProcessInstanceQuery
@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_ACTIVITY)
public void testBatchSuspensionByHistoricProcessInstanceQuery() {
// given
ProcessInstance processInstance1 = runtimeService.startProcessInstanceByKey("oneExternalTaskProcess");
ProcessInstance processInstance2 = runtimeService.startProcessInstanceByKey("twoExternalTaskProcess");
// when
Batch suspendprocess = runtimeService.updateProcessInstanceSuspensionState().byHistoricProcessInstanceQuery(historyService.createHistoricProcessInstanceQuery().processInstanceIds(Sets.newHashSet(processInstance1.getId(), processInstance2.getId()))).suspendAsync();
helper.executeSeedJob(suspendprocess);
helper.executeJobs(suspendprocess);
// then
ProcessInstance p1c = runtimeService.createProcessInstanceQuery().processInstanceId(processInstance1.getId()).singleResult();
assertTrue(p1c.isSuspended());
ProcessInstance p2c = runtimeService.createProcessInstanceQuery().processInstanceId(processInstance2.getId()).singleResult();
assertTrue(p2c.isSuspended());
}
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:22,代码来源:UpdateProcessInstancesSuspendStateAsyncTest.java
示例2: testBatchActivationByHistoricProcessInstanceQuery
@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_ACTIVITY)
public void testBatchActivationByHistoricProcessInstanceQuery() {
// given
ProcessInstance processInstance1 = runtimeService.startProcessInstanceByKey("oneExternalTaskProcess");
ProcessInstance processInstance2 = runtimeService.startProcessInstanceByKey("twoExternalTaskProcess");
// when
Batch suspendprocess = runtimeService.updateProcessInstanceSuspensionState().byHistoricProcessInstanceQuery(historyService.createHistoricProcessInstanceQuery().processInstanceIds(Sets.newHashSet(processInstance1.getId(), processInstance2.getId()))).suspendAsync();
helper.executeSeedJob(suspendprocess);
helper.executeJobs(suspendprocess);
Batch activateprocess = runtimeService.updateProcessInstanceSuspensionState().byHistoricProcessInstanceQuery(historyService.createHistoricProcessInstanceQuery().processInstanceIds(Sets.newHashSet(processInstance1.getId(), processInstance2.getId()))).activateAsync();
helper.executeSeedJob(activateprocess);
helper.executeJobs(activateprocess);
// then
ProcessInstance p1c = runtimeService.createProcessInstanceQuery().processInstanceId(processInstance1.getId()).singleResult();
assertFalse(p1c.isSuspended());
ProcessInstance p2c = runtimeService.createProcessInstanceQuery().processInstanceId(processInstance2.getId()).singleResult();
assertFalse(p2c.isSuspended());
}
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:24,代码来源:UpdateProcessInstancesSuspendStateAsyncTest.java
示例3: testBatchSuspensionByHistoricProcessInstanceQuery
@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_ACTIVITY)
public void testBatchSuspensionByHistoricProcessInstanceQuery() {
// given
ProcessInstance processInstance1 = runtimeService.startProcessInstanceByKey("oneExternalTaskProcess");
ProcessInstance processInstance2 = runtimeService.startProcessInstanceByKey("twoExternalTaskProcess");
// when the process instances are suspended
runtimeService.updateProcessInstanceSuspensionState()
.byHistoricProcessInstanceQuery(historyService.createHistoricProcessInstanceQuery().processInstanceIds(Sets.newHashSet(processInstance1.getId(), processInstance2.getId()))).suspend();
// Update the process instances and they are suspended
ProcessInstance p1c = runtimeService.createProcessInstanceQuery().processInstanceId(processInstance1.getId()).singleResult();
assertTrue(p1c.isSuspended());
ProcessInstance p2c = runtimeService.createProcessInstanceQuery().processInstanceId(processInstance2.getId()).singleResult();
assertTrue(p2c.isSuspended());
}
示例4: testBatchActivatationByHistoricProcessInstanceQuery
@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_ACTIVITY)
public void testBatchActivatationByHistoricProcessInstanceQuery() {
// given
ProcessInstance processInstance1 = runtimeService.startProcessInstanceByKey("oneExternalTaskProcess");
ProcessInstance processInstance2 = runtimeService.startProcessInstanceByKey("twoExternalTaskProcess");
// when the process instances are suspended
runtimeService.updateProcessInstanceSuspensionState()
.byHistoricProcessInstanceQuery(historyService.createHistoricProcessInstanceQuery().processInstanceIds(Sets.newHashSet(processInstance1.getId(), processInstance2.getId()))).suspend();
// when they are activated again
runtimeService.updateProcessInstanceSuspensionState()
.byHistoricProcessInstanceQuery(historyService.createHistoricProcessInstanceQuery().processInstanceIds(Sets.newHashSet(processInstance1.getId(), processInstance2.getId()))).activate();
// Update the process instances and they are active again
ProcessInstance p1c = runtimeService.createProcessInstanceQuery().processInstanceId(processInstance1.getId()).singleResult();
assertFalse(p1c.isSuspended());
ProcessInstance p2c = runtimeService.createProcessInstanceQuery().processInstanceId(processInstance2.getId()).singleResult();
assertFalse(p2c.isSuspended());
}
示例5: testMigrateWithSubTask
@Test
@RequiredHistoryLevel(ProcessEngineConfiguration.HISTORY_ACTIVITY)
public void testMigrateWithSubTask() {
//given
ProcessDefinition sourceProcessDefinition = testHelper.deployAndGetDefinition(ProcessModels.ONE_TASK_PROCESS);
ProcessDefinition targetProcessDefinition = testHelper.deployAndGetDefinition(ProcessModels.ONE_TASK_PROCESS);
MigrationPlan migrationPlan = runtimeService.createMigrationPlan(sourceProcessDefinition.getId(), targetProcessDefinition.getId())
.mapEqualActivities()
.build();
ProcessInstance processInstance = runtimeService.startProcessInstanceById(sourceProcessDefinition.getId());
Task task = taskService.createTaskQuery().singleResult();
Task subTask = taskService.newTask();
subTask.setParentTaskId(task.getId());
taskService.saveTask(subTask);
// when
runtimeService.newMigration(migrationPlan)
.processInstanceIds(Arrays.asList(processInstance.getId()))
.execute();
// then the historic sub task instance is still the same
HistoricTaskInstance historicSubTaskAfterMigration = historyService
.createHistoricTaskInstanceQuery().taskId(subTask.getId()).singleResult();
Assert.assertNotNull(historicSubTaskAfterMigration);
Assert.assertNull(historicSubTaskAfterMigration.getProcessDefinitionId());
Assert.assertNull(historicSubTaskAfterMigration.getProcessDefinitionKey());
Assert.assertNull(historicSubTaskAfterMigration.getExecutionId());
Assert.assertNull(historicSubTaskAfterMigration.getActivityInstanceId());
}
示例6: testMigrateHistoryProcessInstance
@Test
@RequiredHistoryLevel(ProcessEngineConfiguration.HISTORY_ACTIVITY)
public void testMigrateHistoryProcessInstance() {
//given
HistoricProcessInstanceQuery sourceHistoryProcessInstanceQuery =
historyService.createHistoricProcessInstanceQuery()
.processDefinitionId(sourceProcessDefinition.getId());
HistoricProcessInstanceQuery targetHistoryProcessInstanceQuery =
historyService.createHistoricProcessInstanceQuery()
.processDefinitionId(targetProcessDefinition.getId());
//when
assertEquals(1, sourceHistoryProcessInstanceQuery.count());
assertEquals(0, targetHistoryProcessInstanceQuery.count());
ProcessInstanceQuery sourceProcessInstanceQuery = runtimeService.createProcessInstanceQuery().processDefinitionId(sourceProcessDefinition.getId());
runtimeService.newMigration(migrationPlan)
.processInstanceQuery(sourceProcessInstanceQuery)
.execute();
//then
assertEquals(0, sourceHistoryProcessInstanceQuery.count());
assertEquals(1, targetHistoryProcessInstanceQuery.count());
HistoricProcessInstance instance = targetHistoryProcessInstanceQuery.singleResult();
assertEquals(instance.getProcessDefinitionKey(), targetProcessDefinition.getKey());
}
示例7: testMigrateHistoricSubProcessInstance
@Test
@RequiredHistoryLevel(ProcessEngineConfiguration.HISTORY_ACTIVITY)
public void testMigrateHistoricSubProcessInstance() {
//given
ProcessDefinition processDefinition = testHelper.deployAndGetDefinition(ProcessModels.SCOPE_TASK_SUBPROCESS_PROCESS);
MigrationPlan migrationPlan = rule.getRuntimeService()
.createMigrationPlan(processDefinition.getId(), processDefinition.getId())
.mapEqualActivities()
.build();
ProcessInstance processInstance = rule.getRuntimeService().startProcessInstanceById(processDefinition.getId());
// when
rule.getRuntimeService().newMigration(migrationPlan)
.processInstanceIds(Arrays.asList(processInstance.getId()))
.execute();
// then
List<HistoricActivityInstance> historicInstances = historyService
.createHistoricActivityInstanceQuery()
.processInstanceId(processInstance.getId())
.unfinished()
.orderByActivityId()
.asc()
.list();
Assert.assertEquals(2, historicInstances.size());
assertMigratedTo(historicInstances.get(0), processDefinition, "subProcess");
assertMigratedTo(historicInstances.get(1), processDefinition, "userTask");
assertEquals(processInstance.getId(), historicInstances.get(0).getParentActivityInstanceId());
assertEquals(historicInstances.get(0).getId(), historicInstances.get(1).getParentActivityInstanceId());
}
示例8: testMigrateHistoricSubProcessRename
@Test
@RequiredHistoryLevel(ProcessEngineConfiguration.HISTORY_ACTIVITY)
public void testMigrateHistoricSubProcessRename() {
//given
ProcessDefinition sourceDefinition = testHelper.deployAndGetDefinition(ProcessModels.SUBPROCESS_PROCESS);
ProcessDefinition targetDefinition = testHelper.deployAndGetDefinition(modify(ProcessModels.SUBPROCESS_PROCESS)
.changeElementId("subProcess", "newSubProcess"));
MigrationPlan migrationPlan = rule.getRuntimeService()
.createMigrationPlan(sourceDefinition.getId(), targetDefinition.getId())
.mapActivities("subProcess", "newSubProcess")
.mapActivities("userTask", "userTask")
.build();
ProcessInstance processInstance = rule.getRuntimeService().startProcessInstanceById(sourceDefinition.getId());
// when
rule.getRuntimeService().newMigration(migrationPlan)
.processInstanceIds(Arrays.asList(processInstance.getId()))
.execute();
// then
List<HistoricActivityInstance> historicInstances = historyService
.createHistoricActivityInstanceQuery()
.processInstanceId(processInstance.getId())
.unfinished()
.orderByActivityId()
.asc()
.list();
Assert.assertEquals(2, historicInstances.size());
assertMigratedTo(historicInstances.get(0), targetDefinition, "newSubProcess");
assertMigratedTo(historicInstances.get(1), targetDefinition, "userTask");
assertEquals(processInstance.getId(), historicInstances.get(0).getParentActivityInstanceId());
assertEquals(historicInstances.get(0).getId(), historicInstances.get(1).getParentActivityInstanceId());
}
示例9: testHistoricActivityInstanceBecomeScope
@Test
@RequiredHistoryLevel(ProcessEngineConfiguration.HISTORY_ACTIVITY)
public void testHistoricActivityInstanceBecomeScope() {
//given
ProcessDefinition sourceDefinition = testHelper.deployAndGetDefinition(ProcessModels.ONE_TASK_PROCESS);
ProcessDefinition targetDefinition = testHelper.deployAndGetDefinition(ProcessModels.SCOPE_TASK_PROCESS);
MigrationPlan migrationPlan = rule.getRuntimeService()
.createMigrationPlan(sourceDefinition.getId(), targetDefinition.getId())
.mapEqualActivities()
.build();
ProcessInstance processInstance = rule.getRuntimeService().startProcessInstanceById(sourceDefinition.getId());
// when
rule.getRuntimeService().newMigration(migrationPlan)
.processInstanceIds(Arrays.asList(processInstance.getId()))
.execute();
// then
List<HistoricActivityInstance> historicInstances = historyService
.createHistoricActivityInstanceQuery()
.processInstanceId(processInstance.getId())
.unfinished()
.orderByActivityId()
.asc()
.list();
Assert.assertEquals(1, historicInstances.size());
assertMigratedTo(historicInstances.get(0), targetDefinition, "userTask");
assertEquals(processInstance.getId(), historicInstances.get(0).getParentActivityInstanceId());
}
示例10: testMigrateHistoricActivityInstanceAddScope
@Test
@RequiredHistoryLevel(ProcessEngineConfiguration.HISTORY_ACTIVITY)
public void testMigrateHistoricActivityInstanceAddScope() {
//given
ProcessDefinition sourceDefinition = testHelper.deployAndGetDefinition(ProcessModels.ONE_TASK_PROCESS);
ProcessDefinition targetDefinition = testHelper.deployAndGetDefinition(ProcessModels.SUBPROCESS_PROCESS);
MigrationPlan migrationPlan = rule.getRuntimeService()
.createMigrationPlan(sourceDefinition.getId(), targetDefinition.getId())
.mapActivities("userTask", "userTask")
.build();
ProcessInstance processInstance = rule.getRuntimeService().startProcessInstanceById(sourceDefinition.getId());
// when
rule.getRuntimeService().newMigration(migrationPlan)
.processInstanceIds(Arrays.asList(processInstance.getId()))
.execute();
// then
List<HistoricActivityInstance> historicInstances = historyService
.createHistoricActivityInstanceQuery()
.processInstanceId(processInstance.getId())
.unfinished()
.orderByActivityId()
.asc()
.list();
Assert.assertEquals(2, historicInstances.size());
assertMigratedTo(historicInstances.get(0), targetDefinition, "subProcess");
assertMigratedTo(historicInstances.get(1), targetDefinition, "userTask");
assertEquals(processInstance.getId(), historicInstances.get(0).getParentActivityInstanceId());
assertEquals(historicInstances.get(0).getId(), historicInstances.get(1).getParentActivityInstanceId());
}
示例11: testCommandContextNestedFailingCommandsNotExceptions
@RequiredHistoryLevel(ProcessEngineConfiguration.HISTORY_ACTIVITY)
public void testCommandContextNestedFailingCommandsNotExceptions() {
final BpmnModelInstance modelInstance =
Bpmn.createExecutableProcess("processThrowingThrowable")
.startEvent()
.serviceTask()
.camundaClass(ThrowErrorJavaDelegate.class)
.endEvent().done();
deployment(modelInstance);
boolean errorThrown = false;
try {
processEngineConfiguration.getCommandExecutorTxRequired().execute(new Command<Object>() {
public Object execute(CommandContext commandContext) {
runtimeService.startProcessInstanceByKey("processThrowingThrowable");
return null;
}
});
fail("Exception expected");
} catch (StackOverflowError t) {
//OK
errorThrown = true;
}
assertTrue(ThrowErrorJavaDelegate.executed);
assertTrue(errorThrown);
// Check data base consistency
assertEquals(0, historyService.createHistoricProcessInstanceQuery().count());
}
示例12: testRequiredHistoryLevelActivity
@RequiredHistoryLevel(ProcessEngineConfiguration.HISTORY_ACTIVITY)
public void testRequiredHistoryLevelActivity() {
assertThat(currentHistoryLevel(),
CoreMatchers.<String>either(is(ProcessEngineConfiguration.HISTORY_ACTIVITY))
.or(is(ProcessEngineConfiguration.HISTORY_AUDIT))
.or(is(ProcessEngineConfiguration.HISTORY_FULL)));
}
示例13: requiredHistoryLevelActivity
@Test
@RequiredHistoryLevel(ProcessEngineConfiguration.HISTORY_ACTIVITY)
public void requiredHistoryLevelActivity() {
assertThat(currentHistoryLevel(),
CoreMatchers.<String>either(is(ProcessEngineConfiguration.HISTORY_ACTIVITY))
.or(is(ProcessEngineConfiguration.HISTORY_AUDIT))
.or(is(ProcessEngineConfiguration.HISTORY_FULL)));
}
示例14: overrideRequiredHistoryLevelOnClass
@Test
@RequiredHistoryLevel(ProcessEngineConfiguration.HISTORY_ACTIVITY)
public void overrideRequiredHistoryLevelOnClass() {
assertThat(currentHistoryLevel(),
CoreMatchers.<String>either(is(ProcessEngineConfiguration.HISTORY_ACTIVITY))
.or(is(ProcessEngineConfiguration.HISTORY_AUDIT))
.or(is(ProcessEngineConfiguration.HISTORY_FULL)));
}
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:9,代码来源:ProcessEngineRuleRequiredHistoryLevelClassTest.java
示例15: getName
public String getName() {
return ProcessEngineConfiguration.HISTORY_ACTIVITY;
}