1 of 1 people found this helpful
selected the file
then hover menu named "Gvnor" click "delete"
if you want to delete it thorough,then you have to open http://loclahost:8080/drools-guvnor
left menu Administrator Archive
you can delete them from the table
From the Java Program how can I delete the particular selected process.
For example, I have a Delete button on the JSF web page when I submit it, should delete the selected process.
Thanks for the reply Tihomir.
I added cxf-bundle-jaxrs.2.3.0.jar and droolsjbpm-ide-common.5.3.0.jar to the project classpath. I am always getting the following error when creating instance of WebClient.create("http://127.0.0.1:8080/")
Code Segment which I am using to delete:
WebClient client = WebClient.create(http://127.0.0.1:8080/); //Getting error in this line only
Response response =client.path("/drools-guvnor/rest/packages/SDS/assets/assetName").accept("application/xml").delete();
I tried googling for the compatible jar version, those are giving different errors. Can you please suggest the compatible jar
Guvnor contains cxf jars version 2.4.1, maybe that will help to use the same ones as what's in Guvnor already (in /WEB-INF/lib). I have used so far only standard HttpUrlConnection which has worked fine.
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
connection = (HttpURLConnection) url.openConnection();
"Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:18.104.22.168) Gecko/20110319 Firefox/3.6.16");
connection.setReadTimeout(5 * 60 * 1000);
Hi you can see some specific examples here: https://github.com/tsurdilo/process-designer/blob/master/src/main/java/com/intalio/web/server/TaskFormsServlet.java , https://github.com/tsurdilo/process-designer/blob/master/src/main/java/com/intalio/web/server/TransformerServlet.java , and here: https://github.com/droolsjbpm/jbpm/blob/master/jbpm-gwt/jbpm-gwt-shared/src/main/java/org/jbpm/integration/console/shared/GuvnorConnectionUtils.java
For deleting assets here is an example:
String deleteURL = ExternalInfo.getExternalProtocol(profile)
+ "/rest/packages/" + packageName + "/assets/" + assetName
URL deleteAssetURL = new URL(deleteURL);
HttpURLConnection deleteConnection = (HttpURLConnection) deleteAssetURL
_logger.info("delete connection response code: " + deleteConnection.getResponseCode());
If have set up authentication in Guvnor, the applyAuth method sets the Basic Authorization header with the encoded username and password.
Hope this helps.
Thanks for the reply Tihomir.
The code fragment which you posted is almost same what I posted in my previous one. However this code is not deleting the process from Guvnor repository.
>> However this code is not deleting the process from Guvnor repository. << Then something else is wrong, and you should try to debug and look at the logs. What Guvnor version are you using?
I replaced jar jsr311-api-1.0.jar to jsr311-api-1.1.1.jar solved the URIBuilder Error Issue. Now I am able to delete the process from the guvnor repository using the following code snippet.
WebClient client = WebClient.create("http://localhost:8080/drools-guvnor/rest/packages/SDS/assets/"+ asset.getName(), "admin", "admin", null);
Response response = client.delete();
I hope this would help someone.
how can I create some package from my java application.
I want to create a new package, in the page the user send a package name, and I want to create a package with that name in the guvnor, after that the user could create workflows in that package, there is not problem with create assets into the package, I can create that, but I cant create the package, Can somebody help me?
Thanks for your Help.