JBoss Community

Re: How to delete existing BPMN processes from the guvnor repository

created by uvijayreddy657 in jBPM Development - View the full discussion

I tried using HttpURLConnection to delete the process using the following code as WebClient is always giving me the UriBuilder error. But it is not deleting the process. Can you please suggest whether this works or not/ any modifactions required  for deleting asset

 

 

URL url = new URL(guvnorRepoURL

                     + "/drools-guvnor/rest/packages/SDS/assets/"

                     + asset.getName());

connection = (HttpURLConnection) url.openConnection();

                   

connection.setRequestMethod("DELETE");

connection

                     .setRequestProperty(

                     "User-Agent",

                     "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2.16) Gecko/20110319 Firefox/3.6.16");

connection

                     .setRequestProperty("Accept",3

                    

                     "text/html,application/xhtml+xml,application/xml;q=0.9,*;q=0.8");

connection.setRequestProperty("Accept-Language",

                     "en-us,en;q=0.5");

connection.setRequestProperty("Accept-Encoding",

                     "gzip,deflate");

connection.setRequestProperty("charset", "UTF-8");

connection.setReadTimeout(5 * 60 * 1000);

connection.connect();

Reply to this message by going to Community

Start a new discussion in jBPM Development at Community