Search in sources :

Example 1 with HistoricDecisionOutputInstanceEntity

use of org.camunda.bpm.engine.impl.history.event.HistoricDecisionOutputInstanceEntity in project camunda-bpm-platform by camunda.

the class DefaultDmnHistoryEventProducer method initDecisionInstanceEventForDecisionLiteralExpression.

protected void initDecisionInstanceEventForDecisionLiteralExpression(HistoricDecisionInstanceEntity event, DmnDecisionLiteralExpressionEvaluationEvent evaluationEvent) {
    // no inputs for expression
    event.setInputs(Collections.<HistoricDecisionInputInstance>emptyList());
    HistoricDecisionOutputInstanceEntity outputInstance = new HistoricDecisionOutputInstanceEntity();
    outputInstance.setVariableName(evaluationEvent.getOutputName());
    outputInstance.setValue(evaluationEvent.getOutputValue());
    event.setOutputs(Collections.<HistoricDecisionOutputInstance>singletonList(outputInstance));
}
Also used : HistoricDecisionOutputInstanceEntity(org.camunda.bpm.engine.impl.history.event.HistoricDecisionOutputInstanceEntity)

Example 2 with HistoricDecisionOutputInstanceEntity

use of org.camunda.bpm.engine.impl.history.event.HistoricDecisionOutputInstanceEntity in project camunda-bpm-platform by camunda.

the class BulkHistoryDeleteTest method collectHistoricDecisionOutputIds.

private void collectHistoricDecisionOutputIds(List<HistoricDecisionInstance> historicDecisionInstances, List<String> historicDecisionOutputIds, List<String> outputByteArrayId) {
    for (HistoricDecisionInstance historicDecisionInstance : historicDecisionInstances) {
        for (HistoricDecisionOutputInstance outputInstanceEntity : historicDecisionInstance.getOutputs()) {
            historicDecisionOutputIds.add(outputInstanceEntity.getId());
            final String byteArrayValueId = ((HistoricDecisionOutputInstanceEntity) outputInstanceEntity).getByteArrayValueId();
            if (byteArrayValueId != null) {
                outputByteArrayId.add(byteArrayValueId);
            }
        }
    }
    assertEquals(PROCESS_INSTANCE_COUNT, historicDecisionOutputIds.size());
}
Also used : HistoricDecisionOutputInstanceEntity(org.camunda.bpm.engine.impl.history.event.HistoricDecisionOutputInstanceEntity) HistoricDecisionInstance(org.camunda.bpm.engine.history.HistoricDecisionInstance) HistoricDecisionOutputInstance(org.camunda.bpm.engine.history.HistoricDecisionOutputInstance)

Example 3 with HistoricDecisionOutputInstanceEntity

use of org.camunda.bpm.engine.impl.history.event.HistoricDecisionOutputInstanceEntity in project camunda-bpm-platform by camunda.

the class DefaultDmnHistoryEventProducer method createHistoricDecisionOutputInstances.

protected List<HistoricDecisionOutputInstance> createHistoricDecisionOutputInstances(DmnDecisionTableEvaluationEvent evaluationEvent) {
    List<HistoricDecisionOutputInstance> outputInstances = new ArrayList<HistoricDecisionOutputInstance>();
    List<DmnEvaluatedDecisionRule> matchingRules = evaluationEvent.getMatchingRules();
    for (int index = 0; index < matchingRules.size(); index++) {
        DmnEvaluatedDecisionRule rule = matchingRules.get(index);
        String ruleId = rule.getId();
        Integer ruleOrder = index + 1;
        for (DmnEvaluatedOutput outputClause : rule.getOutputEntries().values()) {
            HistoricDecisionOutputInstanceEntity outputInstance = new HistoricDecisionOutputInstanceEntity();
            outputInstance.setClauseId(outputClause.getId());
            outputInstance.setClauseName(outputClause.getName());
            outputInstance.setRuleId(ruleId);
            outputInstance.setRuleOrder(ruleOrder);
            outputInstance.setVariableName(outputClause.getOutputName());
            outputInstance.setValue(outputClause.getValue());
            outputInstances.add(outputInstance);
        }
    }
    return outputInstances;
}
Also used : HistoricDecisionOutputInstanceEntity(org.camunda.bpm.engine.impl.history.event.HistoricDecisionOutputInstanceEntity) ArrayList(java.util.ArrayList) DmnEvaluatedOutput(org.camunda.bpm.dmn.engine.delegate.DmnEvaluatedOutput) DmnEvaluatedDecisionRule(org.camunda.bpm.dmn.engine.delegate.DmnEvaluatedDecisionRule) HistoricDecisionOutputInstance(org.camunda.bpm.engine.history.HistoricDecisionOutputInstance)

Aggregations

HistoricDecisionOutputInstanceEntity (org.camunda.bpm.engine.impl.history.event.HistoricDecisionOutputInstanceEntity)3 HistoricDecisionOutputInstance (org.camunda.bpm.engine.history.HistoricDecisionOutputInstance)2 ArrayList (java.util.ArrayList)1 DmnEvaluatedDecisionRule (org.camunda.bpm.dmn.engine.delegate.DmnEvaluatedDecisionRule)1 DmnEvaluatedOutput (org.camunda.bpm.dmn.engine.delegate.DmnEvaluatedOutput)1 HistoricDecisionInstance (org.camunda.bpm.engine.history.HistoricDecisionInstance)1