use of org.camunda.bpm.engine.impl.persistence.entity.ProcessDefinitionEntity in project camunda-bpm-platform by camunda.
the class GetDeploymentProcessDiagramLayoutCmd method execute.
public DiagramLayout execute(final CommandContext commandContext) {
ProcessDefinitionEntity processDefinition = Context.getProcessEngineConfiguration().getDeploymentCache().findDeployedProcessDefinitionById(processDefinitionId);
for (CommandChecker checker : commandContext.getProcessEngineConfiguration().getCommandCheckers()) {
checker.checkReadProcessDefinition(processDefinition);
}
InputStream processModelStream = commandContext.runWithoutAuthorization(new Callable<InputStream>() {
public InputStream call() throws Exception {
return new GetDeploymentProcessModelCmd(processDefinitionId).execute(commandContext);
}
});
InputStream processDiagramStream = commandContext.runWithoutAuthorization(new Callable<InputStream>() {
public InputStream call() throws Exception {
return new GetDeploymentProcessDiagramCmd(processDefinitionId).execute(commandContext);
}
});
return new ProcessDiagramLayoutFactory().getProcessDiagramLayout(processModelStream, processDiagramStream);
}
use of org.camunda.bpm.engine.impl.persistence.entity.ProcessDefinitionEntity in project camunda-bpm-platform by camunda.
the class DefaultJobRetryCmd method getCurrentActivity.
protected ActivityImpl getCurrentActivity(CommandContext commandContext, JobEntity job) {
String type = job.getJobHandlerType();
ActivityImpl activity = null;
if (SUPPORTED_TYPES.contains(type)) {
DeploymentCache deploymentCache = Context.getProcessEngineConfiguration().getDeploymentCache();
ProcessDefinitionEntity processDefinitionEntity = deploymentCache.findDeployedProcessDefinitionById(job.getProcessDefinitionId());
activity = processDefinitionEntity.findActivity(job.getActivityId());
} else {
// noop, because activity type is not supported
}
return activity;
}
use of org.camunda.bpm.engine.impl.persistence.entity.ProcessDefinitionEntity in project camunda-bpm-platform by camunda.
the class SignalEventHandler method handleStartEvent.
protected void handleStartEvent(EventSubscriptionEntity eventSubscription, Map<String, Object> payload, String businessKey, CommandContext commandContext) {
String processDefinitionId = eventSubscription.getConfiguration();
ensureNotNull("Configuration of signal start event subscription '" + eventSubscription.getId() + "' contains no process definition id.", processDefinitionId);
DeploymentCache deploymentCache = Context.getProcessEngineConfiguration().getDeploymentCache();
ProcessDefinitionEntity processDefinition = deploymentCache.findDeployedProcessDefinitionById(processDefinitionId);
if (processDefinition == null || processDefinition.isSuspended()) {
// ignore event subscription
LOG.debugIgnoringEventSubscription(eventSubscription, processDefinitionId);
} else {
ActivityImpl signalStartEvent = processDefinition.findActivity(eventSubscription.getActivityId());
PvmProcessInstance processInstance = processDefinition.createProcessInstance(businessKey, signalStartEvent);
processInstance.start(payload);
}
}
use of org.camunda.bpm.engine.impl.persistence.entity.ProcessDefinitionEntity in project camunda-bpm-platform by camunda.
the class FoxFailedJobParseListenerTest method findActivity.
protected ActivityImpl findActivity(ProcessInstance pi, String activityId) {
ProcessInstanceWithVariablesImpl entity = (ProcessInstanceWithVariablesImpl) pi;
ProcessDefinitionEntity processDefEntity = entity.getExecutionEntity().getProcessDefinition();
assertNotNull(processDefEntity);
ActivityImpl activity = processDefEntity.findActivity(activityId);
assertNotNull(activity);
return activity;
}
use of org.camunda.bpm.engine.impl.persistence.entity.ProcessDefinitionEntity in project camunda-bpm-platform by camunda.
the class AbstractMigrationCmd method resolveSourceProcessDefinition.
protected ProcessDefinitionEntity resolveSourceProcessDefinition(CommandContext commandContext) {
String sourceProcessDefinitionId = executionBuilder.getMigrationPlan().getSourceProcessDefinitionId();
ProcessDefinitionEntity sourceProcessDefinition = getProcessDefinition(commandContext, sourceProcessDefinitionId);
EnsureUtil.ensureNotNull("sourceProcessDefinition", sourceProcessDefinition);
return sourceProcessDefinition;
}
Aggregations