use of org.camunda.bpm.engine.impl.persistence.entity.ProcessDefinitionEntity in project camunda-bpm-platform by camunda.
the class EvaluateStartConditionCmd method instantiateProcess.
protected ProcessInstance instantiateProcess(CommandContext commandContext, ConditionHandlerResult result) {
ProcessDefinitionEntity processDefinitionEntity = result.getProcessDefinition();
ActivityImpl startEvent = processDefinitionEntity.findActivity(result.getActivity().getActivityId());
ExecutionEntity processInstance = processDefinitionEntity.createProcessInstance(builder.getBusinessKey(), startEvent);
processInstance.start(builder.getVariables());
return processInstance;
}
use of org.camunda.bpm.engine.impl.persistence.entity.ProcessDefinitionEntity in project camunda-bpm-platform by camunda.
the class GetDeploymentProcessDiagramCmd method execute.
public InputStream execute(final CommandContext commandContext) {
ProcessDefinitionEntity processDefinition = Context.getProcessEngineConfiguration().getDeploymentCache().findDeployedProcessDefinitionById(processDefinitionId);
for (CommandChecker checker : commandContext.getProcessEngineConfiguration().getCommandCheckers()) {
checker.checkReadProcessDefinition(processDefinition);
}
final String deploymentId = processDefinition.getDeploymentId();
final String resourceName = processDefinition.getDiagramResourceName();
if (resourceName == null) {
return null;
} else {
InputStream processDiagramStream = commandContext.runWithoutAuthorization(new Callable<InputStream>() {
public InputStream call() throws Exception {
return new GetDeploymentResourceCmd(deploymentId, resourceName).execute(commandContext);
}
});
return processDiagramStream;
}
}
use of org.camunda.bpm.engine.impl.persistence.entity.ProcessDefinitionEntity in project camunda-bpm-platform by camunda.
the class ProcessDefinitionQueryImpl method addProcessDefinitionToCacheAndRetrieveDocumentation.
protected void addProcessDefinitionToCacheAndRetrieveDocumentation(List<ProcessDefinition> list) {
for (ProcessDefinition processDefinition : list) {
BpmnModelInstance bpmnModelInstance = Context.getProcessEngineConfiguration().getDeploymentCache().findBpmnModelInstanceForProcessDefinition((ProcessDefinitionEntity) processDefinition);
ModelElementInstance processElement = bpmnModelInstance.getModelElementById(processDefinition.getKey());
if (processElement != null) {
Collection<Documentation> documentations = processElement.getChildElementsByType(Documentation.class);
List<String> docStrings = new ArrayList<String>();
for (Documentation documentation : documentations) {
docStrings.add(documentation.getTextContent());
}
ProcessDefinitionEntity processDefinitionEntity = (ProcessDefinitionEntity) processDefinition;
processDefinitionEntity.setProperty(BpmnParse.PROPERTYNAME_DOCUMENTATION, BpmnParse.parseDocumentation(docStrings));
}
}
}
use of org.camunda.bpm.engine.impl.persistence.entity.ProcessDefinitionEntity in project camunda-bpm-platform by camunda.
the class CreateMigrationPlanCmd method execute.
@Override
public MigrationPlan execute(CommandContext commandContext) {
ProcessDefinitionEntity sourceProcessDefinition = getProcessDefinition(commandContext, migrationBuilder.getSourceProcessDefinitionId(), "Source");
ProcessDefinitionEntity targetProcessDefinition = getProcessDefinition(commandContext, migrationBuilder.getTargetProcessDefinitionId(), "Target");
checkAuthorization(commandContext, sourceProcessDefinition, targetProcessDefinition);
MigrationPlanImpl migrationPlan = new MigrationPlanImpl(sourceProcessDefinition.getId(), targetProcessDefinition.getId());
List<MigrationInstruction> instructions = new ArrayList<MigrationInstruction>();
if (migrationBuilder.isMapEqualActivities()) {
instructions.addAll(generateInstructions(commandContext, sourceProcessDefinition, targetProcessDefinition, migrationBuilder.isUpdateEventTriggersForGeneratedInstructions()));
}
instructions.addAll(migrationBuilder.getExplicitMigrationInstructions());
migrationPlan.setInstructions(instructions);
validateMigrationPlan(commandContext, migrationPlan, sourceProcessDefinition, targetProcessDefinition);
return migrationPlan;
}
use of org.camunda.bpm.engine.impl.persistence.entity.ProcessDefinitionEntity in project camunda-bpm-platform by camunda.
the class DeleteIdentityLinkForProcessDefinitionCmd method execute.
public Void execute(CommandContext commandContext) {
ProcessDefinitionEntity processDefinition = Context.getCommandContext().getProcessDefinitionManager().findLatestProcessDefinitionById(processDefinitionId);
ensureNotNull("Cannot find process definition with id " + processDefinitionId, "processDefinition", processDefinition);
processDefinition.deleteIdentityLink(userId, groupId);
return null;
}
Aggregations