-
1. Re: How to delete existing BPMN processes from the guvnor repository
bulejava Sep 12, 2011 1:00 AM (in response to uvijayreddy657)1 of 1 people found this helpfulselected the file
right click
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
-
2. Re: How to delete existing BPMN processes from the guvnor repository
uvijayreddy657 Sep 12, 2011 4:56 AM (in response to bulejava)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.
Please suggest
-
3. Re: How to delete existing BPMN processes from the guvnor repository
tsurdilovic Sep 16, 2011 2:26 PM (in response to uvijayreddy657)You have to use the Guvnor REST API, more info in the docs: http://docs.jboss.org/drools/release/5.3.0.Beta1/drools-guvnor-docs/html_single/index.html#d0e1680.
Hope this helps.
-
4. Re: How to delete existing BPMN processes from the guvnor repository
uvijayreddy657 Sep 18, 2011 3:13 AM (in response to tsurdilovic)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();Error
java.lang.AbstractMethodError: javax.ws.rs.core.UriBuilder.encode(Z)Ljavax/ws/rs/core/UriBuilder;
I tried googling for the compatible jar version, those are giving different errors. Can you please suggest the compatible jar
-
5. Re: How to delete existing BPMN processes from the guvnor repository
tsurdilovic Sep 30, 2011 9:58 AM (in response to uvijayreddy657)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.
-
6. Re: How to delete existing BPMN processes from the guvnor repository
uvijayreddy657 Oct 1, 2011 6:55 AM (in response to tsurdilovic)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();
-
7. Re: How to delete existing BPMN processes from the guvnor repository
tsurdilovic Oct 1, 2011 11:44 AM (in response to uvijayreddy657)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)
+ "://"
+ ExternalInfo.getExternalHost(profile)
+ "/"
+ profile.getExternalLoadURLSubdomain().substring(0,
profile.getExternalLoadURLSubdomain().indexOf("/"))
+ "/rest/packages/" + packageName + "/assets/" + assetName
+ assetExt;
URL deleteAssetURL = new URL(deleteURL);
HttpURLConnection deleteConnection = (HttpURLConnection) deleteAssetURL
.openConnection();
applyAuth(profile, deleteConnection);
deleteConnection.setRequestMethod("DELETE");
deleteConnection.connect();
_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.
-
8. Re: How to delete existing BPMN processes from the guvnor repository
uvijayreddy657 Oct 3, 2011 5:51 AM (in response to tsurdilovic)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.
-
9. Re: How to delete existing BPMN processes from the guvnor repository
tsurdilovic Oct 3, 2011 8:13 AM (in response to uvijayreddy657)>> 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?
-
10. Re: How to delete existing BPMN processes from the guvnor repository
uvijayreddy657 Oct 5, 2011 2:58 AM (in response to tsurdilovic)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.
Thanks.
-
11. Re: How to delete existing BPMN processes from the guvnor repository
diduch Oct 20, 2011 7:29 PM (in response to uvijayreddy657)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.