Uploaded image for project: 'jBPM'
  1. jBPM
  2. JBPM-3823

Designer validation fails when Reusable Subprocess refers to a different package

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Minor
    • Resolution: Done
    • Affects Version/s: jBPM 5.3
    • Fix Version/s: None
    • Component/s: Designer
    • Labels:
      None

      Description

      In case that you have 2 processes in different packages, you can set one process as 'Called Element' in a 'Reusable Subprocess' of another process. But 'Validate Process' will fail with "No existing process with id=xxxx.XXXX could be found." message.

      You can reproduce it with the attached repository_export_subprocess_in_different_package.xml.

      • Import
      • Open 'parentprocess'
      • Click 'Validate Process'

      BPMN2SyntaxChecker looks at only parent's package.

          if(fe instanceof CallActivity) {
              CallActivity ca = (CallActivity) fe;
              if(ca.getCalledElement() == null || ca.getCalledElement().length() < 1) {
                  addError((CallActivity) fe, "Reusable Subprocess has no called element specified.");
              } else {
                  String[] packageAssetInfo = ServletUtil.findPackageAndAssetInfo(uuid, profile);
                  String packageName = packageAssetInfo[0];
                  List<String> allProcessesInPackage = ServletUtil.getAllProcessesInPackage(packageName, profile);
                  boolean foundCalledElementProcess = false;
                  for(String p : allProcessesInPackage) {
                      String processContent = ServletUtil.getProcessSourceContent(packageName, p, profile);
                      Pattern pattern = Pattern.compile("<\\S*process[\\s\\S]*id=\"" + ca.getCalledElement() + "\"", Pattern.MULTILINE);
                      Matcher m = pattern.matcher(processContent);
                      if(m.find()) {
                          foundCalledElementProcess = true;
                          break;
                      }
                  }
                  if(!foundCalledElementProcess) {
                      addError((CallActivity) fe, "No existing process with id=" + ca.getCalledElement() + " could be found.");
                  }
              }
          }
      

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                tsurdilovic Tihomir Surdilovic
                Reporter:
                tkobayashi Toshiya Kobayashi
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: