Search in sources :

Example 11 with HistoricDecisionOutputInstance

use of org.camunda.bpm.engine.history.HistoricDecisionOutputInstance in project camunda-bpm-platform by camunda.

the class HistoricDecisionInstanceManager method insertHistoricDecisionOutputInstances.

protected void insertHistoricDecisionOutputInstances(List<HistoricDecisionOutputInstance> outputs, String decisionInstanceId) {
    for (HistoricDecisionOutputInstance output : outputs) {
        HistoricDecisionOutputInstanceEntity outputEntity = (HistoricDecisionOutputInstanceEntity) output;
        outputEntity.setDecisionInstanceId(decisionInstanceId);
        getDbEntityManager().insert(outputEntity);
    }
}
Also used : HistoricDecisionOutputInstance(org.camunda.bpm.engine.history.HistoricDecisionOutputInstance)

Example 12 with HistoricDecisionOutputInstance

use of org.camunda.bpm.engine.history.HistoricDecisionOutputInstance in project camunda-bpm-platform by camunda.

the class HistoricDecisionInstanceInputOutputValueTest method decisionOutputInstanceValue.

@Test
@Deployment(resources = { DECISION_PROCESS, DECISION_SINGLE_OUTPUT_DMN })
public void decisionOutputInstanceValue() {
    startProcessInstanceAndEvaluateDecision(inputValue);
    HistoricDecisionInstance historicDecisionInstance = engineRule.getHistoryService().createHistoricDecisionInstanceQuery().includeOutputs().singleResult();
    List<HistoricDecisionOutputInstance> outputInstances = historicDecisionInstance.getOutputs();
    assertThat(outputInstances.size(), is(1));
    HistoricDecisionOutputInstance outputInstance = outputInstances.get(0);
    assertThat(outputInstance.getTypeName(), is(valueType));
    assertThat(outputInstance.getValue(), is(inputValue));
}
Also used : HistoricDecisionInstance(org.camunda.bpm.engine.history.HistoricDecisionInstance) HistoricDecisionOutputInstance(org.camunda.bpm.engine.history.HistoricDecisionOutputInstance) Test(org.junit.Test) Deployment(org.camunda.bpm.engine.test.Deployment)

Example 13 with HistoricDecisionOutputInstance

use of org.camunda.bpm.engine.history.HistoricDecisionOutputInstance in project camunda-bpm-platform by camunda.

the class HistoricDecisionInstanceTest method testMultipleDecisionOutputInstances.

@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"));
}
Also used : HistoricDecisionInstance(org.camunda.bpm.engine.history.HistoricDecisionInstance) HistoricDecisionOutputInstance(org.camunda.bpm.engine.history.HistoricDecisionOutputInstance) Deployment(org.camunda.bpm.engine.test.Deployment)

Example 14 with HistoricDecisionOutputInstance

use of org.camunda.bpm.engine.history.HistoricDecisionOutputInstance in project camunda-bpm-platform by camunda.

the class HistoricDecisionInstanceTest method testDecisionOutputInstanceProperties.

@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"));
}
Also used : HistoricDecisionInstance(org.camunda.bpm.engine.history.HistoricDecisionInstance) HistoricDecisionOutputInstance(org.camunda.bpm.engine.history.HistoricDecisionOutputInstance) Deployment(org.camunda.bpm.engine.test.Deployment)

Aggregations

HistoricDecisionOutputInstance (org.camunda.bpm.engine.history.HistoricDecisionOutputInstance)14 HistoricDecisionInstance (org.camunda.bpm.engine.history.HistoricDecisionInstance)9 Deployment (org.camunda.bpm.engine.test.Deployment)6 HistoricDecisionInputInstance (org.camunda.bpm.engine.history.HistoricDecisionInputInstance)4 ArrayList (java.util.ArrayList)2 ProcessEngineException (org.camunda.bpm.engine.ProcessEngineException)2 HistoricDecisionOutputInstanceEntity (org.camunda.bpm.engine.impl.history.event.HistoricDecisionOutputInstanceEntity)2 DecisionDefinition (org.camunda.bpm.engine.repository.DecisionDefinition)2 DmnDecisionLiteralExpressionEvaluationEvent (org.camunda.bpm.dmn.engine.delegate.DmnDecisionLiteralExpressionEvaluationEvent)1 DmnDecisionTableEvaluationEvent (org.camunda.bpm.dmn.engine.delegate.DmnDecisionTableEvaluationEvent)1 DmnEvaluatedDecisionRule (org.camunda.bpm.dmn.engine.delegate.DmnEvaluatedDecisionRule)1 DmnEvaluatedOutput (org.camunda.bpm.dmn.engine.delegate.DmnEvaluatedOutput)1 HistoricDecisionInstanceQuery (org.camunda.bpm.engine.history.HistoricDecisionInstanceQuery)1 VariableMap (org.camunda.bpm.engine.variable.VariableMap)1 ObjectValue (org.camunda.bpm.engine.variable.value.ObjectValue)1 Test (org.junit.Test)1