use of org.camunda.bpm.engine.impl.cmmn.entity.repository.CaseDefinitionEntity in project camunda-bpm-platform by camunda.
the class GetDeploymentCaseDiagramCmd method execute.
@Override
public InputStream execute(final CommandContext commandContext) {
CaseDefinitionEntity caseDefinition = Context.getProcessEngineConfiguration().getDeploymentCache().findDeployedCaseDefinitionById(caseDefinitionId);
for (CommandChecker checker : commandContext.getProcessEngineConfiguration().getCommandCheckers()) {
checker.checkReadCaseDefinition(caseDefinition);
}
final String deploymentId = caseDefinition.getDeploymentId();
final String resourceName = caseDefinition.getDiagramResourceName();
InputStream caseDiagramStream = null;
if (resourceName != null) {
caseDiagramStream = commandContext.runWithoutAuthorization(new Callable<InputStream>() {
public InputStream call() throws Exception {
return new GetDeploymentResourceCmd(deploymentId, resourceName).execute(commandContext);
}
});
}
return caseDiagramStream;
}
use of org.camunda.bpm.engine.impl.cmmn.entity.repository.CaseDefinitionEntity in project camunda-bpm-platform by camunda.
the class CaseExecutionEntity method ensureCaseDefinitionInitialized.
protected void ensureCaseDefinitionInitialized() {
if ((caseDefinition == null) && (caseDefinitionId != null)) {
CaseDefinitionEntity deployedCaseDefinition = Context.getProcessEngineConfiguration().getDeploymentCache().getCaseDefinitionById(caseDefinitionId);
setCaseDefinition(deployedCaseDefinition);
}
}
use of org.camunda.bpm.engine.impl.cmmn.entity.repository.CaseDefinitionEntity in project camunda-bpm-platform by camunda.
the class CaseHandler method initializeActivity.
protected void initializeActivity(Case element, CmmnActivity activity, CmmnHandlerContext context) {
CaseDefinitionEntity definition = (CaseDefinitionEntity) activity;
Deployment deployment = context.getDeployment();
definition.setKey(element.getId());
definition.setName(element.getName());
definition.setDeploymentId(deployment.getId());
definition.setTaskDefinitions(new HashMap<String, TaskDefinition>());
definition.setHistoryTimeToLive(ParseUtil.parseHistoryTimeToLive(element.getCamundaHistoryTimeToLiveString()));
CmmnModelInstance model = context.getModel();
Definitions definitions = model.getDefinitions();
String category = definitions.getTargetNamespace();
definition.setCategory(category);
}
use of org.camunda.bpm.engine.impl.cmmn.entity.repository.CaseDefinitionEntity in project camunda-bpm-platform by camunda.
the class CaseHandler method createActivity.
protected CaseDefinitionEntity createActivity(CmmnElement element, CmmnHandlerContext context) {
CaseDefinitionEntity definition = new CaseDefinitionEntity();
definition.setCmmnElement(element);
return definition;
}
use of org.camunda.bpm.engine.impl.cmmn.entity.repository.CaseDefinitionEntity in project camunda-bpm-platform by camunda.
the class UpdateCaseDefinitionHistoryTimeToLiveCmd method execute.
@Override
public Void execute(CommandContext commandContext) {
ensureNotNull(BadUserRequestException.class, "caseDefinitionId", caseDefinitionId);
if (historyTimeToLive != null) {
ensureGreaterThanOrEqual(BadUserRequestException.class, "", "historyTimeToLive", historyTimeToLive, 0);
}
CaseDefinitionEntity caseDefinitionEntity = commandContext.getCaseDefinitionManager().findLatestDefinitionById(caseDefinitionId);
for (CommandChecker checker : commandContext.getProcessEngineConfiguration().getCommandCheckers()) {
checker.checkUpdateCaseDefinition(caseDefinitionEntity);
}
caseDefinitionEntity.setHistoryTimeToLive(historyTimeToLive);
return null;
}
Aggregations