Resolving the process definition will fetch the BPMN 2.0, parse it and store the {@link BpmnModel} in memory.
195074
public ProcessDefinitionCacheEntry resolveProcessDefinition(ProcessDefinition processDefinition) {
    String processDefinitionId = processDefinition.getId();
    String deploymentId = processDefinition.getDeploymentId();

    ProcessDefinitionCacheEntry cachedProcessDefinition = processDefinitionCache.get(processDefinitionId);

    if (cachedProcessDefinition == null) {
      CommandContext commandContext = Context.getCommandContext();
      DeploymentEntity deployment = deploymentEntityManager.findById(deploymentId);
      deployment.setNew(false);
      deploy(deployment, null);
      cachedProcessDefinition = processDefinitionCache.get(processDefinitionId);

      if (cachedProcessDefinition == null) {
        throw new ActivitiException("deployment '" + deploymentId + "' didn't put process definition '" + processDefinitionId + "' in the cache");
      }
    }
    return cachedProcessDefinition;
  }
1208598
@Override
    public FileModel resolvePayload(GraphRewrite event, EvaluationContext context, WindupVertexFrame payload)
    {
        checkVariableName(event, context);
        if (payload instanceof FileReferenceModel)
        {
            return ((FileReferenceModel) payload).getFile();
        }
        if (payload instanceof FileModel)
        {
            return (FileModel) payload;
        }
        return null;
    }
1275565
@Override
	public TaskBase getTask(String processDefinitionName, Long taskid) {
		ProcessDefinition pd = getProcessDefinition(processDefinitionName);
		if (pd == null) {
			throw new WorkflowException("Could not find active process for "+processDefinitionName);
		}
		TaskBase task = getTask(pd,taskid);
		if (task == null) {
			throw new WorkflowException("Could not find task for "+processDefinitionName+":"+taskid);
		}
		return task;
	}
622500
private ClassReference processType(Type type, TypeReferenceLocation typeReferenceLocation, int lineNumber, int columnNumber, int length,
                String line)
    {
        if (type == null)
            return null;

        ITypeBinding resolveBinding = type.resolveBinding();
        if (resolveBinding == null)
        {
            ResolveClassnameResult resolvedResult = resolveClassname(type.toString());
            ResolutionStatus status = resolvedResult.found ? ResolutionStatus.RECOVERED : ResolutionStatus.UNRESOLVED;
            PackageAndClassName packageAndClassName = PackageAndClassName.parseFromQualifiedName(resolvedResult.result);

            return processTypeAsString(resolvedResult.result, packageAndClassName.packageName, packageAndClassName.className, status,
                        typeReferenceLocation, lineNumber,
                        columnNumber, length, line);
        }
        else
        {
            return processTypeBinding(type.resolveBinding(), ResolutionStatus.RESOLVED, typeReferenceLocation, lineNumber,
                        columnNumber, length, line);
        }

    }
101423
protected void ensureProcessDefinitionInitialized() {
    if ((processDefinition == null) && (processDefinitionId != null)) {
      ProcessDefinitionEntity deployedProcessDefinition = Context.getProcessEngineConfiguration().getDeploymentCache()
          .findDeployedProcessDefinitionById(processDefinitionId);
      setProcessDefinition(deployedProcessDefinition);
    }
  }
411381
public Map<Integer, Pair<ExecutionReference, ExecutableFlow>> fetchUnfinishedFlowsMetadata()
      throws ExecutorManagerException {
    try {
      return this.dbOperator.query(FetchUnfinishedFlowsMetadata.FETCH_UNFINISHED_FLOWS_METADATA,
          new FetchUnfinishedFlowsMetadata());
    } catch (final SQLException e) {
      throw new ExecutorManagerException("Error fetching unfinished flows metadata", e);
    }
  }
1137307
function Process(model, pid) {
    if (model === undefined)
      throw new Error('model must be provided');
    if (pid === undefined)
      throw new Error('pid must be provided');
    tr.model.ProcessBase.call(this, model);
    this.pid = pid;
    this.name = undefined;
    this.labels = [];
    this.instantEvents = [];
    this.memoryDumps = [];
    this.frames = [];
    this.activities = [];
  }
269361
public static final synchronized BPMTaskService getTaskService(QName serviceDomainName, QName serviceName) {
        KnowledgeRuntimeManager runtimeManager = KnowledgeRuntimeManagerRegistry.getRuntimeManager(serviceDomainName, serviceName);
        if (runtimeManager != null) {
            RuntimeEngine runtimeEngine = runtimeManager.getRuntimeEngine();
            if (runtimeEngine != null) {
                final TaskService taskService = runtimeEngine.getTaskService();
                if (taskService != null) {
                    InvocationHandler ih = new InvocationHandler() {
                        @Override
                        public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
                            return method.invoke(taskService, args);
                        }
                    };
                    return (BPMTaskService)Proxy.newProxyInstance(BPMTaskService.class.getClassLoader(), new Class[] {BPMTaskService.class}, ih);
                }
            }
        }
        return null;
    }
1018415
public FlowElement getCurrentFlowElement() {
    if (currentFlowElement == null) {
      String processDefinitionId = getProcessDefinitionId();
      if (processDefinitionId != null) {
        org.activiti.bpmn.model.Process process = ProcessDefinitionUtil.getProcess(processDefinitionId);
        currentFlowElement = process.getFlowElement(getCurrentActivityId(), true);
      }
    }
    return currentFlowElement;
  }
749204
public MessageProcessInfoModel getMessageProcessInfo(String strMessageInfoType, String strContactType, String strRequestType, String strMessageProcessType, String strProcessType)
    {
        return null;    // No thin impl
    }
211049
public void parseProcessDefinitions() {
    for (Element processElement : rootElement.elements("process")) {
      boolean isExecutable = !deployment.isNew();
      String isExecutableStr = processElement.attribute("isExecutable");
      if (isExecutableStr != null) {
        isExecutable = Boolean.parseBoolean(isExecutableStr);
        if (!isExecutable) {
          LOG.ignoringNonExecutableProcess(processElement.attribute("id"));
        }
      } else {
        LOG.missingIsExecutableAttribute(processElement.attribute("id"));
      }

      // Only process executable processes
      if (isExecutable) {
        processDefinitions.add(parseProcess(processElement));
      }
    }
  }
631496
public static synchronized Process getProcess(String applicationName, String scopedInstancePath) {
		return PROCESS_MAP.get(toAgentId(applicationName, scopedInstancePath));
	}
202319
@EJB(beanInterface=DefinitionServiceEJBLocal.class)
	@Override
	public void setBpmn2Service(DefinitionService bpmn2Service) {
		
		super.setBpmn2Service(bpmn2Service);
		super.addListener((DeploymentEventListener) bpmn2Service);
	}
1005426
public void initProcessDefinitionCache() {
    if (processDefinitionCache == null) {
      if (processDefinitionCacheLimit <= 0) {
        processDefinitionCache = new DefaultDeploymentCache<ProcessDefinitionCacheEntry>();
      } else {
        processDefinitionCache = new DefaultDeploymentCache<ProcessDefinitionCacheEntry>(processDefinitionCacheLimit);
      }
    }
  }
806461
private ProcessDefinition processProcess(ProcessTextProvider textProvider)
    {
    	int start = textProvider.getPos();
        if (!JavaClass(textProvider))
        {
            throw new ParserException("Missing class name",textProvider);
        }
        textProvider.accumulate(" ");
        String className = textProvider.getLastToken();

//        if (className.indexOf('.') == -1) {
//        	className = textProvider.getPackageName()+className;
//        }
        textProvider.setCurrentScope(className);
    	String processName = getProcessName(textProvider);
        textProvider.addTOCElement(null, processName, start, textProvider.getPos(), TYPE_PROCESS);
    	String launchForm = null;
    	String queueName = null;
    	String description = "";
		if (quotedString('"',textProvider))
		{
			description = textProvider.getLastToken();
		}

        if (exact("launchForm", textProvider)) {
        	exactOrError("=", textProvider);
            if (!CVariable(textProvider))
            {
                throw new ParserException("Missing launch form name",textProvider);
            }
            launchForm = textProvider.getLastToken();
            if (exact("queue", textProvider)) {
            	exactOrError("=", textProvider);
	            if (!quotedString('"', textProvider))
	            {
	                throw new ParserException("Missing queue name",textProvider);
	            }
	            queueName = textProvider.getLastToken();
	            if (textProvider.getWorkflowManager().getQueue(queueName)==null) {
	            	throw new ParserException("Missing queue definition for "+queueName,textProvider);		            	
	            }
            }
        }

        ProcessDefinition ret = new ProcessDefinition(processName, className, textProvider.getWorkflowManager(), launchForm, queueName, textProvider.getPackageName(), description);
        ret.addTask(new TaskStart(ret));
        
        log.debug(ret.getName());
        textProvider.accumulate("\n");
        processTaskList(ret,textProvider);
		commit(textProvider);

        return ret;
    }
372094
@Override
  public void registerProcessEngine(ProcessEngine processEngine) {
    ensureNotNull("Cannot register process engine in Jmx Runtime Container", "process engine", processEngine);

    String processEngineName = processEngine.getName();

    // build and start the service.
    JmxManagedProcessEngine managedProcessEngine = new JmxManagedProcessEngine(processEngine);
    serviceContainer.startService(ServiceTypes.PROCESS_ENGINE, processEngineName, managedProcessEngine);

  }
645444
private static List<String> getSimpleProcess(String processPath, Map<String, String> prms)
    {
        List<String> res = new ArrayList<>(10);

        // Process itself
        res.add(processPath);

        // Optional parameters - keys are just indices to sort the values.
        if (prms.isEmpty())
        {
            return res;
        }

        List<String> keys = new ArrayList<>(prms.keySet());
        Collections.sort(keys, prmComparator);
        for (String p : keys)
        {
            if (!prms.get(p).trim().isEmpty())
            {
                res.add(prms.get(p).trim());
            }
        }

        // Done
        return res;
    }