本文整理汇总了Java中org.camunda.bpm.engine.history.HistoricDecisionInstance类的典型用法代码示例。如果您正苦于以下问题:Java HistoricDecisionInstance类的具体用法?Java HistoricDecisionInstance怎么用?Java HistoricDecisionInstance使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
HistoricDecisionInstance类属于org.camunda.bpm.engine.history包,在下文中一共展示了HistoricDecisionInstance类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: findHistoricDecisionInstancesByQueryCriteria
import org.camunda.bpm.engine.history.HistoricDecisionInstance; //导入依赖的package包/类
public List<HistoricDecisionInstance> findHistoricDecisionInstancesByQueryCriteria(HistoricDecisionInstanceQueryImpl query, Page page) {
if (isHistoryEnabled()) {
configureQuery(query);
@SuppressWarnings("unchecked")
List<HistoricDecisionInstance> decisionInstances = getDbEntityManager().selectList("selectHistoricDecisionInstancesByQueryCriteria", query, page);
Map<String, HistoricDecisionInstanceEntity> decisionInstancesById = new HashMap<String, HistoricDecisionInstanceEntity>();
for(HistoricDecisionInstance decisionInstance : decisionInstances) {
decisionInstancesById.put(decisionInstance.getId(), (HistoricDecisionInstanceEntity) decisionInstance);
}
if (!decisionInstances.isEmpty() && query.isIncludeInput()) {
appendHistoricDecisionInputInstances(decisionInstancesById, query);
}
if(!decisionInstances.isEmpty() && query.isIncludeOutputs()) {
appendHistoricDecisionOutputInstances(decisionInstancesById, query);
}
return decisionInstances;
} else {
return Collections.emptyList();
}
}
示例2: collectHistoricDecisionInstanceIds
import org.camunda.bpm.engine.history.HistoricDecisionInstance; //导入依赖的package包/类
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);
}
示例3: execute
import org.camunda.bpm.engine.history.HistoricDecisionInstance; //导入依赖的package包/类
@Override
public Object execute(CommandContext commandContext) {
ensureNotNull("historicDecisionInstanceId", historicDecisionInstanceId);
HistoricDecisionInstance historicDecisionInstance = commandContext
.getHistoricDecisionInstanceManager()
.findHistoricDecisionInstance(historicDecisionInstanceId);
ensureNotNull("No historic decision instance found with id: " + historicDecisionInstanceId,
"historicDecisionInstance", historicDecisionInstance);
for (CommandChecker checker : commandContext.getProcessEngineConfiguration().getCommandCheckers()) {
checker.checkDeleteHistoricDecisionInstance(historicDecisionInstance);
}
commandContext
.getHistoricDecisionInstanceManager()
.deleteHistoricDecisionInstanceByIds(Arrays.asList(historicDecisionInstanceId));
return null;
}
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:21,代码来源:DeleteHistoricDecisionInstanceByInstanceIdCmd.java
示例4: setsTenantIdForHistoricDecisionInstance
import org.camunda.bpm.engine.history.HistoricDecisionInstance; //导入依赖的package包/类
@Test
public void setsTenantIdForHistoricDecisionInstance() {
String tenantId = TENANT_ID;
StaticTenantIdTestProvider tenantIdProvider = new StaticTenantIdTestProvider(tenantId);
TestTenantIdProvider.delegate = tenantIdProvider;
testRule.deploy(DMN_FILE);
// if a decision definition is evaluated
engineRule.getDecisionService().evaluateDecisionTableByKey(DECISION_DEFINITION_KEY).variables(createVariables()).evaluate();
// then the tenant id provider can set the tenant id to a value
HistoricDecisionInstance historicDecisionInstance = engineRule.getHistoryService().createHistoricDecisionInstanceQuery().singleResult();
assertThat(historicDecisionInstance.getTenantId(), is(tenantId));
}
示例5: setNullTenantIdForHistoricDecisionInstance
import org.camunda.bpm.engine.history.HistoricDecisionInstance; //导入依赖的package包/类
@Test
public void setNullTenantIdForHistoricDecisionInstance() {
String tenantId = null;
StaticTenantIdTestProvider tenantIdProvider = new StaticTenantIdTestProvider(tenantId);
TestTenantIdProvider.delegate = tenantIdProvider;
testRule.deploy(DMN_FILE);
// if a decision definition is evaluated
engineRule.getDecisionService().evaluateDecisionTableByKey(DECISION_DEFINITION_KEY).variables(createVariables()).evaluate();
// then the tenant id provider can set the tenant id to null
HistoricDecisionInstance historicDecisionInstance = engineRule.getHistoryService().createHistoricDecisionInstanceQuery().singleResult();
assertThat(historicDecisionInstance.getTenantId(), is(nullValue()));
}
示例6: setsTenantIdForHistoricDecisionInstance_BusinessRuleTask
import org.camunda.bpm.engine.history.HistoricDecisionInstance; //导入依赖的package包/类
@Test
public void setsTenantIdForHistoricDecisionInstance_BusinessRuleTask() {
String tenantId = TENANT_ID;
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(tenantId));
}
示例7: setNullTenantIdForHistoricDecisionInstance_BusinessRuleTask
import org.camunda.bpm.engine.history.HistoricDecisionInstance; //导入依赖的package包/类
@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()));
}
示例8: testDeleteHistoricDecisionInstanceByInstanceIdWithoutAuthorization
import org.camunda.bpm.engine.history.HistoricDecisionInstance; //导入依赖的package包/类
public void testDeleteHistoricDecisionInstanceByInstanceIdWithoutAuthorization() {
// given
createGrantAuthorization(DECISION_DEFINITION, DECISION_DEFINITION_KEY, userId, READ_HISTORY);
startProcessInstanceAndEvaluateDecision();
HistoricDecisionInstanceQuery query = historyService.createHistoricDecisionInstanceQuery();
HistoricDecisionInstance historicDecisionInstance = query.includeInputs().includeOutputs().singleResult();
try {
// when
historyService.deleteHistoricDecisionInstanceByInstanceId(historicDecisionInstance.getId());
fail("expect authorization exception");
} catch (AuthorizationException e) {
// then
assertThat(e.getMessage(),
is("The user with id 'test' does not have 'DELETE_HISTORY' permission on resource 'testDecision' of type 'DecisionDefinition'."));
}
}
示例9: testDeleteHistoricDecisionInstanceByInstanceIdWithDeleteHistoryPermissionOnDecisionDefinition
import org.camunda.bpm.engine.history.HistoricDecisionInstance; //导入依赖的package包/类
public void testDeleteHistoricDecisionInstanceByInstanceIdWithDeleteHistoryPermissionOnDecisionDefinition() {
// given
createGrantAuthorization(DECISION_DEFINITION, DECISION_DEFINITION_KEY, userId, DELETE_HISTORY, READ_HISTORY);
startProcessInstanceAndEvaluateDecision();
HistoricDecisionInstanceQuery query = historyService.createHistoricDecisionInstanceQuery();
verifyQueryResults(query, 1);
HistoricDecisionInstance historicDecisionInstance = query.includeInputs().includeOutputs().singleResult();
// when
historyService.deleteHistoricDecisionInstanceByInstanceId(historicDecisionInstance.getId());
// then
verifyQueryResults(query, 0);
}
示例10: executeDecisionInstances
import org.camunda.bpm.engine.history.HistoricDecisionInstance; //导入依赖的package包/类
@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());
}
}
示例11: evaluateDecisionInstances
import org.camunda.bpm.engine.history.HistoricDecisionInstance; //导入依赖的package包/类
@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());
}
}
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:18,代码来源:BatchHistoricDecisionInstanceDeletionUserOperationTest.java
示例12: testMultipleDecisionInstances
import org.camunda.bpm.engine.history.HistoricDecisionInstance; //导入依赖的package包/类
@Deployment(resources = { DECISION_PROCESS, DECISION_SINGLE_OUTPUT_DMN })
public void testMultipleDecisionInstances() {
startProcessInstanceAndEvaluateDecision("a");
waitASignificantAmountOfTime();
startProcessInstanceAndEvaluateDecision("b");
List<HistoricDecisionInstance> historicDecisionInstances = historyService
.createHistoricDecisionInstanceQuery()
.includeInputs()
.orderByEvaluationTime().asc()
.list();
assertThat(historicDecisionInstances.size(), is(2));
List<HistoricDecisionInputInstance> inputsOfFirstDecision = historicDecisionInstances.get(0).getInputs();
assertThat(inputsOfFirstDecision.size(), is(1));
assertThat(inputsOfFirstDecision.get(0).getValue(), is((Object) "a"));
List<HistoricDecisionInputInstance> inputsOfSecondDecision = historicDecisionInstances.get(1).getInputs();
assertThat(inputsOfSecondDecision.size(), is(1));
assertThat(inputsOfSecondDecision.get(0).getValue(), is((Object) "b"));
}
示例13: testDecisionOutputInstanceProperties
import org.camunda.bpm.engine.history.HistoricDecisionInstance; //导入依赖的package包/类
@Deployment(resources = { DECISION_PROCESS, DECISION_SINGLE_OUTPUT_DMN })
public void testDecisionOutputInstanceProperties() {
startProcessInstanceAndEvaluateDecision();
HistoricDecisionInstance historicDecisionInstance = historyService.createHistoricDecisionInstanceQuery().includeOutputs().singleResult();
List<HistoricDecisionOutputInstance> outputs = historicDecisionInstance.getOutputs();
assertThat(outputs, is(notNullValue()));
assertThat(outputs.size(), is(1));
HistoricDecisionOutputInstance output = outputs.get(0);
assertThat(output.getDecisionInstanceId(), is(historicDecisionInstance.getId()));
assertThat(output.getClauseId(), is("out"));
assertThat(output.getClauseName(), is("output"));
assertThat(output.getRuleId(), is("rule"));
assertThat(output.getRuleOrder(), is(1));
assertThat(output.getVariableName(), is("result"));
}
示例14: testMultipleDecisionOutputInstances
import org.camunda.bpm.engine.history.HistoricDecisionInstance; //导入依赖的package包/类
@Deployment(resources = { DECISION_PROCESS, DECISION_MULTIPLE_OUTPUT_DMN })
public void testMultipleDecisionOutputInstances() {
startProcessInstanceAndEvaluateDecision();
HistoricDecisionInstance historicDecisionInstance = historyService.createHistoricDecisionInstanceQuery().includeOutputs().singleResult();
List<HistoricDecisionOutputInstance> outputs = historicDecisionInstance.getOutputs();
assertThat(outputs.size(), is(2));
HistoricDecisionOutputInstance firstOutput = outputs.get(0);
assertThat(firstOutput.getClauseId(), is("out1"));
assertThat(firstOutput.getRuleId(), is("rule1"));
assertThat(firstOutput.getRuleOrder(), is(1));
assertThat(firstOutput.getVariableName(), is("result1"));
assertThat(firstOutput.getValue(), is((Object) "okay"));
HistoricDecisionOutputInstance secondOutput = outputs.get(1);
assertThat(secondOutput.getClauseId(), is("out1"));
assertThat(secondOutput.getRuleId(), is("rule2"));
assertThat(secondOutput.getRuleOrder(), is(2));
assertThat(secondOutput.getVariableName(), is("result1"));
assertThat(secondOutput.getValue(), is((Object) "not okay"));
}
示例15: testCompoundDecisionOutputInstances
import org.camunda.bpm.engine.history.HistoricDecisionInstance; //导入依赖的package包/类
@Deployment(resources = { DECISION_PROCESS, DECISION_COMPOUND_OUTPUT_DMN })
public void testCompoundDecisionOutputInstances() {
startProcessInstanceAndEvaluateDecision();
HistoricDecisionInstance historicDecisionInstance = historyService.createHistoricDecisionInstanceQuery().includeOutputs().singleResult();
List<HistoricDecisionOutputInstance> outputs = historicDecisionInstance.getOutputs();
assertThat(outputs.size(), is(2));
HistoricDecisionOutputInstance firstOutput = outputs.get(0);
assertThat(firstOutput.getClauseId(), is("out1"));
assertThat(firstOutput.getRuleId(), is("rule1"));
assertThat(firstOutput.getRuleOrder(), is(1));
assertThat(firstOutput.getVariableName(), is("result1"));
assertThat(firstOutput.getValue(), is((Object) "okay"));
HistoricDecisionOutputInstance secondOutput = outputs.get(1);
assertThat(secondOutput.getClauseId(), is("out2"));
assertThat(secondOutput.getRuleId(), is("rule1"));
assertThat(secondOutput.getRuleOrder(), is(1));
assertThat(secondOutput.getVariableName(), is("result2"));
assertThat(secondOutput.getValue(), is((Object) "not okay"));
}