Search in sources :

Example 1 with GetDeploymentResourceCmd

use of org.camunda.bpm.engine.impl.cmd.GetDeploymentResourceCmd in project camunda-bpm-platform by camunda.

the class GetDeploymentDecisionModelCmd method execute.

public InputStream execute(final CommandContext commandContext) {
    DecisionDefinition decisionDefinition = new GetDeploymentDecisionDefinitionCmd(decisionDefinitionId).execute(commandContext);
    final String deploymentId = decisionDefinition.getDeploymentId();
    final String resourceName = decisionDefinition.getResourceName();
    return commandContext.runWithoutAuthorization(new Callable<InputStream>() {

        public InputStream call() throws Exception {
            return new GetDeploymentResourceCmd(deploymentId, resourceName).execute(commandContext);
        }
    });
}
Also used : InputStream(java.io.InputStream) GetDeploymentResourceCmd(org.camunda.bpm.engine.impl.cmd.GetDeploymentResourceCmd) DecisionDefinition(org.camunda.bpm.engine.repository.DecisionDefinition)

Example 2 with GetDeploymentResourceCmd

use of org.camunda.bpm.engine.impl.cmd.GetDeploymentResourceCmd in project camunda-bpm-platform by camunda.

the class GetDeploymentDecisionDiagramCmd method execute.

public InputStream execute(final CommandContext commandContext) {
    DecisionDefinition decisionDefinition = new GetDeploymentDecisionDefinitionCmd(decisionDefinitionId).execute(commandContext);
    final String deploymentId = decisionDefinition.getDeploymentId();
    final String resourceName = decisionDefinition.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;
    }
}
Also used : InputStream(java.io.InputStream) GetDeploymentResourceCmd(org.camunda.bpm.engine.impl.cmd.GetDeploymentResourceCmd) DecisionDefinition(org.camunda.bpm.engine.repository.DecisionDefinition)

Example 3 with GetDeploymentResourceCmd

use of org.camunda.bpm.engine.impl.cmd.GetDeploymentResourceCmd 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;
}
Also used : InputStream(java.io.InputStream) CaseDefinitionEntity(org.camunda.bpm.engine.impl.cmmn.entity.repository.CaseDefinitionEntity) GetDeploymentResourceCmd(org.camunda.bpm.engine.impl.cmd.GetDeploymentResourceCmd) CommandChecker(org.camunda.bpm.engine.impl.cfg.CommandChecker) Callable(java.util.concurrent.Callable)

Example 4 with GetDeploymentResourceCmd

use of org.camunda.bpm.engine.impl.cmd.GetDeploymentResourceCmd in project camunda-bpm-platform by camunda.

the class GetDeploymentCaseModelCmd method execute.

public InputStream execute(final CommandContext commandContext) {
    ensureNotNull("caseDefinitionId", caseDefinitionId);
    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.getResourceName();
    InputStream inputStream = commandContext.runWithoutAuthorization(new Callable<InputStream>() {

        public InputStream call() throws Exception {
            return new GetDeploymentResourceCmd(deploymentId, resourceName).execute(commandContext);
        }
    });
    return inputStream;
}
Also used : InputStream(java.io.InputStream) CaseDefinitionEntity(org.camunda.bpm.engine.impl.cmmn.entity.repository.CaseDefinitionEntity) GetDeploymentResourceCmd(org.camunda.bpm.engine.impl.cmd.GetDeploymentResourceCmd) CommandChecker(org.camunda.bpm.engine.impl.cfg.CommandChecker)

Example 5 with GetDeploymentResourceCmd

use of org.camunda.bpm.engine.impl.cmd.GetDeploymentResourceCmd in project camunda-bpm-platform by camunda.

the class GetDeploymentDecisionRequirementsModelCmd method execute.

public InputStream execute(final CommandContext commandContext) {
    DecisionRequirementsDefinition decisionRequirementsDefinition = new GetDeploymentDecisionRequirementsDefinitionCmd(decisionRequirementsDefinitionId).execute(commandContext);
    final String deploymentId = decisionRequirementsDefinition.getDeploymentId();
    final String resourceName = decisionRequirementsDefinition.getResourceName();
    return commandContext.runWithoutAuthorization(new Callable<InputStream>() {

        public InputStream call() throws Exception {
            return new GetDeploymentResourceCmd(deploymentId, resourceName).execute(commandContext);
        }
    });
}
Also used : DecisionRequirementsDefinition(org.camunda.bpm.engine.repository.DecisionRequirementsDefinition) InputStream(java.io.InputStream) GetDeploymentResourceCmd(org.camunda.bpm.engine.impl.cmd.GetDeploymentResourceCmd)

Aggregations

InputStream (java.io.InputStream)7 GetDeploymentResourceCmd (org.camunda.bpm.engine.impl.cmd.GetDeploymentResourceCmd)7 CommandChecker (org.camunda.bpm.engine.impl.cfg.CommandChecker)2 CaseDefinitionEntity (org.camunda.bpm.engine.impl.cmmn.entity.repository.CaseDefinitionEntity)2 DecisionDefinition (org.camunda.bpm.engine.repository.DecisionDefinition)2 DecisionRequirementsDefinition (org.camunda.bpm.engine.repository.DecisionRequirementsDefinition)2 Callable (java.util.concurrent.Callable)1 CommandContext (org.camunda.bpm.engine.impl.interceptor.CommandContext)1