code: private static Package getPackage(Long processInstanceId) {
          try {
              EventServices eventManager = ServiceLocator.getEventServices();
              Process process = eventManager.findProcessByProcessInstanceId(processInstanceId);
              Package packageVO = PackageCache.getProcessPackage(process.getId());
              return packageVO;
          }
          catch (Exception ex) {
              return null;
          }
      }
docs: Get Package
  @param processInstanceId
  @return