use of org.camunda.bpm.engine.impl.cmd.GetDeploymentResourceCmd in project camunda-bpm-platform by camunda.
the class GetDeploymentDecisionRequirementsDiagramCmd method execute.
public InputStream execute(final CommandContext commandContext) {
DecisionRequirementsDefinition decisionRequirementsDefinition = new GetDeploymentDecisionRequirementsDefinitionCmd(decisionRequirementsDefinitionId).execute(commandContext);
final String deploymentId = decisionRequirementsDefinition.getDeploymentId();
final String resourceName = decisionRequirementsDefinition.getDiagramResourceName();
if (resourceName != null) {
return commandContext.runWithoutAuthorization(new Callable<InputStream>() {
public InputStream call() throws Exception {
return new GetDeploymentResourceCmd(deploymentId, resourceName).execute(commandContext);
}
});
} else {
return null;
}
}
use of org.camunda.bpm.engine.impl.cmd.GetDeploymentResourceCmd in project camunda-bpm-platform by camunda.
the class ModelInstanceCache method loadAndCacheBpmnModelInstance.
protected InstanceType loadAndCacheBpmnModelInstance(final DefinitionType definitionEntity) {
final CommandContext commandContext = Context.getCommandContext();
InputStream bpmnResourceInputStream = commandContext.runWithoutAuthorization(new Callable<InputStream>() {
public InputStream call() throws Exception {
return new GetDeploymentResourceCmd(definitionEntity.getDeploymentId(), definitionEntity.getResourceName()).execute(commandContext);
}
});
try {
InstanceType bpmnModelInstance = readModelFromStream(bpmnResourceInputStream);
instanceCache.put(definitionEntity.getId(), bpmnModelInstance);
return bpmnModelInstance;
} catch (Exception e) {
throwLoadModelException(definitionEntity.getId(), e);
}
return null;
}
Aggregations