code: public ProcessInstance createProcessInstance(Long processId, String ownerType,
              Long ownerId, String secondaryOwnerType, Long secondaryOwnerId,
              String masterRequestId, Map<String,String> parameters)
      throws ProcessException, DataAccessException {
  
          String label = null, template = null;
          Process process = ProcessCache.getProcess(processId);
          if (process != null) {
              String pkgName = process.getPackageName();
              if (StringHelper.isEmpty(pkgName)) { // This should never happen, but just in case
                  Package pkg = PackageCache.getProcessPackage(processId);
                  if (pkg != null && !pkg.isDefaultPackage())
                      pkgName = pkg.getName();
              }
              if (process.getName().startsWith("$") && parameters.containsKey(process.getName())) {
                  // template process -- name is provided in params
                  label = parameters.get(process.getName());
                  parameters.remove(process.getName());
                  template = process.getLabel();
                  if (!StringHelper.isEmpty(pkgName))
                      template = pkgName + "/" + template;
              }
              else {
                  label = process.getLabel();
                  if (!StringHelper.isEmpty(pkgName))
                      label = pkgName + "/" + label;
              }
          }
  
          TransactionWrapper transaction=null;
          try {
              transaction = startTransaction();
              return engineImpl.createProcessInstance(processId, ownerType,
                      ownerId, secondaryOwnerType, secondaryOwnerId,
                      masterRequestId, parameters, label, template);
          } catch (MdwException e) {
              if (canRetryTransaction(e)) {
                  transaction = (TransactionWrapper)initTransactionRetry(transaction);
                  return ((ProcessExecutor)getTransactionRetrier()).createProcessInstance(processId, ownerType,
                          ownerId, secondaryOwnerType, secondaryOwnerId, masterRequestId, parameters);
              }
              else
                  throw e;
          } finally {
              stopTransaction(transaction);
          }
      }
docs: /////////////////////////////////////