1 Reply Latest reply on Apr 26, 2013 4:34 AM by kornilovs

    web-designer. gwt-console. taskform name

    kornilovs

      Hi.

      I tried to create two bpmn2 processes in different packages and used same name as Task name. HTML taskform has created with generation template.

      Then I start second process in jbpm-gwt-console, I see HTML task form from first bpmn2 process from another package. Where is my error?

       

      This is error of gwt-console-server or not?

       

       

      Sorry for my poor english.

       

      This question was here https://community.jboss.org/message/759226#759226

        • 1. Re: web-designer. gwt-console. taskform name
          kornilovs

          I think problem in function  getFormTemplateURLFromGuvnor from package  org.jbpm.integration.console.shared

           

          public String getFormTemplateURLFromGuvnor(String templateName, String format) {
                  List<String> allPackages = getPackageNames();
                  try {
                      for(String pkg : allPackages) {
                          String templateURL = getGuvnorProtocol()
                          + "://"
                          + getGuvnorHost()
                          + "/"
                          + getGuvnorSubdomain()
                          + "/rest/packages/"
                          + pkg
                          + "/assets/"
                          + URLEncoder.encode(templateName, "UTF-8");
          
                          URL checkURL = new URL(templateURL);
                          HttpURLConnection checkConnection = (HttpURLConnection) checkURL.openConnection();
                          checkConnection.setRequestMethod("GET");
                          checkConnection.setRequestProperty("Accept", "application/atom+xml");
                          checkConnection.setConnectTimeout(Integer.parseInt(getGuvnorConnectTimeout()));
                          checkConnection.setReadTimeout(Integer.parseInt(getGuvnorReadTimeout()));
                          applyAuth(checkConnection);
                          checkConnection.connect();
                          if(checkConnection.getResponseCode() == 200) {
          
                              String toReturnURL = getGuvnorProtocol()
                              + "://"
                              + getGuvnorHost()
                              + "/"
                              + getGuvnorSubdomain()
                              + "/org.drools.guvnor.Guvnor/package/"
                              + pkg
                              + "/" + getGuvnorSnapshotName() + "/"
                              + URLEncoder.encode(templateName, "UTF-8")
                              + "." + format;
          
                              return toReturnURL;
                          }
                      }
                  } catch (Exception e) {
                     logger.error("Exception returning template url : " + e.getMessage());
                     return null;
                  }
                  logger.info("Could not find process template url for: " + templateName);
                  return null;
              }
          

           

          this function iterate all packeges from Guvnor and return the first available form-template with given "templateName"