use of org.camunda.bpm.engine.repository.DecisionDefinition in project camunda-bpm-platform by camunda.
the class DefaultDmnHistoryEventProducer method createDecisionEvaluatedEvt.
protected HistoricDecisionInstanceEntity createDecisionEvaluatedEvt(DmnDecisionLogicEvaluationEvent evaluationEvent, CaseExecutionEntity execution) {
// create event instance
HistoricDecisionInstanceEntity event = newDecisionInstanceEventEntity(execution, evaluationEvent);
// initialize event
initDecisionInstanceEvent(event, evaluationEvent, HistoryEventTypes.DMN_DECISION_EVALUATE);
setReferenceToCaseInstance(event, execution);
// set current time as evaluation time
event.setEvaluationTime(ClockUtil.getCurrentTime());
DecisionDefinition decisionDefinition = (DecisionDefinition) evaluationEvent.getDecision();
String tenantId = execution.getTenantId();
if (tenantId == null) {
tenantId = provideTenantId(decisionDefinition, event);
}
event.setTenantId(tenantId);
return event;
}
use of org.camunda.bpm.engine.repository.DecisionDefinition in project camunda-bpm-platform by camunda.
the class DefaultDmnHistoryEventProducer method createDecisionEvaluatedEvt.
protected HistoricDecisionInstanceEntity createDecisionEvaluatedEvt(DmnDecisionLogicEvaluationEvent evaluationEvent, ExecutionEntity execution) {
// create event instance
HistoricDecisionInstanceEntity event = newDecisionInstanceEventEntity(execution, evaluationEvent);
// initialize event
initDecisionInstanceEvent(event, evaluationEvent, HistoryEventTypes.DMN_DECISION_EVALUATE);
setReferenceToProcessInstance(event, execution);
// set current time as evaluation time
event.setEvaluationTime(ClockUtil.getCurrentTime());
DecisionDefinition decisionDefinition = (DecisionDefinition) evaluationEvent.getDecision();
String tenantId = execution.getTenantId();
if (tenantId == null) {
tenantId = provideTenantId(decisionDefinition, event);
}
event.setTenantId(tenantId);
return event;
}
use of org.camunda.bpm.engine.repository.DecisionDefinition in project camunda-bpm-platform by camunda.
the class DefaultDmnHistoryEventProducer method createDecisionEvaluatedEvt.
protected HistoricDecisionInstanceEntity createDecisionEvaluatedEvt(DmnDecisionLogicEvaluationEvent evaluationEvent) {
// create event instance
HistoricDecisionInstanceEntity event = newDecisionInstanceEventEntity(evaluationEvent);
// initialize event
initDecisionInstanceEvent(event, evaluationEvent, HistoryEventTypes.DMN_DECISION_EVALUATE);
// set current time as evaluation time
event.setEvaluationTime(ClockUtil.getCurrentTime());
// set the user id if there is an authenticated user and no process instance
setUserId(event);
DecisionDefinition decisionDefinition = (DecisionDefinition) evaluationEvent.getDecision();
String tenantId = decisionDefinition.getTenantId();
if (tenantId == null) {
tenantId = provideTenantId(decisionDefinition, event);
}
event.setTenantId(tenantId);
return event;
}
use of org.camunda.bpm.engine.repository.DecisionDefinition in project camunda-bpm-platform by camunda.
the class DeploymentManager method deleteDecisionDeployment.
protected void deleteDecisionDeployment(String deploymentId, boolean cascade) {
ProcessEngineConfigurationImpl processEngineConfiguration = Context.getProcessEngineConfiguration();
if (processEngineConfiguration.isDmnEnabled()) {
DecisionDefinitionManager decisionDefinitionManager = getDecisionDefinitionManager();
List<DecisionDefinition> decisionDefinitions = decisionDefinitionManager.findDecisionDefinitionByDeploymentId(deploymentId);
if (cascade) {
// delete historic decision instances
for (DecisionDefinition decisionDefinition : decisionDefinitions) {
getHistoricDecisionInstanceManager().deleteHistoricDecisionInstancesByDecisionDefinitionId(decisionDefinition.getId());
}
}
// delete decision definitions from db
decisionDefinitionManager.deleteDecisionDefinitionsByDeploymentId(deploymentId);
DeploymentCache deploymentCache = processEngineConfiguration.getDeploymentCache();
for (DecisionDefinition decisionDefinition : decisionDefinitions) {
String decisionDefinitionId = decisionDefinition.getId();
// remove decision definitions from cache:
deploymentCache.removeDecisionDefinition(decisionDefinitionId);
}
}
}
use of org.camunda.bpm.engine.repository.DecisionDefinition in project camunda-bpm-platform by camunda.
the class DecisionServiceTest method evaluateDecisionTableByKeyWithNonExistingVersion.
@Deployment(resources = DMN_DECISION_TABLE)
@Test
public void evaluateDecisionTableByKeyWithNonExistingVersion() {
DecisionDefinition decisionDefinition = repositoryService.createDecisionDefinitionQuery().singleResult();
thrown.expect(NotFoundException.class);
thrown.expectMessage("no decision definition deployed with key = 'decision' and version = '42'");
decisionService.evaluateDecisionTableByKeyAndVersion(decisionDefinition.getKey(), 42, null);
}
Aggregations