use of org.camunda.bpm.engine.history.HistoricDecisionInstance in project camunda-bpm-platform by camunda.
the class TenantIdProviderTest method setNullTenantIdForHistoricDecisionInstance_BusinessRuleTask.
@Test
public void setNullTenantIdForHistoricDecisionInstance_BusinessRuleTask() {
String tenantId = null;
SetValueOnHistoricDecisionInstanceTenantIdProvider tenantIdProvider = new SetValueOnHistoricDecisionInstanceTenantIdProvider(tenantId);
TestTenantIdProvider.delegate = tenantIdProvider;
BpmnModelInstance process = Bpmn.createExecutableProcess(PROCESS_DEFINITION_KEY).startEvent().businessRuleTask().camundaDecisionRef(DECISION_DEFINITION_KEY).camundaAsyncAfter().endEvent().done();
testRule.deploy(process, DMN_FILE);
// if a process instance is started
engineRule.getRuntimeService().createProcessInstanceByKey(PROCESS_DEFINITION_KEY).setVariables(createVariables()).execute();
// then the tenant id provider can set the tenant id to a value
HistoricDecisionInstance historicDecisionInstance = engineRule.getHistoryService().createHistoricDecisionInstanceQuery().decisionDefinitionKey(DECISION_DEFINITION_KEY).singleResult();
assertThat(historicDecisionInstance.getTenantId(), is(nullValue()));
}
use of org.camunda.bpm.engine.history.HistoricDecisionInstance in project camunda-bpm-platform by camunda.
the class DeleteHistoricDecisionInstancesBatchCmd method collectHistoricDecisionInstanceIds.
protected List<String> collectHistoricDecisionInstanceIds() {
Set<String> collectedDecisionInstanceIds = new HashSet<String>();
List<String> decisionInstanceIds = getHistoricDecisionInstanceIds();
if (decisionInstanceIds != null) {
collectedDecisionInstanceIds.addAll(decisionInstanceIds);
}
final HistoricDecisionInstanceQueryImpl decisionInstanceQuery = (HistoricDecisionInstanceQueryImpl) historicDecisionInstanceQuery;
if (decisionInstanceQuery != null) {
for (HistoricDecisionInstance hdi : decisionInstanceQuery.list()) {
collectedDecisionInstanceIds.add(hdi.getId());
}
}
return new ArrayList<String>(collectedDecisionInstanceIds);
}
use of org.camunda.bpm.engine.history.HistoricDecisionInstance in project camunda-bpm-platform by camunda.
the class BatchHistoricDecisionInstanceDeletionAuthorizationTest method executeDecisionInstances.
@Before
public void executeDecisionInstances() {
testRule.deploy("org/camunda/bpm/engine/test/api/dmn/Example.dmn");
VariableMap variables = Variables.createVariables().putValue("status", "silver").putValue("sum", 723);
for (int i = 0; i < 10; i++) {
decisionService.evaluateDecisionByKey(DECISION).variables(variables).evaluate();
}
List<HistoricDecisionInstance> decisionInstances = historyService.createHistoricDecisionInstanceQuery().list();
for (HistoricDecisionInstance decisionInstance : decisionInstances) {
decisionInstanceIds.add(decisionInstance.getId());
}
}
use of org.camunda.bpm.engine.history.HistoricDecisionInstance in project camunda-bpm-platform by camunda.
the class BatchHistoricDecisionInstanceDeletionUserOperationTest method evaluateDecisionInstances.
@Before
public void evaluateDecisionInstances() {
testRule.deploy("org/camunda/bpm/engine/test/api/dmn/Example.dmn");
VariableMap variables = Variables.createVariables().putValue("status", "silver").putValue("sum", 723);
for (int i = 0; i < 10; i++) {
decisionService.evaluateDecisionByKey(DECISION).variables(variables).evaluate();
}
List<HistoricDecisionInstance> decisionInstances = historyService.createHistoricDecisionInstanceQuery().list();
for (HistoricDecisionInstance decisionInstance : decisionInstances) {
decisionInstanceIds.add(decisionInstance.getId());
}
}
use of org.camunda.bpm.engine.history.HistoricDecisionInstance in project camunda-bpm-platform by camunda.
the class BatchHistoricDecisionInstanceDeletionTest method executeDecisionInstances.
@Before
public void executeDecisionInstances() {
testRule.deploy("org/camunda/bpm/engine/test/api/dmn/Example.dmn");
VariableMap variables = Variables.createVariables().putValue("status", "silver").putValue("sum", 723);
for (int i = 0; i < 10; i++) {
decisionService.evaluateDecisionByKey(DECISION).variables(variables).evaluate();
}
List<HistoricDecisionInstance> decisionInstances = historyService.createHistoricDecisionInstanceQuery().list();
for (HistoricDecisionInstance decisionInstance : decisionInstances) {
decisionInstanceIds.add(decisionInstance.getId());
}
}
Aggregations