Search in sources :

Example 1 with ProcessDefinitionRetriever

use of org.activiti.engine.impl.util.ProcessDefinitionRetriever in project Activiti by Activiti.

the class CreateProcessInstanceCmd method execute.

public ProcessInstance execute(CommandContext commandContext) {
    DeploymentManager deploymentCache = commandContext.getProcessEngineConfiguration().getDeploymentManager();
    ProcessDefinitionRetriever processRetriever = new ProcessDefinitionRetriever(this.tenantId, deploymentCache);
    ProcessDefinition processDefinition = processRetriever.getProcessDefinition(this.processDefinitionId, this.processDefinitionKey);
    processInstanceHelper = commandContext.getProcessEngineConfiguration().getProcessInstanceHelper();
    return processInstanceHelper.createProcessInstance(processDefinition, businessKey, processInstanceName, variables, transientVariables);
}
Also used : DeploymentManager(org.activiti.engine.impl.persistence.deploy.DeploymentManager) ProcessDefinitionRetriever(org.activiti.engine.impl.util.ProcessDefinitionRetriever) ProcessDefinition(org.activiti.engine.repository.ProcessDefinition)

Example 2 with ProcessDefinitionRetriever

use of org.activiti.engine.impl.util.ProcessDefinitionRetriever in project Activiti by Activiti.

the class StartProcessInstanceCmd method execute.

public ProcessInstance execute(CommandContext commandContext) {
    DeploymentManager deploymentCache = commandContext.getProcessEngineConfiguration().getDeploymentManager();
    ProcessDefinitionRetriever processRetriever = new ProcessDefinitionRetriever(this.tenantId, deploymentCache);
    ProcessDefinition processDefinition = processRetriever.getProcessDefinition(this.processDefinitionId, this.processDefinitionKey);
    processInstanceHelper = commandContext.getProcessEngineConfiguration().getProcessInstanceHelper();
    ProcessInstance processInstance = createAndStartProcessInstance(processDefinition, businessKey, processInstanceName, variables, transientVariables);
    return processInstance;
}
Also used : DeploymentManager(org.activiti.engine.impl.persistence.deploy.DeploymentManager) ProcessDefinitionRetriever(org.activiti.engine.impl.util.ProcessDefinitionRetriever) ProcessDefinition(org.activiti.engine.repository.ProcessDefinition) ProcessInstance(org.activiti.engine.runtime.ProcessInstance)

Aggregations

DeploymentManager (org.activiti.engine.impl.persistence.deploy.DeploymentManager)2 ProcessDefinitionRetriever (org.activiti.engine.impl.util.ProcessDefinitionRetriever)2 ProcessDefinition (org.activiti.engine.repository.ProcessDefinition)2 ProcessInstance (org.activiti.engine.runtime.ProcessInstance)1